Home Assistant in Docker #1: Debian Buster on ODROID-N2+ aka Home Assistant Blue
I ordered Home Assistant Blue on the day it was announced at Home Assistant Conference on December 13, 2020. It was exactly what I wanted – powerful hardware without any noise. And nice-looking, of course. It was a great speed improvement compared to Raspberry Pi 3B+, but this hardware can handle much more than just Home Assistant.
Choosing OS
To get Docker running, we need to install some Linux distributions on our Home Assistant Blue (Ordoir N2+) other than Home Assistant OS. You can install any OS you’d like, but be prepared to face the consequences like missing drivers, kernel modules, etc. It is much better to get an OS image prepared especially for our hardware. And Hardkenrel, the company behind Odroid, got us covered with a couple of officially supported operating systems:
- Ubuntu MATE
- Ubuntu Minimal
- Android
Let’s see what we’ll get.
Ubuntu MATE could be a good option if you want something with a desktop environment. If you are not ready for a black screen with just letters on it – this option is for you. You can install Docker Desktop then and be happy while moving your mouse around.
For CLI users, it is recommended by Hardkernel to use Ubuntu Minimal. But this distribution is so minimal, that you’ll spend too much time installing all the necessary things and enabling kernel modules. Then figuring out that some modules are not available for the current kernel and realize you’ll need to build your own kernel from sources.
Android could bring a lot of fun installing Docker on it, so it looks like we have out of options. But fear not, as the community got us covered by building tons of OS images and sharing them on Odroid forums.
My personal favorite is Debian Buster. I choose Debian because of its really big community and huge knowledge base spread around the internet. The Buster version is newer than the widely recommended Stretch. There is also a Bullseye available, but you’ll face boot issues after flashing eMMC through the USB OTG. As I don’t have an eMMC USB adapter, that was my only way to flash an image.
Flashing OS image
As Home Assistant Blue comes with an eMMC storage chip, we will need to flash the operating system image there and we have two options to do so:
- Flash eMMC using USB adatper
- Flash using Petitboot and USB OTG
Both will require us to get inside of our Odroid N2+ case. The first method is straightforward. We take our eMMC chip out and put it inside a USB adapter.
Then we get balenaEtcher and flash OS image downloaded from Odroid forums. This method is also described on Odroid Wiki.
The second method has some additional steps but requires only a USB-to-micro-USB cable. And a laptop or PC. And a spare monitor. And a spare keyboard… Ok, that’s a lot of stuff, but I’m sure the chances you have all of this and don’t have an eMMC USB adapter are high.
So, the first step would be to check the Petitboot (a bootloader of Odroid device) version because it could not have USB OTG support yet. To do so we need to toggle boot mode to SPI with a small switch on a board:
Then we need to connect a monitor to our Odroid N2+ through the HDMI port and connect power to the board. The device will boot into a Petitboot menu and we’ll be able to check Petitboot version:
All images and a flashing guide itself are taken from magazine.odroid.com.
If our Petitboot version is lower than dev.20191127 or not working at all (that was my case), we have a problem that could be solved by following the Petitboot recovery or upgrade guide from Odroid Wiki.
After that, we need to connect our Odroid board to a laptop or PC with a USB OTG cable with an eMMC chip attached to a board and a boot switch in the SPI position:
A spare keyboard and monitor should be connected to Odroid as well. After that, we need to power up the board to make it boot.
We should see the Petitboot menu on a monitor connected to a board where we need to choose the “Exit to shell” option.
This will allow us to execute commands and the command we need is:
ums dev/mmcblk0
Our eMMC storage should appear as a storage device on our laptop/PC after that.
Now we could simply use balenaEtcher and flash OS image downloaded from Odroid forums like a regular OS installation described on Odroid Wiki.
First boot
Before booting our fresh OS we will need to disconnect the Odroid board from the laptop/PC and move the SPI switch into the “MMC” position. While it is powered off of course.
On the first boot, if you choose the same image as I do, the script will resize the file system to take all space available on eMMC storage and configure the SSH server.
Now we are able to connect to our newly created server via SSH using the root username and the default password: odroid.
And the first commands we should execute on our server should be:
apt update && apt upgrade && apt dist-upgrade
Next posts in series: