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
asked a year ago247 views
1 Answer
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
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions