-
Notifications
You must be signed in to change notification settings - Fork 74
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
MQTT packet size #60
Comments
I haven't seen this behavior, but I also haven't tested this code on an ESP32. Have you tried increasing the JSON buffer size by increasing the value here?: https://github.com/corbanmailloux/esp-mqtt-rgb-led/blob/master/mqtt_esp8266_light/mqtt_esp8266_light.ino#L27 |
Yeah I tried to increase JSON buffer also. Even if the JSON buffer is too short this shouldn't have effect on callback(), I think. MQTT default message size is 128 bytes which might be an issue, and you can't define it in sketch. I'll give this a try: |
So indeed I made local change to PubSubClient.h line 29 ...And now it works as intented. This problems seems to be known for long. I wonder how you've not seen this before because this is not ESPxxx relevant issue and mqtt packet is almost always >126 bytes long.. |
Hello. I have implemented this to ESP32 with simple cp-paste from example sketches. Basically I changed:
#include <ESP8266WiFi.h> to #include <WiFi.h>
analog.Writes to corresponding ledc library.
JSON library is intact as it should be.
However for some reason callback() function isn't called if JSON message is too long. 6 lines/objects is fine, 7 or more isn't.
I did found that message goes nicely to thru MQTT broker and that it doesn't matter which objects are in the payload. Other than that I'm out of ideas.
The text was updated successfully, but these errors were encountered: