Installing Home Assistant Supervised on Orange Pi 3B

I installed Home Assistant supervised on an Orange Pi 3B one week ago. So far so good, here’s the story.

This is not an officially supported solution.

Why
I was trying to find a sweet spot to run Home Assistant with all features on a dedicated system. I only want to run core home automation logic on this system, and use separate hardware for advanced and exotic services.
I believe that Orange Pi provides a good alternative to Raspberry Pi in general and looking at other reference hardware, I believe that the OrangePi 3B provides all I should need at a very reasonable price.

Hardware: OrangePi 3B

  • OrangePi 3B
  • 64Gb eMMC (the official module for Orange Pi 5 Plus / Orange Pi 3B*)

Total cost $50 including case (below), which is half the price of the Home Assistant green with exactly the same specs (I have more eMMC)
Bonus: the OrangePi 3B also comes with Wifi and Bluetooth interface (and antenna which is typically not pictured).

OS: Armbian
It’s specialized for ARM boards and likely to provide the best performance for Home Assistant on your Orange Pi 3B.
It won’t be officially supported by Home Assistant, but only vanilla Debian is anyway, the Debian distro for Orange Pi would be our next best choice, that should be close enough.

Accessoires
Case: Used this aluminium case Geekworm Orange Pi 3B Case with Fan & Heatsink (N510) which costs less than USD $10 and is really nice. But the fan is noisy and not usefull for this use case, so I removed it. If I were to add one, I would go for a JST 1.25mm 2-pin so I can use the dedicated plug on the Orange Pi board.

Zigbee dongle: Sonoff ZBDongle-E

1. Install Arabian on Orange Pi 3B eMMC
Debian-based Bookworm latest release at the time. Download here: Orange Pi 3B – Armbian

  • Used Balena Etcher
  • First boot HDMI output not working but found on network (ETH wired to my rooter)
  • ssh in with root/1234

Change root password and all…

2. Copy OS to eMMC

With root user:
/usr/sbin/nand-sata-install

Select ext4 file system.
Shut down after install.

** 3. System upgrade**

sudo apt-get update
sudo apt-get upgrade
reboot

4. Firmware Update and restart
Use the armbian-config utility to update the firmware:

armbian-config

In the interactive menu, select System>Firmware

Ready to go!

5. Install Home Assistant Supervised
Installed logged in as root

5.1 Update the OS name
Only Debian is supported by HA supervised, so we need to fake the OS name, otherwise install will fail on check:

in /etc/os-release update ARMBIAN_PRETTY_NAME:
ARMBIAN_PRETTY_NAME="Debian GNU/Linux 12 (bookworm)

5.2 Give a host name if you like
hostnamectl set-hostname yourhomeassistant

5.3 Configure AppArmor and cgroupv1
I am not going to explain what and why, this has beed discussed here before (see links below).

apt install apparmor
echo "extraargs=apparmor=1 security=apparmor systemd.unified_cgroup_hierarchy=false systemd.legacy_systemd_cgroup_controller=false" >> /boot/armbianEnv.txt
update-initramfs -u
reboot

Check if that worked:

systemctl status apparmor.service
aa-status

5.4 Install Home Assistant Supervised
Essentially follow the official instructions there: GitHub - home-assistant/supervised-installer: Installer for a generic Linux system.

Install dependencies:
apt-get install jq wget curl udisks2 libglib2.0-bin network-manager dbus apparmor-utils systemd-journal-remote lsb-release systemd-resolved -y

Install OS Agent:

wget https://github.com/home-assistant/os-agent/releases/download/1.5.1/os-agent_1.5.1_linux_aarch64.deb
dpkg -i os-agent_1.5.1_linux_aarch64.deb

Install Docker CE:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh

Install Home Assistant Supervisor:

wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
dpkg -i homeassistant-supervised.deb

Chose raspberrypi4-64

After a few minutes on port :8123, I get the “Preparing Home Assistant” screen.

Installs in about 5mn

6. Post installation fixes

I have two issues after installation

  • Unhealthy system - Unprivileged
  • Unsupported system - systemd-resolved issues

…Which I think was really one and was resolved by enabling systemd-resolved.service and a network restart:

systemctl enable systemd-resolved.service
systemd-resolve --flush-caches
/etc/init.d/networking restart
reboot

7. Connect to a wifi network
Well, since we have wifi, let’s see if it works.
List the wifi networks available where I am with:
nmcli dev wifi list

And connect to your network:
nmcli dev wifi connect '<SSID>' password '<PASSWORD>'

Summary

No warnings, freeze or unexpected behaviour. The system takes about 20 seconds to boot and one minute start all Home Assistant services.
I haven’t deployed a full scale home automation yet, but I have been playing around quite a bit with the system, countless plugin install and sudden restarts, nothing I can complain about…

I hope someone find this helpful and any feedback is welcome!

8 Likes

I forgot… Credit and references:

  • James A. Chambers blog: Migrate Home Assistant to Orange Pi 5
  • Renato Costa gist: Installing Home Assistant on Orange Pi 5

Sorry, I can’t place the links here it seems, but it shouldn’t be too difficult to find them! :wink:

2 Likes

Thanks for the great step by step.

@madHatter

Which of the interfaces below did you download?

My pleasure! :slight_smile:
Go for the CLI (we don’t need a desktop), Bookworm (Debian-based).

Many thanks!
Worked like a charm on a Odroid C2

1 Like

@madHatter do you know how can I solve this error that happens when I try to restore the backup?

BackupManager.do_restore_full' blocked from execution, no host internet connection

On my Odroid HC4 I haven’t /etc/init.d/networking

@Tony2k Can you ping a website like google.com? I’ve been trying to do the same thing with a real Debian image on my Orange Pi Zero, but when I install systemd-resolved it breaks DNS lookups.

Hi @madHatter . As I mentioned above I’m trying to do this on Orange Pi Zero. The systemd-resolved issue does present itself, but your fix doesn’t work because there’s no systemd-resolve executable available in any package. This is the output of apt-file search systemd-resolve:

homeassistant@homeassistant:~$ apt-file search systemd-resolve
aide-common: /usr/share/aide/config/aide/aide.conf.d/31_aide_systemd-resolved
dracut-core: /usr/lib/dracut/modules.d/01systemd-resolved/module-setup.sh
dracut-core: /usr/lib/dracut/modules.d/01systemd-resolved/resolved-tmpfile-dracut.conf
manpages-de: /usr/share/man/de/man8/systemd-resolved.8.gz
manpages-de: /usr/share/man/de/man8/systemd-resolved.service.8.gz
manpages-zh: /usr/share/man/zh_CN/man1/systemd-resolve.1.gz
manpages-zh: /usr/share/man/zh_TW/man1/systemd-resolve.1.gz
openvpn-systemd-resolved: /etc/openvpn/update-systemd-resolved
openvpn-systemd-resolved: /usr/share/doc/openvpn-systemd-resolved/README.md.gz
openvpn-systemd-resolved: /usr/share/doc/openvpn-systemd-resolved/changelog.Debian.gz
openvpn-systemd-resolved: /usr/share/doc/openvpn-systemd-resolved/changelog.gz
openvpn-systemd-resolved: /usr/share/doc/openvpn-systemd-resolved/copyright
openvpn-systemd-resolved: /usr/share/doc/openvpn-systemd-resolved/update-systemd-resolved.conf
systemd-resolved: /lib/systemd/system/systemd-resolved.service
systemd-resolved: /lib/systemd/systemd-resolved
systemd-resolved: /usr/lib/sysusers.d/systemd-resolve.conf
systemd-resolved: /usr/lib/tmpfiles.d/systemd-resolve.conf
systemd-resolved: /usr/share/bash-completion/completions/systemd-resolve
systemd-resolved: /usr/share/doc/systemd-resolved/NEWS.Debian.gz
systemd-resolved: /usr/share/doc/systemd-resolved/changelog.Debian.gz
systemd-resolved: /usr/share/doc/systemd-resolved/copyright
systemd-resolved: /usr/share/lintian/overrides/systemd-resolved
systemd-resolved: /usr/share/man/man8/systemd-resolved.8.gz
systemd-resolved: /usr/share/man/man8/systemd-resolved.service.8.gz

That file is an executable (on my debian system)

Try

file /lib/systemd/systemd-resolved

Thanks @nickrout. It seems I can run that executable (the file command also shows it as executable), but it does not accept the --flush-caches parameter.

jodie@debian:~$ /lib/systemd/systemd-resolved --flush-caches
/lib/systemd/systemd-resolved: unrecognized option '--flush-caches'

No ‘d’ on the end of the command, ie

/lib/systemd/systemd-resolve --flush-caches

