Closed cbitter78 closed 3 years ago
I am also struggling with this bug.
I dug a little inside this code and found that the problem is in topic length decoding.
Look into Adafruit_MQTT.cpp
line 494 there is a hardcoded reading 4-th byte to get topic length
topiclen = buffer[3];
in case of packet length grater than 127 topic length becomes 5-th byte.
this should be resolved with PR #193
Overview
If you send data that results in a packet that exceeds 127 bytes then the packets are read but it does not find the subscription because it shows the len of the subscription as 0 If I send 127 bytes it works, 128 and up does not.
The data that was sent to my feed is (I only sent the data once)
The feed name is 32 bytes cbitter78/feeds/iot-beer-command
From my novice reading of the code the debug message Looking for subscription len shows it thinks the subscription name has zero length.
I tried setting
SUBSCRIPTIONDATALEN: 250 MAXBUFFERSIZE: 250
This had no effect. I still could only send 93 bytes.
Reproduce
Subscribe to a feed and read it using
readSubscription
method. See this example then post enough bytes to the subscribed feed to exceed 127 bytes (this includes the feed name)You will need to set MQTT_DEBUG
Info