- Newest
- Most votes
- Most comments
When you client is disconnected while publishing or subscribing the reason might be the IoT policy that is used. If you are not allowed to publish or subscribe to a topic your client is being disconnected.
You can use CloudWatch logs to drill down this error further. If the IoT policy is the reason you will find an authorization error in CloudWatch logs.
KR,
Philipp
Not sure if you are still running into this problem but I was just faced with something similar. I spun up a second device and whenever one contacted AWS the other disconnected. I was sure I had made a mistake with credentials or something but actually I had overlooked an AT command from the MQTT Operation Example. When you send AT+QMTCONN=<client_idx>,<clientID>[,<username>[,<password>]]
your clientID needs to be unique for each individual device. Changed clientID to be my thingName and everything has been smooth sailing since.
Hope it helps.
hans
Relevant content
- Accepted Answerasked a year ago
- Accepted Answerasked 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
What is the payload size you are publishing? Have you enabled CloudWatch logging on the AWS IoT side? What do they tell? What is the disconnection reason you get on the disconnect Lifecycle events? (https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html)