Thanks @nickrout . Unfortunately that binary does not exist.

jodie@debian:~$ /lib/systemd/systemd-resolve --flush-caches
-bash: /lib/systemd/systemd-resolve: No such file or directory

I have installed pure debian on my Orange Pi Zero again and it has a script called systemd-resolve at /usr/share/bash-completion/completions/systemd-resolve. When catting that file it doesn’t seem to have the --flush-caches option, but I marked it as executable and ran it anyway.

Unfortunately even after this I cannot seem to start supervisor (using sudo docker run ghcr.io/home-assistant/armv7-hassio-supervisor), which complains that it can’t find SUPERVISOR_SHARE, SUPERVISOR_NAME or “any kind of machine/homeassistant details”, nor can it find a Docker socket. If I can’t figure this out I’ll post a new thread.

resolvectl flush-caches seems to work

Hi, Sorry… I have been away for a while… No, I never faced this issue. Did you get it to work?

Hi, sorry, I have been away for a while… This is strange that you don’t have the systemd-resolve in the first place… What version of Armbian did you use?

Have you seen this post? (I didn’t look into the details, but it looks suspiciously similar).

I can’t remember, but it was one directly off Armbian’s website for the Orange Pi Zero. I’ve since installed pure Debian. I then installed systemd-resolved normally and had to run nmtui and set the network back to DHCP (For some reason installing systemd-resolved sets network-manager to a static IP address).

1 Like

Thank you, I have managed to install HA on my Orange Pi PC following your instruction.
The only difference is that I have to run the OS directly from SD card (skip nand-sata-install step) and I chose ‘raspberrypi2’ instead of ‘raspberrypi4-64’ (because OPiPC is 32bit, and very similar to RBPi2).

1 Like

I used these instructions to help install Home Assistant on an Orange Pi CM4 (which is the same RK3566 as the 3B and works with the same devicetree dtb) with 4GB RAM / 32GB eMMC. I do believe there are some differences in hardware between the two, but Orange Pi hasn’t gotten an official devicetree into Linux yet and I do not believe they are trying. Their firmware images have just one difference between the CM4 and 3B dts (a GPIO connected to a power line? I’ve forgotten now).

I had to use Armbian_23.8.2_Orangepi3b_bookworm_edge_6.5.2.img from the Armbian archive, as the following were completely instable, crashing with kernel oopses within a few hours no matter what I tried:

  • Armbian_community_24.5.0-trunk.532_Orangepi3b_bookworm_edge_6.8.9_minimal.img.xz
  • Armbian_community_24.5.0-trunk.532_Orangepi3b_bookworm_vendor_6.1.43_minimal.img.xz
  • Armbian_community_24.5.0-trunk.563_Orangepi3b_bookworm_edge_6.8.9_minimal.img.xz

The wifi works but only on the 5GHz band. For some reason it doesn’t even see 2.4GHz networks with any of those images, although it did with the OrangePi-supplied Orangepicm4_1.0.4_debian_bookworm_server_linux5.10.160.7z.

I would highly recommend against using the OrangePi CM4 for anything. Their Debian bookworm image uses kernel 5.10 and I do not believe it will ever get an update. I did see some posts around the internet from people trying to suss out the CM4 device tree, as well as trying to fix problems in the wifi driver that prevent it from working at all on some boots. The Armbian people I saw discouraged using anything from OrangePi and suggested Radxa as a vendor who actually is working with Armbian to have their hardware supported. The Radxa Zero 3W uses the same RK3655 and comes in a 4GB / 32GB version along with built in wifi/bluetooth.

But many thanks to madHatter for their guide! I’m not sure if I will use this CM4 to replace my existing Home Assistant (a Pi 3B+ 1GB) given how it may just decide to start crashing again if the host OS is kept up to date. However, it would have been nearly impossible for me to get HA running without madHatter’s help.

Thanks for the kind words and contribution @CapnBry, and sorry to hear about your experience with the CM4…
I don’t think I mentioned it, but I also use Armbian_23.8.2_Orangepi3b_bookworm_edge_6.5.2
I have not been using the wifi extensively, but just checked and I can see both 2.4 and 5 GHz on my setup.

Although the setup above has been very stable over 8 months now (not a single glitch, running my primary HA setup 24/7), your findings with OrangePi+Armbian are a bit worrying, but confirm my feeling experimenting with other applications on this combo… Need to explore Radxa, thanks for the hint!

1 Like