I like this idea - will do more investigation and let you know, thanks!
@parautnbach I think you hit upon the root error at this point. Remember now, I started with pure and clean debian and NOTHING else on it (I had to install SUDO, etc.). I tried pinging google.com, and it was returning nice and fast, disconnected the ethernet cable, waited a couple of minutes, reconnected the cable, since I had been running headless I then reconnected - only to see that it never recovers the internet connection (but does recover the local connection enough to allow me to attach to it headless again). Of course this makes HA go down the drain with repeated errors. Rebooted and the problem then goes away of course. Researching on how to enable a plain debian (with ethernet internet connection) can be configured to reconnect when the internet comes back (at the host level). Looking forward to any ideas you may have while I research what I can add or reconfigure - (Hence my saying âRemember now, I started with pure and clean debian and NOTHING else on it (I had to install SUDO, etc.).â)âŚ
So does it get itâs IP address from DHCP, or have you set a static?
Set as static on the router but not on the HA end. Due to that it is always the same number anyway, I could make it static on HA as well but that wouldnât make any difference. Restarting Nework Manmager, restarting eth0, nothing seems to work to make it reconnect once the ethernet cable is puilled and then put back in.
I had a command line sensor that would have the number of AdGuard DNS errors in the last 10 minutes using this sytax:
sudo journalctl --since â10 minutes agoâ | grep âhassio_dnsâ | grep âERROR] plugin/errors:â | wc -l
However, the lack of connectivity causes Home Assistant itself to lock up so there could be no action taken on the sensor. So, I am going to write an app that will run on startup on the host outside of HA, which will update the count using the above statement and will call the service to restart the adguard addon once the above error count gets above 50, and also to then if the count continues to go up, will just reboot the RPI once it reaches 500 log entries in the last 10 minutes.
I know the above is a hack, but not being able to just get the damned thing to reconnect to the internet when the cable is plugged back in is driving me nuts (and I thoroughly tried everything under the sun when pulling the cable out and putting it back in, while homje assistant ws NOT running on the rpi)!
The pi should reconnect when the cable is pulled and then replugged.
Yes it should. What do you suggest? Debian 64 bit Home Assistant Supervised, RPI 4b w/8Gig RAM, booting off a 1TB SSD (specs above).
My PC running debian and supervised certainly doesnât exhibit this behaviour, although I set it to a static IP (how, I cannot recall now!). It is not in the dhcp.leases file on my dhcp server so I guess that is correct.
I will set iot to a static IP and see if that makes any difference.
@nickrout Iâve made the IP static on on the RPI. Also, when home assistant is NOT running on it and I am at a command prompt, and can ping google.com, when I pull the ethernet cable out and plug it back in - cannot reach the internet any more, unless I reboot the pi. Ideas?
Just to say that the network is handled by network manager, which must save some logs somewhere
I run headless, so I lose the connection when I pull the plug. However, even though the internet is lost, I can reconnect headless when the plug is back in. I updated the IP to static - I had not done it properly for some reason but following these steps did it - and fixed the preoblem - but opnly fixed the problem temporarily. When unplugged the ethernet cable and then plugged it back in, I saw that HA and adguard recovered. So I then rebooted the RPI without adguard or HA running - and unplugged and plugged the ethernet cord back in - unable to ping anything, so no recovery. I rebooted it again and tried the same with HASS running, same as before unplug and replug the ethernet cable - and HA wasnât able to recover - so myIP is static and we are all set in that regard but no solution - yet - thoughts @nickrout ?
Just to be 100% certain with what you mean here: Itâs a static IP set on the Pi and not a DHCP reservation on your router, right?
Actually both.
And to avoid cross posting and make things easier for people to read, I am posting the end problem statement (reconnecting) in a different post (here) and marking this one as completed as that is the only thing left that I cna think of regarding the resilience on my endâŚ