I’m getting my esp8285 device rebooting itself every 2-3 hours. I have confirmed this with an uptime.sensor, and i have set the reboot_timeout for API and wifi to 9999 to ensure they are not contributing.
I notice in the esphome logs i get the following error once per minute:
completely removing the device from HA integrations and re-adding,
completely removing the device from ESPhome and re-adding
renaming the device
I have an identical device that does NOT have this problem, even when loaded with the exact same config
For additional reference, her is the corresponding error from HA.
2023-05-31 21:21:23.930 INFO (MainThread) [aioesphomeapi.connection] 192.168.20.13: Error while reading incoming messages: Connection requires encryption
if anyone has any solutions to try I would appriciate if you would share them with me
P.S. Aside from the 2-3 hourly boot, there appears to be no other negative effect. the device shows up in HA and responds correctly at all times unlike some others had reported.
If anyone else has this issue, it seems to be something to do with HA trying to connect with an “old” esphome configuration that isn’t there anymore at a specific IP. HA is trying to connect to a device at the same address, pinging an error which is logged on the device but isn’t handled well by the esphome device leading to a memory leak, which fills the memory leading to a crash
you can fix this by manually assigning an IP to the device. I have no idea how to get HA to “forget” the original device. any other device that gets DHCP’d to this address will end up with the same problem.
I have the exact same issue with an ESP32.
Every 4h (third of the DHCP lease time from openwrt) it reboots (without any hints in the debug log of the esphome device).
Setting an static ip did not solve the issue. I am out of ideas…
As a workaround i have setup all switches to retain state after a reboot an minimized reboot delay.
You are not using a bootstrapping/reset pin for any peripheral by any chance?
Best would be anyway to make a new thread about your problem (this one here is marked as solved by the author) and maybe peek in how to ask a good question (providing your yaml etc.)
FYI not sure if you are aware, the reason for setting a static IP is to set it to something that hasn’t been used for ESPhome before. I don’t understand why, but i believe in the background something is going on that doesn’t let ESPhome “forget” old DHCP addresses sometimes, so you need to make sure you set it to something brand new (i did it to outside my DHCP) that definitely isn’t conflicting with any other reservations you have
thx for the hint. Now given the device an static IP outside my DHCP range and issue is not gone.
I think in my case, the reason is something else.
Will dive deeper into this when i find time.
I had a similar problem. In my case also some ( not all) devices reset periodically. Some every 2-3 hours or so others after 4-5. The software version I used and still use is 2023.10.4 . The problems started when I changed the authorization to the API from password to key. The devices that handled my lighting simply reset, which was quite annoying, especially for my wife ;). After reading this thread, I restored the authorization after the password and the problems ended. However, something tempted me and I upgraded the ESPHome version to 2023.12.5, which caused the problems to return. I restored version 2023.10.4 and have peace of mind for now. As proof, I paste a screenshot of the uptime history. where you can clearly see the configuration changes ( password key ) and the version upgrade.
Sorry to refresh the thread, but maybe someone has similar problems and my explanations will help them. I will add that I have problems on one wemos to which are connected relays that turn on the light. In addition, I have three sonoffs that also restart. The interesting thing is the fourth sonoff, which has the same ( except IP ) configuration and it does not restart.