After a year of working perfectly fine, my setup suddenly stopped working with my ESPhome devices not being able to connect anymore. It has been two weeks now and I can’t figure a solution out myself, so help from you guys would be greatly appreciated.
The problem:
Home Assistent, myself and ESPHome can no longer connect to my ESP devices.
In ESPHome all the devices come up as online (green bar), but when I click the log I get the following error, and because of this I now can’t flash them over the air either.
INFO Connecting to 192.168.207.151:6053 (192.168.207.151)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.207.151: timed out). Re-Trying in 2 seconds
- When trying to contact the device via the browser I get a time-out (
ERR_CONNECTION_TIMED_OUT
). - I can see in the Unifi (Dream Machine) controller that all the devices receive an IP address (statically assigned in ESPhome firmware) that lives for (almost exactly) 15 minutes, then the device reboots and the uptime resets before it starts another 15 minutes (this must be the ESPHome default option for
reboot_timeout
(docs). - Other devices in that same VLAN show no trouble at all (WLED / Hyperion) and I can reach them in the browser for example.
Network summary:
LAN 192.168.1.0/24
This is where the Home Assistent instance lives, and all the family devices (laptops, phones, tablets, etc)
IoT 192.168.107.0/24
This is where the cloud services devices live like the washer, robot vacuum, tv.
NoT 192.168.207.0/24
My devices that should not use the cloud and should one day be blocked from the internet completely via the firewall (these firewall rules are not yet in place!).
Firewall rules:
None, basically. Except for the default ones created by Unifi controller itself. I just want to split the wifi networks (for now), and later start using the firewall rules to actually lock it down.
What I’ve tried/checked:
- I also can’t ping the ESP devices that are in that network. Other devices in that network can be pinged.
- I re-flashed (via USB) a ESP device to my main LAN (as
192.168.1.151
) and then it all works perfectly fine. I see it come online, I can view the logs and I can flash OTA. Also the web server works so I can reach it in the browser.
INFO Connecting to 192.168.1.150:6053 (192.168.1.150)
INFO Successfully connected to 192.168.1.150
[20:17:33][I][app:105]: ESPHome version 1.20.2 compiled on Jul 31 2021, 20:08:26
[20:17:33][C][wifi:499]: WiFi:
[20:17:33][C][wifi:359]: SSID: [redacted]
[20:17:33][C][wifi:360]: IP Address: 192.168.1.150
[...]
- It happened to all ESPHome devices at once, not a single device or a subset but all devices.
- I checked the firewall (LAN in/out) rules but there are no DENY rules. Also tried adding an ALLOW rule from the NoT VLAN to the LAN network for all IP’s and Ports, with no luck. Also this feels redundant because the other services (WLED/Hyperion) work with no problem.
- I changed the main domain from
localdomain
tolocal
as @petro mentioned in Securing a vlan & ESPHome Devices - #12 by petro - Tried looking in the router logs for anything on those IP addresses, but I can’t find anything of importance.
- The router was set to auto-update software but I can’t find anything in the changelog’s that would explain my problem.
Help…?
Yes please!
I don’t know networking and the Unifi controller good enough to find the source of this problem…
I would really like to keep my ESP devices in a dedicated LAN and it would be a real annoying/hard job to manually flash all the devices via a cable (they’re in ceilings, behind kitchen appliances, etc). If it would just go back to how it worked for over a year, that would make my day week! Can’t find anything to roll back a back-up to make it magically come back to life I’m afraid.