HA crashes entire device on asus router restart

I’m facing a trouble with Homeassistant supervised on Armbian. The installation is complete, but every time my asus router RT-AX58U restarts, the home assistant starts to consume all available CPU and RAM until entire system crashes stopping to respond. I tested it on orange pi 5b 8GB, and orange pi zero 2 1 GB. The difference is that with smaller ram I it crashes so quickly that I wasn’t able to confirm with htop the process causing the problem. The system log, ha log and console in serial connection doesn’t show any error message.

I am trying to resolve it for a month now. Having reinstalled it several times, changed SD, and the same thing happened in every ha version released li last month. Currently 2024.3.0. Already starting to give up. The network is connected through LAN.

The issue cannot be reproduced when I disconnect the network cable. When I connect the cable again it continues to work correctly.

I made cron task checking cpu and ram usage every minute it reboot the hardware when high consumption is found. This is the only workaround that makes my system run. I know it is not correct.

Is the any solution to this? Any idea how to troubleshoot it from here? I’d appreciate is you can guide me how to handle it.

How many times do you restart your router? I haven’t restarted mine in over 2 years.

Kind of irrelevant how often he restarts his router, the point is HA crashes when it does get restarted

I’d think issue sounds like it’s related to some integration that is doing some activity that relies on the gateway. If it were me I’d remove integrations that are internet related (start with the cloud integrations) one by one restarting the router each time.

Try running HA in safe mode for a while. If the problem does not occur, then most likely it’s an integration.

I’ve tested it with safe mode. Sadly it crashed again, but it just took longer than usual. Tested on core 2024.3.1.

The awkward thing is that when the connection is just lost, then nothing happens. I unplug lan , then plug it back and everything works.

After just after restart of router I can connect to console and I see the ram usage builds up like a progress bar…

Does it make sense to disable the integrations as in safe mode it happens?

Maybe it is Docker issue? Any idea how to check it?

Maybe network card driver issue?

Three things I don’t see mentioned here:

  1. Are you using the AsusWRT integration in HA? If so, I’d try disabling that to see if it is the culprit. Perhaps the integration is trying to communicate directly with the router and causing some sort of memory leak? I’m not 100% sure.

  2. The other thing, and this might sound weird… have you tried swapping out your SD card with a new one (or even better, a SSD)? Again, totally theoretical, but if you have an integration that is reading stats from the router as sensors, it could possibly overwhelm the ha database. That could potentially cause the high CPU/RAM usage.

  3. The last thing is to shut down HA, take the SD card and pop it into another machine. Backup the ha.db file safely and then delete it off the SD card. Basically, you are wiping the database. Then, put the SD card back into your rpi and see what HA does.

I don’t know much about ASUS routers, so I’m just wondering here.

  1. I wasn’t using it from a beginning, I installed it it nie meantime. The issue was showing up before and after
  2. I tried different SD’s A1 and A2 classes. Now my device is booting from emmc. The issue persist regardless to SD…,
  3. The entire system was reinstalled a couple of times. I can give it a try with a clean db. I’ll need to change boot device again to do so. I’ll try it over the weekend

Thanks for looking into this.

1 Like

With the network driver: can you tell me how to check it? It may be really odd if that’s the case as the issue shows up on different machines orange pi zero 2 1gb and orange pi 5b 8 GB (now).

That’s officially not supported and therefore not tested.

  • Debian Linux Debian 12 aka Bookworm (no derivatives)

Can you reproduce the behavior on a debian based installation?

1 Like

I reinstalled it on Debian. It seems to work better but it still occurs. The difference is that the consumption of ram goes a bit slower giving time with system running before it crashes. With automation to restart 5 minutes later it seems manageable. Though it shouldn’t work this way…

A step for improvement but not fixed completely.

Also I must say that Debian installation and installation of HA was… kinda nightmare. Maybe I’m not great with those things or I was using wrong guides…

Anyway, I’m still looking for solution.

Solution…

Buy an Odroid N2+ and move on