Device MetaData in AWS IOT core

0

Can we store Device/Thing MetaData in AWS IOT core ? We have iot things that we provision using fleet provisioning. These devices have metadata associated with it and other characteristics example battery health data which can change. What is a good practice to maintain this data ? Should we use device shadows to maintain the battery health etc ? This data only flows from the device to aws and not vice versa , is the device shadow still a good place to hold the information ? How do we store the metadata associated with a thing ? We will need to retrieve this data using api's when needed.

1 Antwort
1

Hi, to store data related to the device that changes over time you can use Thing Shadows. To report state you will publish your data on $aws/thing/<thing_name>/shadow/update in the following format

{
  "state": {
      "reported": {
           "battery": 0.40
      }
   }
}

To read the data you can either use the Thing Shadow REST API GetThingShadow [1] or subscribe to $aws/thing/<thing_name>/shadow/get/+ and publish a message on $aws/thing/<thing_name>/shadow/get. [2]

[1] https://docs.aws.amazon.com/iot/latest/apireference/API_iotdata_GetThingShadow.html [2] https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html

AWS
EXPERTE
beantwortet vor 2 Jahren
  • Thank you . And can you help me with what is a good practice to store the metadata ?

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen