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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