Closed whyz closed 4 years ago
Without the increased buffer size, status messages bigger than 128 bytes are discarded and never sent to the MQTT server. This fix is crucial, at least on nodemcu v3.
I've merged Riksarchens version with Pubsubclient just now. I think you can adjust the max value here to:
https://github.com/knolleary/pubsubclient/blob/master/src/PubSubClient.h 26 #define MQTT_MAX_PACKET_SIZE 128
But I wonder if we should allow larger messages or if we should trim the messages to a more reasonable size instead?
Increased MQTTClient buffer size from (default) 128 to 256 to be able to fit larger JSON messages. Fix compilation warning. extern MQTTClient.