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
demandé il y a un an258 vues
1 réponse
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
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions