[UPDATE 2020-10-14 by @Jpsy ]:
Added instructions to update HA OS through CLI.
[UPDATE 2020-10-18 by @Jpsy ]:
More details added on installing and using Raspberry OS to update the EEPROM firmware.
RPi 3 for HA is dead!
I finally found that the lags and hangs of HA on my RPi 3b were the result of too many add-ons that quickly filled up the 1 GB of memory. I considered switching to a NUC or an AMD 4500U based system. But I love the low power consumption of the Pis and their small carbon footprint. So I decided to try the current upper end of the Pi spectrum:
Long live HA on Raspberry Pi 4b
…with (up to) 8GB of memory and booting directly from SSD !
On the way to that solution I faced two major problems:
- The 8GB version is not yet officially supported by HA.
- The full SSD boot of HA is also not yet officially available for the Pi 4.
Fortunately both problems can be solved and the resulting system works flawlessly and is extremely fast and (so far) very stable! The 8GB memory provides HA with enough space to run many add-ons without starting to swap. And there is always plenty of in memory buffer and cache available that make DB accesses really fast.
The following instructions will work for the 4 GB version of Pi 4b too. You may even have more options with that version (like using the 32bit version of HA). But I still recommend the 8 GB version as it will surely keep you happy for a longer time to come.
So let’s go – step by step:
Use the right SATA to USB3 adaptor
This is propably the one most important step for your success. Not all available SATA adaptors are working on the RPi 4. This is not a HA problem but a generic RPi issue. In the discussions below @Noobz has shared this very helpful link. It contains lists of working and non-working adaptors. I started myself with a Sabrent adapter based on a JMicron JMS583 bridge chip which gave me quite some trouble. I.e. it only worked reliably when connected to one of the USB2 ports – not on USB3. Now I have switched to an ELUTENG Adapter that works like a charm and is cheap too. (That is an Amazon partner link that will provide me a small percentage if you buy, but this adaptor is really my recommendation.)
Use Raspberry OS to update the EEPROM firmware
RPi 4 has a boot EEPROM (which RPi 3 did not!). You have to update that EEPROM to the latest firmware (2020-09-03) which enables USB boot. To update the EEPROM you have to temporarily install Raspberry OS. I used an SD card for this.
(If you want to learn more you can read the Raspberry Pi docs but we go through all the steps here in detail.)
First download Raspberry OS and burn it onto an SD card. You do that using Raspberry Pi Imager. Versions for Windows, Mac and Ubuntu are available here.
A) If you have a keyboard, mouse and monitor attached to the Pi
This is my recommendation but you will need a micro-HDMI adaptor cable for that, which you might not have. If you do, simply start your Pi with that SD card and monitor/keyboard/mouse attached. Go through the initial setup process.
When all is done open a terminal window.
B) If you have NO monitor attached to the Pi:
Prepare to access Pi’s shell through SSH. To do so you simply add an empty file called “ssh” (no file extension) to the root of the boot partition on the SD card. You should have two partitions. The first (and smaller) one is the boot partition. Place the file there.
Now start your Pi with that SD card and access the Pi’s shell through SSH from another device on the network.
The ssh-file on the boot partition is deleted on first boot, so you will loose SSH access when you reboot. To keep SSH access launch raspi-config now from the command line:
then go to “Interfacing Options” --> SSH --> Yes --> Ok --> Finish
Update the boot EEPROM firmware
This is done by telling the OS to use the latest stable version for all updates and then simply rebooting:
Edit the rpi-eeprom-update file and change the FIRMWARE_RELEASE_STATUS from “critical” to “stable”:
sudo nano /etc/default/rpi-eeprom-update
Change the file, save and exit nano. Then…
sudo apt update sudo apt full-upgrade sudo reboot
Let the system reboot. The EEPROM should be updated automatically during the boot process.
Check the EEPROM version
This should now report at least firmware 2020-09-03.
Use raspi-config to set boot config to SSD boot
…then Boot options --> Boot Rom Version --> latest -> Ok -->
when the system asks to “Reset boot ROM to defaults” select No (!!!) to use the latest boot ROM.
–> Boot Order --> USB Boot --> Ok --> Finish --> Reboot --> Shut down
We are now done in Raspberry Pi OS. I recommend that you keep that SD card with RPi OS! You can always use it later for more EEPROM updates. It is also very helpful to access your HA SSD and salvage your config and data in case HA should refuse to start some day!
Flash Home Assistant to SSD
Now download the latest Home Assistant 5.x OS from here:
Look for the latest “Development 5 build X” (5.3 at the time of this writing).
Open the “Assets” panel under the list of changes to see the downloads.
Find the image hassos_rpi4-64-5.X.img.gz - make sure it is rpi4 (not rpi3) and 64 bit.
AFAIK the 8 GB Pi won’t run with the 32 bit version.
Use Balena etcher or a similar tool to flash the image onto your SSD.
(Yes Balena can flash to SSD, not only SD!)
Start Home Assistant
Plug the SSD into the Pi, take out any remaining SD card and boot.
Check http://homeassistant:8123 on your network or use Port 8123 with the IP that your router’s DHCP has assigned.
It helps to follow the boot process on a monitor that is directly attached to the Pi. You will need a micro-HDMI adapter cable for that.
At this point you may experience extremely long boot times (>30 min).
If this happens to you you have multiple options:
- Check the section “Use the right SATA to USB3 adaptor” above. Chances are that you are using a non-compatible SATA to USB3 adaptor or casing. Try the ELUTENG that I recommended above.
- Try to connect your SSD through a USB 2 port (black) instead of a USB 3.0 port (blue). I know it sounds strange, but please really do! If this works for you, it may be your best option. Although USB 2 is much slower than USB 3.0 you will get a very fast system. But if option 2. works for you you should also reconsider option 1. It is very likely that your adaptor or casing is the culprit.
- Check if your SSD casing or your SATA to USB adapter is based on a JMicron JMS583 bridge chip. There is a firmware update for this chip that solves the problem. For Sabrent devices the update for all affected devices can be found here. But I also remind you that my own Sabrent adaptor never really worked for me. Read 1. again!
The good news after that final trouble is:
You are done! Enjoy your new HA installation.
Update the dev version of Home Assistant OS
If a new 5.x dev version of HA OS becomes available you may find that the Supervisor menu in the HA frontend only offers you an “update” to version 4.x. But you can update your OS at any time using the command line interface (CLI) of HA. To do that you need SSH shell access to HA. There are multiple add-ons to expose SSH (my recommendation: Frenck’s great “SSH & Web Terminal”).
In the shell you can use the following command to update your OS to a defined version:
ha os update --version 5.3
Try this command before and after the update to get some system info:
ha os info