MQTT and OTA update conflicts

A project log for WiFi Clock

An ESP8266 based LED Clock that automatically sets the time and demonstrates many features of the Sming framework.

Kevin KesslerKevin Kessler 05/17/2016 at 16:440 Comments

I found that OTA updates were very unreliable when the ESP8266 was connected to the MQTT broker, probably due to the fact that the MQTT keep-alives would interfere with the download of the firmware image. The Sming MQTT client class did not have the disconnect functionality, so I had to add that myself. Because all of the Sming MQTT Client class elements were private, I could not simply derive my class from theirs, I had to create a copy of the Sming class, KMKMqttClient, and add the disconnect functionality. It is a hack, but I now call the disconnect method before the OTA download, and it is very reliable.