Hi all,
There were changes to the HA OS Agent preventing Supervised installs on Raspberry Pi OS. Would like to share a quick community guide for Debian installs, coupled with some extra add-ons.
I clobbered this from multiple resources, not all info was created by me. This guide was tested on a rPi 4.
EDIT: I found the community guide where I extracted the info from - appending full credit here!
As a precursor, flash the official Debian image for Raspberry Pi onto your SD card. Connect the Pi to a monitor, with keyboard and LAN connection (not WiFi).
Step 0 - preinstallation
Once itās fully booted, youāll see a prompt like this
Debian GNU/Linux 11 rpi4-20210823 tty1
rpi4-20210823 login:
Login into the terminal using root
.
Update timezone. You can print a list using this command timedatectl list-timezones
sudo timedatectl set-timezone <INSERT_TIMEZONE>
Step 1 - creating username for SSH
Then create a custom username <YOUR_USERNAME>, create a password. You will then be asked to enter your first name, last name, phone number etc - you can skip all these by pressing Enter
.
adduser YOUR_USERNAME
usermod -aG sudo YOUR_USERNAME
Post this, you can login into your installation via SSH, which will make things easier.
Step 2 - Installing OS Agent, Docker & Dependencies
Connect via SSH and run these commands:
sudo -i
sudo apt update && sudo apt upgrade -y && sudo apt autoremove āy
apt --fix-broken install
apt-get install jq wget curl udisks2 libglib2.0-bin network-manager dbus apparmor systemd-journal-remote lsb-release bluetooth -y
curl -fsSL get.docker.com | sh
Then install latest version of OS Agent. Change the URL to point to the latest version (1.5.1 at time of writing)
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
Reboot the Pi using sudo reboot
Step 3 - Installing HA Supervised
Install as follows, and choose RaspberryPi4-64 as the option.
sudo -i
wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
dpkg -i homeassistant-supervised.deb
Once you get the completion prompt, go into your ip_address:8123 page and proceed from here!
OTHER RESOURCES:
Bluetooth drivers (guide here: Getting Bluetooth Working with Raspberry Pi Zero W and Debian Buster | newspaint)
wget \ -O /lib/firmware/brcm/BCM43430A1.hcd \ https://github.com/RPi-Distro/bluez-firmware/blob/9556b08ace2a1735127894642cc8ea6529c04c90/broadcom/BCM43430A1.hcd?raw=true
Enabling PWR/ACT LEDs
Both LEDs are turned off by default. You can create a service script (see below) ,but test if these commands work for you. PWR refers to the Power LED, ACT refers to the activity LED.
For the ACT command line, mmc1
points to my SD card. But if it doesnāt work, use mmc0
instead.
echo 1 | sudo tee /sys/class/leds/PWR/brightness
echo mmc1 | sudo tee /sys/class/leds/ACT/trigger
Once you confirm the commands work for you, create a script as follows:
sudo nano /etc/systemd/system/rpi-led-pwr.service
Copy the entire contents into the editor, Ctrl-X to exit and enter Y to save.
[Unit]
Description=Control Raspberry Pi LEDs
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=sh -c "echo mmc1 | sudo tee /sys/class/leds/ACT/trigger"
ExecStart=sh -c "echo 1 | sudo tee /sys/class/leds/PWR/brightness"
ExecStop=sh -c "echo 0 | sudo tee /sys/class/leds/ACT/trigger"
ExecStop=sh -c "echo 0 | sudo tee /sys/class/leds/PWR/brightness"
[Install]
WantedBy=multi-user.target
Then run these commands to start the service
systemctl daemon-reload
systemctl enable rpi-led-pwr.service
systemctl start rpi-led-pwr.service
Enable sudo for user without password
Enter into the config page using sudo visudo
Append the following line, replace with your username. Ctrl-X to save, and click on Y.
<USER> ALL=(ALL) NOPASSWD: ALL