Amazon Mqtt connection lost



In my application I’m able to connect to the Amazon AWS IoT core via mqtt. But after several hours, first I’m not able to control my device anymore via the Shadow (desired), then, after a few hours I see this message in the AWS control page: "Mqtt connection lost. Reconnect. Error code: 8. AMQJS0008I Socket closed."

What can be the problem?


Hi @Marcel,

are you able to check if the device is still “alive”?


Hi LorenzoR, how exactly do you mean?



I mean to check if the device is freezed due to a runtime crash or if it is a problem with the reconnection procedure.

Anyway I would suggest, if not already done, to create VMs updated to the latest patch since a reset mechanism for uncaught exceptions and faults has been added to avoid the possibility of the device getting stuck on unexpected errors.


Hi, the device didn’t hang or something. It worked normally and is already working on VM P02