Adafruit_MQTT_Library icon indicating copy to clipboard operation
Adafruit_MQTT_Library copied to clipboard

Issues with MQTT Failed to Subscribe using Mosquitto 1.4.7

Open xtaega opened this issue 9 years ago • 4 comments

There is an issue subscribing to MQTT topics using the Adafruit MQTT Library across Bridge on the Arduino Yun.

I have isolated the line of troublesome code down to line 248 of Adafruit_MQTT.cpp, inside of Adafruit_MQTT::readFullPacket

if (multiplier > 128*128*128) { DEBUG_PRINT(F("Malformed packet len\n")); return 0; }

Activating the debug mode and adding an additional PRINT statement reveals that the value of multiplier is 128 when the code fails and returns, which doesnt seem to make a whole lot of sense, as this code should not run in that case.

Commenting this block out has resolved the issue.

xtaega avatar Mar 10 '16 23:03 xtaega

It worked for me.

Thanks!

vmanuel avatar Mar 27 '16 21:03 vmanuel

This solved it for me too. Thanks

fabiolr avatar Apr 23 '16 19:04 fabiolr

hey can you try this with the fix of changing that line to this? kinda weird its not working. if it still doesnt work can you post the exact Yun code (minus authentication) so i can replicate?

    if (multiplier > (128UL*128UL*128UL)) {
      DEBUG_PRINT(F("Malformed packet len\n"));
      return 0;
    }

ladyada avatar Jul 06 '16 22:07 ladyada

There is an issue subscribing to MQTT topics using the Adafruit MQTT Library on the NodeMcu methods:- Adafruit_MQTT_Subscribe Light1 = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/light1"); Adafruit_MQTT_Subscribe Light2 = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/light2"); Adafruit_MQTT_Subscribe Light3 = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/light3"); Adafruit_MQTT_Subscribe Light4 = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/light4");

image image i am facing packet drop issue

dineshdoifode avatar May 13 '19 10:05 dineshdoifode