-
Notifications
You must be signed in to change notification settings - Fork 41
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
Invalid CONNACK packet #41
Comments
This might explain why I couldn't connect from either MQTT Explorer on the PC or from MQTT Analyser on my phone. I could connect to the AP fine but had no luck with any client. Thought it was something I was missing. |
I fixed this issue by replacing:
to:
Unfortunately, I am getting more errors now. |
Hello cepr For some optimisation reasons, the size with TinyMQTT is always on 2 bytes. And.... for an obscure reason, the ConnAck packet does not respect the variable packet length encoding (see 2.2.3 Remaining Length). As you've pointed this bug, I have to rewrite the packet length encoding... Thanks for your report. |
Back... I wrote a data observer in ESP8266 Wifi mock in order to add a unit test before fixing that bug. |
Some news : using the new feature of ESP8266 Mock, I can see this :
Thanks to this unit test, the fix will long last :-) |
Hello cepr I've fixed the length encoding for (all) messages.
Thanks again for reporting. |
Thanks hsaturn, I'll try now! |
Thanks to you. Keep in mind that this is the git version yet, the lib has not been released with the fix yet. |
It works, thanks hsaturn. Here are the tests I did: This broker is now compatible with the following clients:
The board I am using is not very common and requires a different include for the WiFi to work, I added those lines in TinyMqtt.h for my testing:
|
Thanks a lot Cedric !!! I will add the 3 lines you mention. Even if I do not know who else than you will use them, and even if I do not understand what they mean. I have released the 0.9.0 version with this bugfix. But it seems now that my lib cannot be installed easilly (dependency with AsyncTCP...) Also I have to fix a bug on incomplete decoding of topics (Issue #30). Release 0.9.2 includes your lines. |
The CONNACK packet generated by TinyMqtt doesn't look right.
TinyMqtt generated this: 20 82 00 00 00
I was expecting: 20 02 xx xx (Assuming MQTT 3.1.1)
This bug prevents Adafruit_MQTT_Library from connecting to this broker. I'm sure other MQTT clients will have the same issue.
The text was updated successfully, but these errors were encountered: