简体   繁体   中英

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.

Use Fleet Indexing to track status of connectivity.

The information indexed per Thing:
{name:connectivity.timestamp, type:Number}, {name:connectivity.version, type:Number}, {name:connectivity.connected, type:Boolean}

*Remember the clientId used to connect must also exist as a Thing in the Thing registry.

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/+

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM