Is a Raspberry Pi really so bad?

If if was a cheap card, it is likely not a reliable choice. If it is a decent card, you may want to format it with SD Memory Card Formatter first to clean it & mark any failing parts as unusable.

2 Likes

Card itself is solid (it’s a samsung if i recall out of an old Dell) - it’s the enclosure i’m unsure of

1 Like

The enclosure should not be needed except for formatting the card since the Pi accepts the SD Card directly…

Another thing to check is if the power supply is adequate. Some people try using ones that have marginal output.I happen to use a 2.5A power supply.

I’m talking about SSD not SD

1 Like

Sorry, I misread that. If power & cooling are adequate for the device the enclosure should be OK, in my opinion.

Should be enough. A 32Gb SD card is recommended, so a 32Gb SSD should be OK.

2 Likes

I followed the recommendations found in this thread, and have had a very stable RPi 4 + SSD setup running for many months now.

3 Likes

Fab, thanks - think i’ll go that route then :slight_smile:

1 Like

My three key takeaways from @Jpsy thread:

  1. Don’t skimp on the RPi 4 power supply, as it will be powering the RPi and the SSD. I use a genuine RPi 4 power supply. It handles the Pi and my Samsung 120GB SSD without any issues.
  2. Get a known, tested, USB3 to SATA cable/adapter. I use the StarTech USB3.1 to SATA adapter and it works great. I do not even bother with a case for the SSD, as it has no external electrical contacts that need to be protected.
  3. Make sure you use a USB extension cable if you’re going to use a USB Zigbee adapter. Otherwise, the electrical noise from the RPi’s USB3 ports will interfere with the Zigbee RF communications.

Good luck!

7 Likes

Right. Recorder is where ALL the data collected by HA is stored. Very inefficiently, IMHO. But it’s quite functional as long as you make the effort to use it carefully. Here are a couple of links which should be required reading for beginners:

To summarize, there are three important things to know:

  • Be sure to either exclude unwanted data, or include only the data you want to keep.
  • Set your purge_days to as low a number as you can live with.
  • Use Recorder: Purge and Recorder: Purge Entities services to prune the live database.

You probably want to exclude a somewhat long list of entities from being recorded. You will find entities whose states change every second, which you’ll never want to go back and look at. If you create templates, you don’t need both the original data and the data from the template. In fact, you can make templates to save just the data you want from an otherwise verbose or chatty entity, then exclude the original. Many entities only change state rarely (think, a light switch) so those don’t contribute much database I/O and can be safely ignored.

HA does a good job of purging the database of data older than the purge_days value you set.

You can also manually purge the live database using Developer Tools / Services. There’s a service to purge the data older than X days. and (optionally) repack the database to reclaim space. There’s another to purge individual entities, to get rid of the old data from that entity after you’ve decided to exclude them.

Tip: The History page in the UI is a good place to get a feel for which entities generate a lot of changes. Be sure to select a long enough time span that you can easily spot the worst offenders.

3 Likes

I’m also using a Raspberry Pi 3 (B+, I believe), which only has 1GB of total RAM. (Not sure for how long, I’d estimate around two years.) It’s running HAOS and consuming ⅔ (66%) of the RAM. I have over 20 different integrations, which easily leads to 340 entities.

Due to limited RAM, I’m being careful with which add-ons I’m using, as each add-on is essentially one or more docker containers and they can eat up RAM quickly. For instance, Node-RED and/or Z-wave might be too much, or maybe they fit fine. (These are the add-ons I’m using: AdGuard Home, AppDaemon 4, Check Home Assistant configuration, File Editor, Samba Backup, SQLite Web, WireGuard.)

My first SD card was a simple one and died after a few months. That’s when I learned the value of having automatic backups and also about the recorder database. My second SD card has higher quality and it is still running fine. Whenever it breaks, I can just get a spare card, format with HAOS, and then load from my nightly backup.

In summary: Raspberry Pi is a viable hardware, yes. Using SD card is also a viable, and easy and cheap.

2 Likes

empty RAM is wasted RAM

4 Likes

I’ve been running my HA on a pi3b+ for 5 years. I replaced the cheap SD card early with a name brand SD card (Samsung 32gb) and it hasn’t skipped a beat.

1 Like

Not sure where the 4Gb/8Gb RAM requirement is coming from, but … I have literally ten thousands of YAML lines, running over 50 IoT devices on three routers, with webcams and motion detection, etc, on a pi 4b:

image

Running on a Western Digital Purple 32GB for over a year now without any wear so far on that SD. That SD is being written about 200MB per day, so only fully written twice a year, maybe?

I just keep regular backups and I do have a spare SD card ready to go if needed.

3 Likes

I have a 4G Pi 4. I run Home Assistant and a bunch of other stuff in Docker containers. It hardly breaks a sweat. I use a high endurance microSD for the OS and an external SSD for the data. I used to run it on a 2G Pi4 with a spinning disk, but upgraded when I started piling on the Docker containers.

It’s installed on Raspberry Pi OS Lite. If you want the details, it’s here:

2 Likes

Not from HA itself, but if you want to compile firmware with the ESPHome add-on, 1Gb is often to limited.

Thanks. I always use official Pi power supplies these days after issues in the pastm they’re not that dear anyway

My drive is actually M.2 but assuming everything is “the same” given its storage to USB ultimately
Is there advice on read speeds? I’m pretty certain my existing enclosure while it works isn’t that fast, but would be good to test if it’s enough before I fork out

Great point on interference!

So same as many other comments here: Pi4 works great, but I would go for ssd or at least a good size USB stick to avoid SD issues.

In a dark past I was running OpenHAB for 3 years with zero issues on a pi3 with SD card. Then, at some point, we had a power outage and I could not recover the instance due to the SD failing. Getting the system back up was no issue, but I also effectively lost all the data I had accumulated over 3 years…

One more thing about SD cards.This is from the RPi Getting Started documentation, but I think it bears repeating here:

Micro SD Card. Ideally get one that is Application Class 2 as they handle small I/O much more consistently than cards not optimized to host applications. A 32 GB or bigger card is recommended.

I took this advice because it’s more specific than just “name brand” vs. “cheap.” This may or may not have contributed to the fact that my card has not failed (yet!) in three years. But my backups are good and I have a second card ready to go when needed.

3 Likes

The issue that one needs to be concerned about, is whether or not the USB external storage is truly compatible with the RPi4’s ability to boot via USB storage. Not all adapters/enclosures are compatible. Thus the reason I shared that thread earlier which details which USB adapters/enclosures are in fact, known to be compatible. One can waste a lot of time and energy trying to make something work, that is just not compatible.

See this list for known good and known problematic USB storage options.

1 Like