- Mais recentes
- Mais votos
- Mais comentários
If you need to query on a per-thing status or are looking for aggregate numbers, Fleet Indexing Connectivity can be used to provide connectivity status (connected or disconnected) and the timestamp for the reported status. In order to use, you do need to enable fleet indexing for connectivity which will incur charges for Index Updates which is metered for every device connect and disconnect, and the for Search Queries when you query the index.
We find that some customers need more granular data or wish to query it based on ways that Fleet Indexing doesn't provide. In that case, the approach you have taken with processing lifecycle events is the recommended approach. If Fleet Indexing doesn't suit your needs, please reply and we'll find a solution!
Conteúdo relevante
- AWS OFICIALAtualizada há um ano
- AWS OFICIALAtualizada há um ano
- AWS OFICIALAtualizada há 3 anos
- AWS OFICIALAtualizada há 2 anos
Here's a sample of using the lifecycle events: https://github.com/aws-samples/connectivity-management-example-for-aws-iot-core. You might also choose to store the status in shadows rather than DynamoDB. And this previous question and answer might be of interest if you do make use of fleet indexing: https://repost.aws/questions/QUp6B-SMa4SFavCfq4nT-EcQ/how-does-one-use-the-thingconnectivity-class-in-the-sdks-there-is-no-way-to-set-the-thing-name
Hi Galvin, thanks a lot for the response. By reading the posts shared by Greg, I found the SearchIndex API that allows us to list the things with their connected status. Before finding this, we tried the lifecycle events approach to populate a DynamoDB table and use clientId as the partition key. But many unnecessary entries are populated with random clientId that start with the prefix "iotconsole" or "mqttjs". We are still testing our approach. How do we make sure that the database entries are clean? Concerning Fleet Indexing on the thing registry, I couldn't run a search query. I ran an example query such as connectivity.connected:false, but it returned an error "A query is required to perform a search". How do I write queries in the search box?
Hi Greg, could you please enlighten me on how to store the connectivity status in device shadows? Should the device be programmed to use classic shadows? What else is required besides turning on fleet indexing in the settings and enabling thing shadows? Can we fetch the status using the GetThingShadow API?
Hi Sandeep. The "iotconsole" clientId is from you or your team using the MQTT test client. That is the client ID it uses. "mqttjs" is from perhaps your application connecting to the broker? You could modify the rule action or the Lambda to filter out clients you're not interested in.
Just as that sample uses a Lambda to write into DynamoDB, you could modify it to write to different storage. Shadows is just one possibility. The Lambda could use UpdateThingShadow if you did want to write to the shadow. You would not need to modify the device.