Unreliabilty

I used to have power issues at my house that made my Pi unresponsive every few weeks, but never led to SD card corruption and re-install. A few things you should check on your Pi.

  • Use a 2.5A power supply made for the Raspberry Pi 3B+, not a power charger used to charge phones. The power supply provides consistent 2.5A power vs. more volatile power chargers. If you hook up your Pi to the TV and see that the logs are reporting undervoltage constantly, then you need change to a power supply. Undervoltage may cause hard to diagnose problems like SD card corruption.

  • Use a high endurance SD card if you have one. I switched to one to be safe, but I didn’t have problems with a normal Sandisk 16gb SD card before. I would focus on getting a proper power supply and UPS first before going this route.

  • Get an APC UPS for $20. Check slickdeals.net for sales. Newegg.com regularly sells one for $20, which I’ve been using on my Pi for weeks without issue so far.

If you don’t want to throw more money at this problem, then you should quit now and wait another year or two to see if things have improved. Most likely it won’t, because it sounds like more of a Pi issue than HA. With any home automation solution, you will be spending a lot of time to maintain unfortunately. I haven’t found a true ‘set it and forget it’ reliable solution–even the basic SmartThings hub can still cause problems with its automatic firmware updates.

Another option you have is to get a SmartThings hub, configure your basic light automations there, and connect SmartThings to HA using MQTT. SmartThings functionality is terrible and has other downsides (internet reliance), but at least it’s been stable at my friend’s house for almost a year. It has a battery backup option (uses 4 AA batteries) that may negate the need for a UPS.

Agreed - this is not an HA issue.

Maybe you want to try running it from a USB stick instead of an SD card - I haven’t tried it yet, but I’m seriously thinking about moving my install to an external SSD and boot/run the whole thing from there to avoid these potential issues.

I’m also running RPi-Clone at least once a week - in addition to backing up everything in my config folder regularly - and I had one occasion where this was a complete life-saver.

RPi-Clone looks a little intimidating at first, but it really is not.

Have a 2.5amp power adapter bought with the pi, and I have a high performance 32gb memory card that i used to use for my gopro until i bought 64gb cardsfor that. No it is not an old card that is worn out. I used it a grand total of two times on my gopro until i decided 32gb was too small for 4k video. Now I can deal with maintence and bugs, but this is a complete unrecoverable crash upon power loss.

I’ve been looking at getting a synology or qnap nas. That might be a viable option, and that would be something that would be attached to a ups. Eventually I was going to move the Pi to my basement network cabinet once I had everything installed and configured.

Agree, this is more likely a hardware issue.
You only have to google for corruption on RPi after power loss and there are hundreds of cases. most recommendations are UPS

Not so much the RPi but the SD card. Many Single Board Computers (SBC) use an SD card for storage and the RPi just happens to be the most popular. Therefore it gets the bad rep for ‘vulnerability’ but it’s not at fault.

If you cut power while the OS is writing to the SD card, you run the risk of corrupting the file system. You also run the risk of having the card place itself in permanent read-only mode. Yes, it can do this and it’s by design (sort of a self-defense mechanism that limits further data corruption; preserves what it contains). When in this mode, the card is no longer usable as read-write storage.

To all the people wishing to switch from SD card to USB flash drive, you should know the technology is effectively the same. Both have the same limitations. For best results, consider SSD.

FWIW, there are numerous threads in the openHAB community forum dedicated to the woes of SD cards. In a nutshell, you must have a backup, a spare SD card, and a UPS (or battery backup). It’s not a matter of if the SD card will die but when.

Here’s are two applicable threads:

Last but not least, a good explanation of how SD cards work, what can make them fail, and what you can do to minimize experiencing those failures.

So I was able to recover after messing with it for about an hour. Once I restarted without the z wave adapter in, it booted but was all jacked up. The hass.io tab failed to load along with several other errors. Once I shut down all the plugins and restarted properly most of the errors went away. After that I was able to reboot and restart all the plugins and plug the z wave adapter back in. But my original point still stands, if we’re going to be connecting and automating every part of our houses the infrastructure must be reliable and damn near bullet proof. I use the grandma test for every piece of tech I install in the house. It’s why I won’t connect any of the lamps to any home automation system. ‘grandma’ simply wouldn’t understand why you have to use a scene switch instead of the manual switch below the bulb. It was the defining point when I setup the entertainment system and harmony ultimate.

This is what I was seeing when i plugged a monitor into it.

Stop using a toy and get a real computer to run it.

3 Likes

SD card is toast. You might be able to write a new image to it or just get a new one.

Info for bcm2835_sdhost.

While hass.io has its quirks and learning curve, this sounds most likely an SD card issue.

Just saw on slickdeals a high endurance SD card:

I’ve heard this can help

Oddly, I was able to recover by removing the usb z wave adapter. And the SD card wasn’t used but a couple of times before I put it in HA. And this thing hasnt been running anymore then a month.

Just a note on UPS sales, this thread reminded me that I had been meaning to get some… Slickdeals pointed me to a couple sales currently running: B&H has a 450VA for $30, and Office Max/Depot has a 650VA for $35.

The two solutions have been mentioned already:

Get a UPS
or
Run HA on a device with proper storage that can deal with power outages in a better way.

I do both. Because if you’re using something to control your home, why skimp on it?

2 Likes

One issue that we are not addressing is the underlying filesystem of the OS. Hass.io seems to be quite brittle. I am not sold on the docker environment on a Pi.

I think a solid raspbian or Armbian well known OS on a reliable File system might address some of these issues. Maybe I am unwarentedly weary of the docker model. But that for sure impacts the reliability of the system across power losses (things shutting down and starting up in order seem to be harder to manage in the docker model)

All that being said, I use a battery designed for the pi like this one: https://www.amazon.com/Lithium-Battery-4-USB-Expansion-Raspberry/dp/B072Q49N48

All raspberry pi OS’s suffer from the file system corruption using SD cards, a quick google can see hundred of file corruption issues across all flavours of OS
I dont think hass.io underlying OS is any different to them
On the docker side, i run HA in a docker stack and i have no issues along with the other 10 or so accompanying containers

Seems like a good idea to me too. Never had issues with HA with my raspberry pi but I use raspberry pis for some years now and can say the power/SD card issues are a pain.

May I ask which device you use instead? I thought about buying a NUC (Intel).
And regarding UPS…this handles short power outages where power comes back before UPS battery is empty, right? Or do you have a solution that can shutdown/power up the device on power outage/when power is back.

I use an HP Microserver as a file server running Windows Server and Hyper-V. HA runs on Ubuntu 18.04 LTS in a virtual machine under that.

I have a UPS with enough battery capacity to last over 4 hours. Gives plenty of time to power down gracefully if I need to. I run the UPS software on the server also, so it will shut down the server automatically when battery is low.

Bizarrely, due to HP’s regular cashbacks, the UPS cost more than the microserver.

1 Like

I run my HA on a RPI and have had a couple of power outages (long enough the UPS ran dry) and no corruption.
I also have a number of other RPi’s about the house with no power protection and have yet to have any issues during power outages (of course I will get one now I said it out loud). Def. sounds like something else going on. Sorry to hear of your hassles - frustrating for sure. Def. invest in a small UPS but do dig deeper as it sounds like something else going on specifically in that setup. Maybe consider disabling swap (which I believe is on by default on a lot of distros).

Just wanted to let you know that I have had my HASS in for over 18 months and no issue at all - it’s been more solid than a lot the more expensive tech I have around here :slight_smile: Just wanted to give some real-world feedback.

Best of luck!
Jim

Just agreeing that moving off a Pi has made a world of difference for me, not just with HA but anything in my home lab. Get an old laptop, install Ubuntu and docker-compose and you won’t regret it. Pi in combination with HASS.IO/Home Assistant/Hassbian wasted about 6 months of my life.

1 Like