By using AWS re:Post, you agree to the Terms of Use

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 Answer
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

EXPERT
answered 2 months ago
  • Thank you . And can you help me with what is a good practice to store the metadata ?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions