How can I query the connection status of an IoT device?

0

Hi,

I need to query an IoT device (from a Java server application) to find out whether it is connected or disconnected.

I know that this information can be obtained by subscribing to the "presence" events. I do this, and it works most of the time. Occasionally my server misses a presence event because it's down when the event occurs. I'd like to be able to query for the status to make sure I account for these circumstances.

I don't see anything in the device shadow that appears to be the connection status. Is it possible to do this?

Thanks, Frank

Frank
已提问 1 年前258 查看次数
1 回答
0

Hi there!

There are couple ways to do this. As you mentioned presence events can be monitored. Instead of your server doing this, you can create an AWS IoT Rule that invokes a Lambda function to process connect and disconnect events. Then you can either update a datastore of your own choosing such as DynamoDB, or you could add that data to the thing's shadow (UpdateShadow). Then your application could query the datastore or shadow for current status.

You can also enable fleet indexing for thing connectivity. Then you can make direct queries via Fleet Indexing for state of a single device or even the aggregate of all devices.

Note: Enabling Fleet Indexing does add additional costs to both updates and when performing queries. The pricing page has more details on that.

AWS
Gavin_A
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则