HA on RPi4 4gb RAM with Micro SD crashing & requiring power reset

RPi 4, 4GB RAM, MicroSD, ethernet connection, Home Assistant 2023.1.7, Supervisor 2022.12.1, Operating System 9.4, Frontend 20230110.0 - latest



Starting around end of Dec my HA setup which has been bulletproof, began randomly becoming unavailable until I went over and turned the RPi off and back on. Then it starts up and acts normal until it does it again. Could be 3 minutes later, could be 3 days.

I figured it was my Micro SD as that is what a bunch of forum posts said, so I bought an SSD, did all that setup (big struggles there as it seemed my Netgear router was being difficult, took three-ish days to get it up, very painful days). After all that, the SSD seemingly performed worse. And at this point I was worried I was doing something wrong with the SSD, somehow, so I re-set it all up on the Micro SD. Now I am back to the random shut downs.

With my three IP cameras disabled, it seemed to happen less (read that IP cameras on generic cam integration could cause this in the past). But it still happened.

So I ‘turned on’ the system monitor sensors and have seen some interesting stuff. When watching the Memory use percent and Swap use percent, crashes always happen when memory rockets up to 100, and then swap follows, and then it crashed. I temporarily created an automation to restart homeassistant when swap hits 90%, and it has helped. But I need to find the root cause?

Plenty of space left on the MicroSD. Crashes do not coincide with processor temperator raising.

Around the time when this starting happening I added new cameras through Frigate, added cameras through Dahua integration and started using AdGuard. So I have disabled Frigate, stopped using AdGuard and the disabled the Dahua cameras.

Could be similar to https://community.home-assistant.io/t/ha-hangs-up-after-a-few-days/430019 or https://community.home-assistant.io/t/haos-on-pi3-hanging-every-few-days-requiring-hard-power-reset-how-to-troubleshoot/310278/7

Nodered seems to have high RAM and CPU usage. RAM fluctuates between 10 and 35% normally, but I have seen it go up to 65%+ and it seems that it causes my swap to increase. Does this seem like the culprit?

Does anyone have any ideas of things I should check?

History images:

Crash Example 1

Crash Exmaple 1 Closer Look

Crash Example 2

NodeRed with High RAM/CPU:

Nodered 25.2% CPU and 31.2% RAM

Anything in the logs?

Faulty power supply?

1 Like

So the HA logs get reset during the freeze and reboot cycle, I have never caught anything there. However I plugged a screen into my RPi and saw this. I can’t find anything online as to what this means.