Open anaptfox opened 7 years ago
Is anyone looking into addressing this issue? I's critical for me to get the Adafruit Feather 32u4 FONA to connect to Losant's MQTT broker.
theres no ETA for a fix!
I resolved an error in readSubscription that was not adjusting the buffer index references based on the number of header “length” bytes.
I just submitted a fork request. This is my first attempt on github so bear with me if I did something wrong.
Arduino board: Feather Huzzah
Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.0
List the steps to reproduce the problem below (if possible attach a sketch or copy the sketch code in too):
I'm experiencing this same issue:
https://github.com/adafruit/Adafruit_MQTT_Library/issues/17#issuecomment-231225233
This issue is in byte 2 of the packet:
https://github.com/adafruit/Adafruit_MQTT_Library/blob/master/Adafruit_MQTT.cpp#L628
The variable length encoding scheme uses a single byte for messages up to 127 bytes long. Longer messages are handled as follows. Seven bits of each byte encode the Remaining Length data, and the eighth bit indicates any following bytes in the representation. Each byte encodes 128 values and a "continuation bit". For example, the number 64 decimal is encoded as a single byte, decimal value 64, hex 0x40. The number 321 decimal (= 65 + 2*128) is encoded as two bytes, least significant first. The first byte 65+128 = 193. Note that the top bit is set to indicate at least one following byte. The second byte is 2.
This issue was fixed in Publish ( in issue #17), but not in Connect or Subscribe. In both you are limited to 127 bytes.