When I first open MQTT test client for the device I can see data when I subscribe to “CTS_MAN/#”. However, the “$aws/things/CTS_MAN/shadow/update/documents” subscription shows no data at all. I can see this subscription working for my AWS gateway (previously integrated) however not for this new MQTT device.
Sorry @scott.wells not sure why I’m not getting notifications about this thread. Please tag me in future replies.
AWS IoT Core Doc here outlines everything about interacting with the Shadow Document through MQTT:
Keep in mind the policy attached to the AWS IoT Thing you created needs to specify the device is allowed to update the shadow document. If you’re not sure please provide the device policy document here so I can take a look. It needs to specify allow:publish for the Device Shadow Document resource like this:
I’ve updated the “topic” to “$aws/things/CTS_MAN_11/shadow/update”. CTS_MAN_11 is the thing name.
The security policy I used was the one created when adding a NCD AWS Gateway previously. To try and eliminate this issue I have created a new policy specifically for this new device. I followed your instructions here: Connecting MQTT WiFi Sensors to AWS IoT Core - NCD.io
I think I see the problem. It’s been a long time since I wrote the AWS Gateway firmware. It looks like updating the shadow document requires the payload JSON to be in a particular format including reported state like this: