Installing Home Assistant Supervised on a Raspberry Pi using Debian 12

I am trying to do a fresh install of Debian 11 with this guide. I have the debian 10 docker install running my production home assistant. I was trying to do a fresh install on a rpi4 of debian 11 and then do a restore of home assistant on new system. I downloaded image and used Balena Etcher to install on my ssd. when I start up the rpi4 it boots to the command prompt rpi4-20210823 login: but then get this repeating message

[ 1481.461117] mmc1: Timeout waiting for hardware cmd interrupt.
 1481.463853] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
 [ 1481.466906] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
 [ 1481.469956] mmc1: sdhci: Blk size:  0x00000000 | Blk cnt:  0x00000000
[ 1481.473005] mmc1: sdhci: Argument:  0x80000c08 | Trn mode: 0x00000000
[ 1481.476055] mmc1: sdhci: Present:   0x1fff0001 | Host ctl: 0x00000001
[ 1481.479104] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
[ 1481.482153] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x0000f447
[ 1481.485202] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[ 1481.488251] mmc1: sdhci: Int enab:  0x00ff1003 | Sig enab: 0x00ff1003
[ 1481.491300] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[ 1481.494350] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
[ 1481.497399] mmc1: sdhci: Cmd:       0x0000341a | Max curr: 0x00080008
 [ 1481.500449] mmc1: sdhci: Resp[0]:   0x00000000 | Resp[1]:  0x00000000
 [ 1481.503498] mmc1: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
 [ 1481.506547] mmc1: sdhci: Host ctl2: 0x00000000
 [ 1481.508650] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x00000000
 [ 1481.511699] mmc1: sdhci: ============================================ 

I know it has something to do with no SD card, I have googled and searched a few things but none have helped to resolve the issue.
I did not have this problem with the Debian 10 install and not sure what I done different.

@bsmith76s: I have the same issue.

I tried some suggested solutions from other forums, but they don’t work: ‘dtparam=sd_poll_once’ line should be added to /boot/config.txt, but there isn’t /boot/config.txt. It does not work even if I create the file. Another solution is if the boot order will be changed, but I haven’t wanted to modifiy eeprom. So I wait for a good solution too.

Thanks, problem with locales solved, I one more time removed docker as you described

First identify what docker-packages are installed (if any) by executing:

dpkg -l | grep -i docker

Take a note of the installed packages.

Now execute:

sudo apt-get purge -y noted-docker-package1 noted-docker-package2 etc.
sudo apt-get autoremove -y --purge noted-docker-package1 noted-docker-package2 etc.

sudo rm -rf /var/lib/docker /etc/docker
sudo rm /etc/apparmor.d/docker
sudo groupdel docker
sudo rm -rf /var/run/docker.sock

and rerun, but get another error:

pi@rpi3-20210823:~$ sudo -i
root@rpi3-20210823:~# curl -fsSL | sh
# Executing docker install script, commit: 93d2499759296ac1f9c510605fef85052a2c32be
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c curl -fsSL "" | gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg
+ sh -c echo "deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] bullseye stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends  docker-ce-cli docker-ce >/dev/null
E: Sub-process /usr/bin/dpkg returned an error code (1)

usb devices:

pi@rpi3-20210823:~$ sudo lsusb
Bus 001 Device 004: ID 0658:0200 Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) - UZB
Bus 001 Device 005: ID 0451:16a8 Texas Instruments, Inc. CC2531 ZigBee
Bus 001 Device 006: ID 0424:7800 Microchip Technology, Inc. (formerly SMSC) 
Bus 001 Device 003: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I also ran the EEPROM USB Boot update with SD before I started process.

I just dusted off my Pi3 and used the guide to test - HA up and running in 25 mins. No issues.

I’m not sure what you are doing wrong through the install process, I would suggest you start over with a freshly formatted drive, and follow the guide step by step, exactly.

I would also suggest that if you having this many issues, you may be better off just using the HA OS image instead of a Supervised install.

1 Like

For those who want to upgrade from Debian 10 (Buster) to Debian 11 (Bullseye) without starting from scratch, here comes how it can be done easily (tested on RPI4 4GB devices):

In a console as the unprivileged user (not root) :

