Hello,
i am facing a weird issue. I can cannoect to AWS mqtt using both Websockets and MQTT protocol by client certificate x509 authentication.
But when i subscribe to topics "$aws/things/thingName/shadow/update/received", or "$aws/things/thingName/shadow/get/received" or even "$aws/things/thingName/shadow/#" i dont get these messages. With the same MQTT broker and same certificates on different client, i get all messages.
If i create any other topics, i do get all messages properly. This seems to be limited to $aws topics names.
Hello @KostteT ,
I wanted to just subscribe not publish. That part is taken care by another application which updates shadow using REST api. As per AWS documentation, clients can connect to these topics and will get updates when there is change in data. I have also verified this on external client on my android. I subscribed to those topics. When i update the AWS using the HTTP API from my another client, i get the updates on the Android client, but now on esp.
Also i tried adding some raw logs in the library to see if some data is received. Its seems there is some activity when message is pushed from aws, but it is not acked or picked up by library.
about $ https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices
Topics that long are likely to cause issues with the MAX_PACKET_SIZE of 128 - https://github.com/knolleary/pubsubclient/blob/master/src/PubSubClient.h#L26
When you try other topics, are they of similar length?
I have the similar issue. It is for topics starting with $. In this case, the thing shadow MQTT topics from AWS IoT Core.
Using MQTT.Fx (v.1.7.1, not previous versions), I can publish to and receive subscrition message from $aws/ topics. But cannot receive subscrition messages from pubsubClient via Arduino.
Looks like http://github.com/odelot/aws-mqtt-websockets is a work-around.
I wanted to chime in 2 years after the fact and +1 @knolleary for suggesting changing the MAX_PACKET_SIZE. I changed it to 1024 and am now able to see my accepted state changes.
https://stackoverflow.com/questions/59180900/esp8266-subscribe-to-aws-iot-topic
I'd expect the library to throw some sort of 'message received but not parsed' message, which was what made me think it had something to do with the topic name instead of the message contents.
Most helpful comment
Topics that long are likely to cause issues with the MAX_PACKET_SIZE of 128 - https://github.com/knolleary/pubsubclient/blob/master/src/PubSubClient.h#L26
When you try other topics, are they of similar length?