-
Notifications
You must be signed in to change notification settings - Fork 157
Error, client state: -1 #56
Comments
Your buffer size is too short |
When I print MQTT_MAX_PACKET_SIZE it's 512. Is not enough? |
No , go to 1024 or 2048 |
the same problem with 2048 also! :( |
1024 or 2048 for MQTT_MAX_PACKET_SIZE produce the same error (also directly into the CloudIoTCoreMQTTClient.h file and print the value on serial in order to verify that it's ok) . |
This could also be caused by incorrect configuration. Maybe try eliminating one of the variables and use one of the HTTP examples; if it doesn't work with HTTP, it definitely won't work with the MQTT. Also, if you're using the library from before 1.0.4, there was a bug where the JWT was not correctly getting generated, try updating the library too. |
I used the last version (1.0.5) for my test with 1024 and 2048 buffer size. I'm working on ESP32 and there isn't http example for it. I'm in wrong? |
Alessandro, Try to change size directly on pubsubclient configuration file . Btw also look at mqtt error codes , you can find a good tables of it on lwmqtt arduino repository |
WOW! Now with 1024 (with 2048 esp32 go in bootloop) on file pubsubclient.h I have this: A big step forward! :P |
@alexodus Try out my branch with the Esp32-lwmqtt example, I find it simpler. |
@alexodus the esp32-ssd1306 example is HTTP, probably could use a rename ^_^. |
SOLVED! I had only set MQTT_MAX_PACKET_SIZE more than 324 into pubsubclient.h (I don't like it but I think this is a platformio problem). MQTT_CONNECT_UNAUTHORIZED happen because I modified the private key for test :P |
Best solution for platformio: add this line on platformio.ini file |
Ahh, thank you @alexodus may be worth adding to the readme, if you want me to do it, happy to accept an issue, if you want to make a PR, happy to review. |
Added note to the readme, thanks for the errata! |
in the esp32-mqtt example I obtain always this result. I'm using platformio with platform espressif 32 v1.5.0.
The text was updated successfully, but these errors were encountered: