adafruit / Adafruit_MQTT_Library

Arduino library for MQTT support
MIT License
573 stars 291 forks source link

Support large packet publishing with ESP8266 #113

Open hjf opened 6 years ago

hjf commented 6 years ago

When sending large packets with ESP8266's WiFiClient, the library prints a couple hundred bytes and then garbage. The Adafruit library sends 250 bytes at a time to publish the packet. This is where it fails. Fortunately, ESP8266's implementation of Client supports large packets by itself. It will take care of splitting data even beyond the IP packet's MTU.

This fix conditionally enables sending the complete package to WiFiClient with a simple IFDEF ESP8266.

Tested on Arduino 1.8.5.