-
PWM and the ESP8266
05/17/2016 at 16:52 • 0 commentsBoy those blue leds are bright, and the really need dimmed to prevent the bedroom to be lit up like a movie studio. Unfortunately, PWM on the ESP8266 is somewhat broken, in that you cannot get the duty cycle below about 20%. I only discovered only after I built the clock PCB, so I had to bodge in a single inverter, 74HC1G04, into the !OE line of the shift registers. Now, instead of having a duty cycle of effectively 20%-100%, I have a duty cycle of 0%-80%, and can dim the display enough (about 10% duty cycle). Since the LEDs are so bright, maxing out the brightness at 80% is not a problem. The schematic and PCB eagle files are updated to show this modification.
-
MQTT and OTA update conflicts
05/17/2016 at 16:44 • 0 commentsI 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.