Felix wang
Felix wang

Reputation: 15

How to determine if the aws iot core is disconnected

I have a program that uses aws IOT core. I need to determine whether to connect to the aws iot core in real time on the Raspberry Pi. If it connect to the iot core, then will accept the topic from the iot core. If there is no connection with the iot core, let the Raspberry Pi execute locally. The logic, I don't know if you have a similar demo or reference code.

Upvotes: 0

Views: 109

Answers (1)

monsur
monsur

Reputation: 601

We solved this problem by publishing to a ping topic.If the ping topic sends a reply through a IoT rules to another topic which the raspberry pi is subscribed to within 5 seconds we decided core is online otherwise offline.

AWS freertos now supports disconnect event though meaning you will get a notification if the device disconnected from core now it's up to you whether you attempt to reconnect or start processing locally.

Hope that helps.

Upvotes: 0

Related Questions