sudo sed -i 's/buster/bullseye/' /etc/apt/sources.list
sudo sed -i 's/buster/bullseye/' /etc/apt/sources.list.d/*.list
sudo sed -i 's|bullseye/updates|bullseye-security|' /etc/apt/sources.list

Only if you previously have installed Debian’s MQTT broker (mosquitto) on the OS level (not as a HA Add-on):

sudo sed -i 's/bullseye/buster/' /etc/apt/sources.list.d/*mosquitto*.list

Continue with the OS upgrade:

sudo apt update

Only if you see the following error message after “sudo apt update”:

The value 'buster' is invalid for APT::Default-Release as such a release is not available in the sources


sudo sed -i 's/buster/bullseye/' /etc/apt/apt.conf
sudo apt update

Important note for those who have set:
sudo apt-mark hold linux-image-arm64
due to the boot problems with the newer official kernel versions on Debian 10 on RPI4, run:

sudo apt-mark unhold linux-image-arm64

Now continue with:

sudo apt upgrade
sudo apt full-upgrade
sudo apt autopurge

The above will take some time. After it has finished it’s time to reboot the host:

sudo systemctl reboot

After the system has rebooted, open a new console and execute (again, as non-root):

sudo apt --fix-broken install
sudo apt-get install udisks2 wget
cd /usr/local/src

Now visit the OS Agent page and then replace the version number with the latest available, into the commands below. (i.e. replace all references to 1.5.1 with the latest available release):

sudo wget
sudo dpkg -i os-agent_1.5.1_linux_aarch64.deb

sudo systemctl reboot

All done. Your HA on the RPI4 should now run on Debian 11 (Bullseye).

The above guide is also valid for HA Supervised on the Intel architecture (i.e. on a Intel NUC). The only step different is the OS Agent part.

Instead of:

sudo wget
sudo dpkg -i os-agent_1.5.1_linux_aarch64.deb


sudo wget
sudo dpkg -i os-agent_1.5.1_linux_x86_64.deb

They’re in /boot/firmware.

Hello. Shouldn’t you use os-agent_1.2.1_linux_armv7.deb package instead of os-agent_1.2.0_linux_aarch64.deb?

When I run uname -m command on my RPI4B, it shows me armv7l so I suppose that os-agent armv7 is the correct file. Am I wrong?

1 Like

1.2.1 only released a few hours ago. Always check and install the latest.

It looks like you are running the RPI4 in 32-bit ARMv7 mode. If uname -m says aarch64 then it is 64 bit. If it says armv7l then it is 32 bit.

So as for your case this is correct: Use the arm7 package instead of the aarch64 package.

1 Like

And how many time Pi3 worked? As I already wrote I was able to run ha before @Tamsy help, but os freezes after 1-7days. I’m using ha since 3 years - started with core, next docker, and from 1-1,5 year as supervised, so I’m not interested in HA OS. I decided to not waste more time on debian and this instruction. I installed again raspbian and used official script

and from 4 days it’s working. I hope it will stay that way and recommend it everybody with similar problems with freezes on raspberry 3. I know that it makes my installation unsupported, but better running unsupported that not running supported.

Still running, no problems.

The script in this guide is identical, so that has made no difference. I merely forked the script way back when Supervised was announced to be deprecated.

Unless you have some specific need to run Supervised, you would be better off running HA OS on a Pi3 and having a supported installation.

1 Like

After I updated to the 1.2.1 agent my logs load very slowing under supervisor /system/ logs. Sometimes not at all. Tamsy told me in a private message he see this also. Are you?

I actually noticed this behaviour since OS Agent v.1.1.1 already. Loading the Log at Supervisor → System takes up to 45 sec. Nothing in the logs (daemon.log). It seemingly also does not affect any functionality.

pi@rpi3-20210823:~$ sudo lsusb
Bus 001 Device 004: ID 0658:0200 Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) - UZB
Bus 001 Device 005: ID 0451:16a8 Texas Instruments, Inc. CC2531 ZigBee
Bus 001 Device 006: ID 0424:7800 Microchip Technology, Inc. (formerly SMSC) 
Bus 001 Device 003: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Is there any special reason why you have connected the Aeotec Z-Stick Gen5 and the TI CC2531 ZigBee-Stick to a USB2-hub which is connected to one of the USB ports of the RPI3?

Sudden freezes after some time with HA Supervised on Debian are discussed multiple times on this very thread and the culprit is often discovered as a power issue.

Are you aware that the Aeotec Z-Stick Gen5 pulls up to 5V from the USB port?

Is your USB2-hub externally powered? I would try to connect the two sticks through 2 extension cables to individual USB-ports on your RPI3 and monitor whether it still freezes after some time when run with Debian 11.

Please also note that not every externally powered USB-hub seems to be compatible with the RPI. Proper research should be done before. You might find some information about compatible USB-hubs, besides also from other sources, here.

No I am not seeing any slowdown or failure to load.

You did a fresh install with Debian 11 but not an upgrade from Buster to Bullseye, did you? :thinking:

@tamsy @DavidFW1960 I believe that David is not on a Pi4 either?

No I have upgraded from stretch>Buster>bullseye. I have played with Proxmox VM’s with fresh bullseye but my main HA was upgraded from Buster.

Correct but you specifically asked if I was seeing a slowdown. My machine is an Intel NUC for my main HA.

1 Like

You are correct. I was just pointing out to @Tamsy that your setup is different than ours. Both of us are using a pi4.