I’ve frequently had problems updating devices OTA that had been running for a while. No problem as such with the ESPs, but OTA would not work. The upload would get stuck at some point, with the device sometimes recovering by itself, other times it required a power off/on. Once it restarted, OTA would work just fine.
I then added the “reboot” button feature for all devices, now before I do a device update, I trigger a restart within HA, then start the update process in ESPHome, haven’t had a problem once ever since.
Is there some feature in ESPHome to automatically initiate the device reboot before OTA, or could this be added?
N.B.: Most of my devices are ESP8266 based, can’t say if this would also occur with ESP32 …
Pretty positive that ability doesn’t exist. If you’re doing batch updates though, you could just setup an automation/script to restart all of them so you only have to push 1 ‘button’. At the same time, there’s definitely no reason to update working ESPs (outside of every so often) unless it’s actually addressing an issue.
I had the same problems a long while back. Since then I changed one major thing: I made sure all BLE proxies were built with esp-idf instead of arduino. The second thing is that updates to the platform also improved things.
So if you have BLE proxies, check the framework type. Plus make sure it is actually needed and you are not just doing it because it used to be needed.
And last but not least: you can add a safe mode switch if you ever notice reboots won’t always help.