I am getting real sick and tired off HA. It is allways something breaking. Last time it was a bad sd-card, but now I am not sure if it was only the sd-card. I only have a working system for a month or so before something breaks. Now, last time, right before breaking, I noticed I couldnt update from '83 to '84(via hass.io). A couple of hours later the whole thing broke without me touching the configuration.
I connected the pi to my TV and could see that it tried to boot, but stoped at something like āopening kernelā¦ā i think.
What is wrong with my system? It works fine one day and breaks another day for no reason all the time.
This often has nothing to do with HA - itās unfortunately the āfaultā of the HW platform that you, me and many others use, i.e. an SBC that runs on an mSD card.
Iāve been lucky so far with the SD cards I used.
To be safer, I switched a little while ago to a high endurance card:
And just over the weekend I replaced it with an SSD that my RPi3 now runs on now - little bit of work, loads of learning opportunities and, hopefully, a more reliable setup: https://www.amazon.com/gp/product/B00EZ2FRU2
You should consider switching to a SmartThings Hub. When it breaks, you can be absolutely certain itās not the SD card ā¦
If you are using a Raspberry Pi (for any application, not just Home Assistant) without a UPS, you are living on the razorās edge. It does not like power interruptions or voltage fluctuations. By ānot likeā I mean nasty things like filesystem corruption or even physical SD card corruption.
I have two Raspberry Piās, one is dedicated to running PiHole and CUPS, the other runs openHAB, MQTT, and Node-red. Both are protected by a UPS and have been running just fine for one year as of this month.
I currently run Home Assistant on an old notebook PC but if I had it on an RPi, I would definitely ensure it was protected by a UPS.
If not a UPS, then perhaps a power bank (in between the power supply and the RPi).
Actually I challenge this. People seem to run Kodi on an RPi with SD card for a much longer time than I see reported here for HA. OK I know that is not scientific, merely anecdotal.
Perhaps the difference is the frequency of disk writing? HA does a LOT of logging as well as frequently updating itās own database. In contrast Kodi usually just logs. It has a database, but that is only updating on adding new media, not constantly.
In my opinion it is soon time to realize that HA has grown out of Raspi. For two reasons. For every day that goes by HA get more complex. The minimal memory in a Rpi becomes a problem. The second reason is ofc the se card. I fully agree with DavidFW1960 that the writing to the db is a big problem
Have a look at the many long threads about this subject on the openHAB forum. In a nutshell, SD cards have a finite number of write-cycles (and itās far less than SSD). Home automation software typically does a lot of writing (logging) and definitely chews through that finite number. However, if the SD card has lots of free space, wear-leveling spreads the writes around so it is possible to have an SD card last for a long time.
What the SD card really handles badly is being interrupted in mid-write. Owing to the way it does an erase prior to a write, incomplete operations can result in data-corruption. The symptoms are usually bad behavior from software (OS or application) because it ingests corrupted data.
If the card is subjected to frequent writes (like logging by sensors), odds are good that pulling the plug will interrupt a write operation. The consequences depend on what was being written to the card (maybe shuffling around some blocks of a critical application file).
An SD card can also put itself into permanent write-protect. I was using the dd command to make an image of an SD card. Long story short, the cardās internal file-management software deemed it was undergoing a destructive set of write operations so a safeguard kicked in (to protect the contents) and it engaged its permanent write protection (making the card read-only). I didnāt even know it was capable of doing this and had to read some nitty-gritty details to learn what just happened. Thereās no way to disable this mode of write protection. It was still under warranty so the manufacturer agreed to replace it. Thereās more than meets the eye with these devices.
I had the exact same problems. My raspberry crashed 4 time, each time after about 3-5 month.
Iāve bought good sd cards and power supplies etc. Didnāt help.
Bought a nuc6cayh a year ago (150ā¬ incl ssd, ram) and all worries are gone ā¦ Plus itās a lot faster.
Definitely the amount of disk writes. I have run OSMC (uses kodi) for a number of years on the Pi as well as using tvheadend addon for live TV on the same device which has constant disk writes for tuning and recording. what a nightmare. Frequent crashes and failed SD cards.
Moved tvheadend to dedicated box, result. Pi devices have not failed ion over 18 months or more.
When I wrote that I have two RPiās that have been running fine for a year, I shouldāve explained that Iām using log2ram.
Log2ram redirects logging from /var/log to RAM and then periodically writes it out to the SD card. Iām using the default period of one hour. Log2ram minimizes the number of direct writes to the SD card. Upon initiating an orderly shutdown, log2ram writes out its RAM cache to the SD card before the RPi shuts down.
The caveat is that the RPi ought to be protected by UPS because, if power is interrupted, you stand to lose up to an hourās worth of logging. In addition, itās limited to caching log files written to /var/log and not elsewhere.
You can solve it on a rPI but to be honest by the time you add all the āfixesā to keep it reliable itās probably about the same cost to buy a cheap mini PC (look for used SFF Dell Optiplex or HPās from offices that have been updated - often you can get them for almost free). Or some like the old laptop option; but that one bugs me as keeping a laptop permanently powered typically causes batteries to swell and other not so nice things.
Or buy a low end NUC, Zotac, etc, etc, if you want new.
But ditch the rPI and your HA experience will be much much happier.
The challenge here is logs are typically most important right before a system panic or attack/breach to understand what happened. This setup almost ensures you will be missing the logs you require most.
From a technical standpoint, I agree with you. The critical portion of the log will be lost.
From a practical standpoint, the odds of my system experiencing āa system panic or attack/breachā are very low. Iāll go with the convenience of stability and not having to replace SD cards every 6 months or so.
FWIW, Iāve been running a home automation server since 2006 and, over two generations of hardware, experienced one power-supply failure.