Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with MQTT Failed to Subscribe using Mosquitto 1.4.7 #31

Open
xtaega opened this issue Mar 10, 2016 · 4 comments
Open

Issues with MQTT Failed to Subscribe using Mosquitto 1.4.7 #31

xtaega opened this issue Mar 10, 2016 · 4 comments

Comments

@xtaega
Copy link

xtaega commented Mar 10, 2016

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.

@vmanuel
Copy link

vmanuel commented Mar 27, 2016

It worked for me.

Thanks!

@fabiolr
Copy link

fabiolr commented Apr 23, 2016

This solved it for me too. Thanks

@ladyada
Copy link
Member

ladyada commented Jul 6, 2016

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;
    }

@dineshdoifode
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants