Hass.io Connection Issues

I’m having issues where my connection is very unreliable as of late. I did recently restore from a corrupt SD card, but got things back up and running smoothly for a while. Right now something weird and unreliable is going on though. Sometimes I try to connect and it’s unavailable, sometimes it will go through. I was literally just renaming an entity and the next second its unavailable. Keep trying to refresh and maybe 1 of 20 attempts will work, but then goes down again. I’ve had it running for years previously without issue, no changes in location, wifi, etc. I tried to ping the server on my local network after it went down and pings intermittently get responded to (running on a RPi 3 Model B).

PING 192.168.40.200 (192.168.40.200): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
64 bytes from 192.168.40.200: icmp_seq=2 ttl=64 time=5332.553 ms
64 bytes from 192.168.40.200: icmp_seq=3 ttl=64 time=4328.514 ms
Request timeout for icmp_seq 9
Request timeout for icmp_seq 10
64 bytes from 192.168.40.200: icmp_seq=7 ttl=64 time=4911.183 ms
64 bytes from 192.168.40.200: icmp_seq=8 ttl=64 time=4378.850 ms
64 bytes from 192.168.40.200: icmp_seq=9 ttl=64 time=4754.647 ms
64 bytes from 192.168.40.200: icmp_seq=10 ttl=64 time=5004.851 ms
Request timeout for icmp_seq 15

Any idea why this may be happening, or how or where I could start to debug?

You have it on WiFi?

Yes its on WiFi, has to be to place it in an appropriate location.

Also to note, it seems Home Assistant remains up and running during this time. Z-Wave based automations continue to work, but no WiFi connection, won’t respond to pings, etc.

What appropriate location? For what reason?

If I place it next to my router to hardwire it the Z-Wave and Zigbee network doesn’t reach all locations I need it to reach. I have to centralize the Raspberry Pi for better placement within those networks.

Get if off WiFi, run a Cat5 cable under, over, through your house, do whatever you need to do to get it on Ethernet.

Running a home server (HA) on WiFi is not recommend, ever.

You can also use a cheap Z-Wave / Zigbee plug as a range extender to extend your network. That would allow you to have your HA box at your router.

Ikea sell a cheap Zigbee range extender, about $20 (AU). Z-wave, any always on device (not battery powered) will be able to send/receive data to other devices, therefore extending the range of the network.

Edit: Aus version Z-wave range extender $40.

Ideally I plan to run ethernet throughout my house, but unfortunately that is not a practical solution at the moment. As mentioned I’ve been running HA for a couple years now and this is a new, very recent issue. I recently copied/migrated everything over to a new Raspberry Pi 4 I had sitting around… initially connected fine, but once I updated HA and all add-ons from my backup versions and then restarted the host, the same issue started again. So now I’m trying to track down what/when/where exactly this may be occurring in the “updates” process.

I’ve got a large number of Z-Wave devices covering the house (mostly powered devices), but was still having issues with a few specific ones, as well as distant secured nodes acting unreliably until I relocated HA to a central location, at which point everything worked much better. Not sure if that was related to Z-Wave’s max 4 hops and my fairly widespread network or what. So ideally I’d like to figure out the WiFi issue for now and keep HA where it is, since this is something new and has always worked well until now.

I have had the same issue, and I see that a lot of people has the same problem. The most visible symptom is that incoming SSH hangs some seconds every minute and incoming ping times out. The problem seems to be that the Raspian 4 sends IGMP reports which for some reason seems to disable the network card or the kernel for some reason. This is a long post describing the scenario:

I did the last proposal, disabling the sending of the IGMP join/leave group message:
I had to disable two addresses. I used wireshark on the raspbarry to find out which multicast addresses that it was using.

sudo iptables -I OUTPUT -d 224.0.0.22 -j DROP
sudo iptables -I OUTPUT -d 224.0.0.2 -j DROP

Another option could be to disable the program that sends these multicast messages but haven’t looked into that (yet). Just happy now that SSH works without annoying hang every minute and incoming PING is stable without any timeouts.