Need help with losing connection

Hi all :wave:t2:

I keep losing connection to my home assistant.
I am running on an RPi 4 with a SATA SSD, booting from USB.

A couple weeks ago I started being unable to open home assistant (getting a 500 in the browser and “connection cannot be made” in the app).
When I reboot the RPi it comes back, but it only lasts a while then it goes offline again. Sometimes it lasts for minutes, sometimes for days.

For some reason the lights on the LAN connection show activity, but I can’t even ping my instance.

Can anyone help me debug please?
Is this perhaps a known issue with booting from USB?

Is HA using WiFi to connect? First step I would suggest is turn off WiFi on HA and plug an ethernet cable into it -

There is not a lot of information to go on so it’s difficult to find the cause. Maybe check the logs and see if you can find something there.

But I have a wild guess since the crashes are very intermittently: maybe it’s a faulty or under-powered power supply? You could try another one that is rated for the power requirement of the RPi 4 (I believe it’s about 15W) and see if that fixes it.

I read these posts occasionally and people are always saying “power supply yada yada”. But I think a lot of people have this problem and giving Power Supply as an answer “may” be concealing some underlying issues.

I’ve been using HA for about a year and a half. Brand new hardware, Intel NUC, lots of power, lots of memory, lots of disk space. UPS, new condo in city with clean power. Lots of airflow around the NUC, in cupboard with router, NAS and UPS. There is Cat 6 running through new condo. Great connectivity with 3 different coordinators. I use HAOS and always on the second penultimate update. And yet, in the last 6 months or so, too often I’ve not been able to get in with the companion app. It disconnects and then re-connects.

Last night I was lying in bed. Opened HA on the phone. Was playing with music assistant. Disconnected. But connection didn’t come back. I waited. Didn’t come back. I had to re-boot my NUC.

It happens a few times a week. It seems to be when I’m using it, but if I’m not using it, I wouldn’t know that it disconnected. Other day I was out, connected with Tailscale to see my cameras. Worked for a minute, then stopped. Never let me log back in.

It’s happening too often. Nothing every in the logs. My gut feeling is that it’s connected to addons or integrations. I have the usual, but Music Assisitant, Frigate, Fully Kiosk and Alarmo are the three most full-featured.

Also have Browser mod, TAPO, weather map, shopping list, Plex, MQTT, MQTT explorer, Ecobee, Google Cast, ZWAVE Explorer. So all mainstream stuff.

If integrations mess up, they should not bring the system down. I’m not a software designer or engineer, but in the back of my mind I wonder if there is too much emphasis on new features, and not enough on error trapping, ruggedness and durability.

I would say my HA is absolutely perfect for my needs. I love it and am greatful to the developers. The wife approval factor has been excellent. Except when it disconnects.

Thanks for the replies!

HA was already using ethernet to connect not WiFi, but thanks for the suggestion @KruseLuds!

@hardew I’m using the official RPi 4 power supply, it is about 15W as you mentioned, so we can rule that out too I think.

@harryfine those are some interesting points! I recently installed Music Assistant too, I’ll dig around a bit to see if there might be something related :ok_hand:

For now I have reinstalled HA on an SD card and moved the data disk to the SSD (instead of booting from the SSD as well). I’m gonna give this is a go. Maybe I’ll see some errors if the issue was on the USB connection :crossed_fingers:t2:

Don’t be so quick to rule that out. The 15w supply doesn’t guarantee there’s enough power for both the pi AND the SSD.

If the issue resolves itself when switching back to the SD card, then it’s almost certainly a power supply issue.

1 Like

If you don’t use independent power for the SSD, it probably is not enough.

1 Like

There are power supplies that push out a slightly more power. Go with those instead of the default.

Update

After running home assistant for a couple of days booting from an SD card with storage on the SSD I’ve noticed home assistant still going offline but able to fix itself again i.e. it would go offline but reboot and be available again minutes later.

I can’t see anything strange in the logs.

Is this pointing to a power issue for the SSD?

And/or some kind of corruption on SSD and/or MicroSD card.

1 Like

I have moved back to only SD card for boot and storage and have been running home assistant for more than a week now without any issues.

Definitely something strange with my SSD :thinking:

You keep ignoring the fact that powering the SSD from your RPi might be a problem even though that possibility has been offered more then once.
By switching to SD card only you just didn’t rule out anything.

1 Like

im having the same issue and i can rule out power as im using a powered hub for the ssd and it will crash when it feels like it and becomes unreachable until i re cycle power, ive had to go back to sd card, nothing helps

I had a similar issue when I moved from an Micro SD card to a newly purchased SSD. The entire setup would crash - randomly after a day or two. It turns out the SSD had some bad sectors so whenever one of those sectors would be used - everything would crap out. It wook me forever to figure it out, just before the 30 day return period expired I exchanged it for another one and the problem is 100% GONE. Try another SSD. You really need to go that route, it changes everything from running slow as molesses to lightning fast. The SSD I use requires no external power supply, it is the Samsung T9. It even comes with the proper cable to plug directly into the RPI.