'AWS IOT: Get Thing connection status

I currently have a bunch or things registered in the AWS IOT console. i am building a web-page that will list things and display attributes from each things shadow. i am struggling to understand how do i know if a thing is currently online in (near) real time. I am retrieving the things using the PHP SDK

IotClient->listThings()

I am displaying their attributes using

IotDataPlaneClient->getThingShadow()

and

IotDataPlaneClient->updateThingShadow()

to update the shadow and this is all working fine.

But i have no way of knowing Whether or not a thing is online at a the moment.



Solution 1:[1]

a bit expensive solution I use: I have 2 lambda that writing on the shadow when the device connects or disconnects, looking at the topic $aws/events/presence/connected/+ / $aws/events/presence/disconnected/+

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Matteo