-->
Page 1 of 1

MQTT packet size limit?

PostPosted: Wed Nov 16, 2016 11:14 am
by sajado
I was wondering if anyone has come up against any size limits regarding the packets sent over MQTT.

I am using the Adafruit MQTT library and using Arduino IDE to write and upload to my ESP12F. If I use the IO Adafruit service as a broker, I can successfully publish a char array of over 100 characters. With the same code but connecting to another broker (just changing the server, username, etc), anything over 82 characters fails to publish and crashes my ESP. I know this broker can accept much longer arrays (100s) from other clients (not ESPs), and I was wondering if anyone had any similar experiences? And if so... how did you get around it?

Re: MQTT packet size limit?

PostPosted: Mon Jan 02, 2017 7:56 pm
by vossilius
Hi sajado,

Having a similar issue here using ESP-07 with pubsubclient.h. Once my message reaches 100 characters .publish() returns 'false' eventhough default package size of the library is 128 bytes and I increased MQTT_MAX_PACKET_SIZE to 255 bytes. But I am able to send the same message that fails to be sent via the ESP8266 client using a MQTT tool so it's not a broker issue.

My working hypothesis still is some wrong variable declaration hidden somewhere in my code but your post makes me thinking...