HA not reachable - how to troubleshoot?

Hello,

Since quite some time my HA installation (Home Assistant OS on RPi4) crashes from time to time (at least I think it crashes).

If the installation runs for longer time without a restart, HA is not reachable anymore within the network. So, I don’t have any chance anymore connect to the Pi. The only way to go is interrupting the power supply. :-/

The problem is independent from my HASS version. I am running on the latest. It already happened in ealier versions

What would be the best way for troubleshooting? How could I find out the root cause for this issue?

Many thanks in advance!

Hi, is there anyone who could help me? Looks a little bit like it’s happening now day by day. Thanks in advance, red

I used to experience this when I was running a RPi - usually as the SD card was reaching the end of its’ life if I had all recording enabled.

Offloading the DB to my NAS helped extend the life of an enterprise grade SD from 3-4 months to 3 years

Gee…where to start?

Here are some WAGs. Apologies if any of this presumptuous regarding your knowledge. @DrewXT just beat me to the punch regarding some items.

I’ve yet to load HA OS, but if it were me, I’d load the Terminal add-on, get comfortable with the CLI commands, and go through the logs to see if anything appears out of the ordinary.

https://www.home-assistant.io/common-tasks/supervised/#home-assistant-via-the-command-line

If it’s new enough, the Rpi4 has a boot diagnostic feature worth exploring:

https://www.raspberrypi.org/documentation/computers/raspberry-pi.html#boot-diagnostics-on-the-raspberry-pi-4

Beyond that, I’d suspect power, the SD card, and perhaps misconfiguration.

Rpi-4 power requires a 5.1 V supply with a current capacity of at least 3 A. If you’re using USB power for a power-hungry peripheral, consider a powered hub to isolate the current demand of the peripherals from the Rpi.

https://www.raspberrypi.org/documentation/computers/raspberry-pi.html#typical-power-requirements

SD cards have a wear-out mechanism limiting the number of write cycles before functional failure. A sizable home-assistant_v2.db file might be a predictor of running out of cycles. Among other possible root causes, an increase in the frequency of crashes could be an indicator of SD wear-out.

As an aside, the rating of the SD card is generally associated with speed and I’ve seen Class 10 or U1 (or better) being recommended. Some devices include some amount of “wear leveling”, which distributes write operations across the entire memory. This technique can maximize the life of an SD card (generally with a speed penalty), but the more sophisticated strategies are used on SSDs. Terms like “surveillance” or “high endurance” might suggest the presence of the feature, but there’s no standard terminology for the technique. Some devices could be optimized for sequential addressing and others could be better suited for random operations. Caveat emptor.

If after looking at the above and you come up without any smoking gun, I’d make a full backup, move it offline, and reload the HA OS from a fresh SD card. Better yet, you might consider an external USB SSD, but there’s a potential drawback (RFI). After that, I’d consider restoring the configuration a bit at a time to isolate crashes to a particular integration or add-on.

@pocket: Thanks for your hints in troubleshooting. All of them make definitely sense. Some of them I already did as you said. I will take them into further consideration.

@DrewXT, right this is what I already excluded several months ago and therefore I moved my HA installation from SD card to SSD - see SD card failure on Pi4 - #6 by Red1.

With this move I hoped getting rid of the HA crashes as I experience today from time to time. But seems that I was wrong.

Offloading the database might be a way. But for the moment, I guess that the SSD should be able to handle it.

I’ve also turned off a lot of event recording; stuff I just didn’t need/want to see, that being said, I’m on a Samsung M.2 SSD, which on their specs will last longer than I’ll be alive… haha

1 Like

Yesterday evening after I connected my Pi4 to a monitor using HDMI, home assistant was still running as usual. And it’s showing something like this:

Then I was lucky to see at least an indicator when I was next to it: it was showing up / scrolling hundreds of error logs which ended like this:

Maybe it already restarted automatically more often than I thought … until it ran into final crash.
Do you have any idea what could be the reason for this? Anything to do with my SSD (on USB)?

The only similar case I could find in the www was this one: https://www.reddit.com/r/homeassistant/comments/mao0d9/moved_to_ssd_on_pi_3_now_getting_file_system/ … someone said that the USB could not provide enough power to the SSD maybe. Could that be?

This is the power supply I am using for my RPi4:

Am I going into wrong direction maybe?

Yes, that could be it. From a prior post…

Hi @pocket, thanks for the quick feedback! Can you recommend any powered USB hub?
Is this a device which would work and provide enough performance?

Or is there a cheaper and reliable variant that you can recommend?

OR could I just use an existing Lenovo power supply with 45W+ and connect it directly to the RPi4? e.g. this one: Lenovo Power Supply ADLX45ULCE2A 45 W / 20 V / 2,25 A

I think it’s wise to first understand what you have to determine what you need. From what I’ve read, a standard Rpi-4 3-Ampere power supply should have enough current margin to power an additional 1-A load. What is the stated current requirement of your SSD (and any other USB peripherals)? If the peripherals are already within 1 A, you might not solve your problem with a powered hub.

Another thing to know is what version of a Rpi-4 you have. Initial versions had a nonstandard USB-C implementation (which I doubt is related to your issue), but also used a component called a “polyfuse” which could be related. I think the current hardware version doesn’t use the component. Still, the information in the following article states the current is limited to 140 mA (1/7th of an Ampere).

https://www.petervis.com/Raspberry_PI/Raspberry_Pi_USB_Not_Working/Raspberry_Pi_Polyfuse_Modification.html

https://www.petervis.com/Raspberry_PI/Raspberry_Pi_USB_Not_Working/Raspberry_Pi_140mA_USB_Power_Limit.html

If you get a powered USB hub, Anker makes well-regarded products. That said, the 60-W hub appears to be overkill. I’d look online and read the reviews. Once you understand how much current is required, select the product best suited to the application. Here’s an article that might help.

https://www.addictedtotech.net/best-powered-usb-hub-for-raspberry-pi-4-in-2021/

A more capable power supply could potentially address the issue, but a 20-volt supply is not the answer. In fact, its use could do irreparable harm. You need a 5.1 volt supply with the right connector, adequate current capacity (in Amperes), and a power cord with appropriate length and wire gauges to limit voltage drop. Hopefully, the Rpi has been designed to handle the additional current if you consider this approach.

Apologies for all the detail. I feel like you’ve asked me the time and I’ve built you a watch. :wink: