How can I read aws device shadow attributes?

esprima
Posts: 7
Joined: Wed Oct 28, 2020 2:52 pm

How can I read aws device shadow attributes?

Postby esprima » Fri Jun 25, 2021 10:42 am

Hi.
I want to read aws shadow attributes and get desired states.
{
"desired": {
"A": "TEST1",
"B": "TEST2",
"C": 1234,
"D": 5678
},
"reported": {
.
.
.
}
I want to read value of A , B, C and D.

How can I read these?

#define AWS_SHADOW_GET "$aws/things/thingname/shadow/get"
aws_iot_mqtt_publish(&client, AWS_SHADOW_GET, strlen(AWS_SHADOW_GET), &paramsQOS1);

In aws documents , I must published empty message for this reason. But what means the empty message???

Is this empty message :
sprintf(cPayload, "{"state":{}, "clientToken":"thingname-0"}");
or
sprintf(cPayload, "{"state":{}}");
or ... ?

Thanks.

Who is online

Users browsing this forum: No registered users and 54 guests