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
질문됨 일 년 전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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인