- Newest
- Most votes
- Most comments
Hi. Are you using the same client ID in each? You can't make multiple connections with the same client ID. If you do, you'll keep suffering DUPLICATE_CLIENTID
disconnections: https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html#connect-disconnect
I am using the same client ID. When I used separate it didn't work. I'll try again, if it fails I'll post the error and code. Thank you !
the deploy i tried using thingname_publisher and thingname_subscriber and it always gets this error any time the client id is not just thingname, so obviously I can use this on both my pub.py and sub.py any time i do this i get:
trying core arn:aws:iot:us-east-1:account_id:thing/GreengrassCoreDevice1 at host local_ip port 8883 [ERROR] [2024-07-17T17:34:40Z] [0000772ef28fd640] [mqtt-client] - id=0x615c6c9abba0: invalid connect return code 4, disconnecting Connection failed with exception AWS_ERROR_MQTT_PROTOCOL_ERROR: Protocol error occurred. Trying core arn:aws:iot:us-east-1:account_id:thing/GreengrassQuickStartCore-190714f0a37 at host 192.168.50.190 port 8883 [ERROR] [2024-07-17T17:34:40Z] [0000772ef4d501c0] [mqtt-client] - id=0x615c6c9abba0: Connection is not open, and may not be closed [ERROR] [2024-07-17T17:34:41Z] [0000772ef28fd640] [mqtt-client] - id=0x615c6ca652c0: invalid connect return code 4, disconnecting Connection failed with exception AWS_ERROR_MQTT_PROTOCOL_ERROR: Protocol error occurred. Trying core arn:aws:iot:us-east-1:account_id:thing/GreengrassQuickStartCore-190bdcfbf05 at host local_ip port 8883 [ERROR] [2024-07-17T17:34:41Z] [0000772ef4d501c0] [mqtt-client] - id=0x615c6ca652c0: Connection is not open, and may not be closed [ERROR] [2024-07-17T17:34:42Z] [0000772ef20fc640] [mqtt-client] - id=0x615c6ca4e980: invalid connect return code 4, disconnecting Connection failed with exception AWS_ERROR_MQTT_PROTOCOL_ERROR: Protocol error occurred.
The client names you use have to match the things you associated with the device: https://docs.aws.amazon.com/greengrass/v2/developerguide/client-devices-tutorial.html#enable-client-device-support
It seems I have been going about this all wrong. I setup GG on a docker container, and then outside of the docker had a python script to subscribe and publish. I seems I need more than one thing (for the gg), if I use the same py file for pub sub then one more will do, otherwise separate files means 2 extra things. I think this is correct, will update later. I was also using the crt and pem file from the main thing that gets created when gg install, in my pub/sub so that's probably a probably also, they need their own thing/keys. Thanks.
one of many of things I was doing wrong.
Relevant content
- Accepted Answerasked 6 months ago
- asked a year ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
I was doing so many things wrong. For anyone else just follow these 2 videos and it will get you started in the right direction. @Greg_B your comment helped as well, so thank-you to both of you. https://www.youtube.com/watch?v=DcppAQ9ENvA https://www.youtube.com/watch?v=tN0DQlQy2kM