My D1 mini pro shares my Home energy data with my HA through ESPHOME 2022.11.2, while the device works fine I am having issues with OTA updates, I mean the OTA update finishes successfully but D1 does not boot after that, and soft reset or power cycle do not help.
To get it working again I have to download the firmware and install it through a USB TTL adapter with ESPHOME-flasher.
its kind of a hassle to pull out the energy monitoring system from the junction box every time to update the firmware, does anyone have a similar issue, any fix or workaround will be appreciated.
Is it possible that you have the Wemos D1 Mini Pro too close to another WiFi devices? These things are very easy to jam an cause instabilities wich results to a failed OTA.
I have not saved them but the progress bar thing goes to 100% and I get the message âsuccessfully updatedâ or something similar to that. then it tries to connect and fails with âunable to connect messageâ
That is the side which sends the ota update (for example the esphome dashboard ha addon) and it just canât tell (for every case) why a update fails - specially if it transferred the complete binary like in your case.
What you need to know whatâs happening is the logs from that esphome node. It will tell you if it received the full ota update and hopefully more (why it couldnât apply it for example).
I had a lamp which exhibited symptoms similar to this.
What I found was that - when the lamp was on - the power supply was not able to supply sufficient current to the ESP for flash writes to âstickâ and so it would fail to boot afterward.
A solution was to put code in the ota: section of the YAML to turn the lamp off when OTA begins.
HTH
I removed the ESPhome node from the energy meter circuit and connected directly to my laptop and the firmware updates over OTA is successful. As @ glyndon suggested looks like my UPS circuit does not have enough juice to perform OTA update.
I will check my circuit further and update once i have a solution.
It might be just enough to enter the safe mode before doing the ota in that case. For @glyndon it would be probably the same because the safe mode only initializes the bare minimum functions for ota to work.
Still @glyndon found a permanent way to be able to run otaâs just a s normal without having a second manual step
Guess it could be also adopted to just reboot into safe mode upon an ota update
Solution: In case anyone has a similar issue.
I am using TP4056 as the UPS along with a 5V boost module to power the D1 pro, originally I had changed R3 to 10k with a 150mAh battery which was limiting the output current as well, but now changed to 2K with a 18650LI-ION 3Ah cell which now allows the module to take OTA update.
Thank everyone for looking into the issue and pointing me in the right direction.