ESP32 MQTT onMessage Callback never called

Trying to compare the working example and your code and the main thing that stands out is the differences in sendData()
The example packs the message into a JSON object that it published to "$aws/things/" THINGNAME "/shadow/update".
I don't know if AWS expects the data in JSON format or if this is just for the end device that subscribes to the topic.
Your code does not put the message into a JSON object (and I suspect you don't need to) and publishes the message to "$aws/things/chicken-door/shadow/name/door/get/accepted" but I suspect it should be published to "$aws/things/chicken-door/shadow/name/door/update"

1 Like