Closed myie9 closed 3 years ago
The max size is:
// Largest full packet we're able to send.
// Need to be able to store at least ~90 chars for a connect packet with full
// 23 char client ID.
#define MAXBUFFERSIZE (150)
After spending a long time pulling my hair to understand why I was hitting a panic when attempting to read from my registered subscriptions, I found out that the subscriptions member of the Adafruit_MQTT instance was corrupted. :(
Turns out the memory corruption was caused by my publish call, where the payload I was providing was bigger than the allocated space in the buffer for construction of the packet.
@myie9 : Please take a look at https://github.com/adafruit/Adafruit_MQTT_Library/pull/166 and see if that addresses your issue.
When publish long message as below. It would crash after receive some subscribe. But it' ok if publish short message. What's the max size for publish in esp8266?
String strConfig = "{\"iQiTiYuZhi\":" + String(g_iQiTiYuZhi) + ", \"iKeepAlertTime\":" + String(g_iKeepAlertTime) + ", \"iAlertWhenYouRen\":" + String(g_iAlertWhenYouRen)