Installing Home Assistant Supervised on Raspberry Pi OS

Brilliant guide and script, thank you very much @kanga_who . I was just wondering if I could suggest an alteration to the install script? Could you change it from:
if systemctl list-unit-files ModemManager.service | grep enabled > /dev/null 2>&1; then
to
if systemctl is-enabled ModemManager.service | grep enabled > /dev/null 2>&1; then

it’s just that list-unit-files shows what the vendor sets the service to on install (enabled or disabled) and therefore can’t be changed. This means that as it’s enabled, at least on ubuntu, grep gets a match and gives a false positive for the service being enabled.

UNIT FILE            STATE    VENDOR PRESET
ModemManager.service disabled enabled

1 unit files listed.

The script isn’t mine, I just take it from the official HA version. You are welcome to submit a change on Github HERE for a change to script and see if it gets through.

@kanga_who

I’m trying to follow your instructions on a Pi 4B 2GB and kept failing at the last curl command:

pi@rpi4b01:~ $ sudo curl -sL "https://raw.githubusercontent.com/Kanga-Who/home-assistant/master/supervised-installer.sh" | bash -s -- -m raspberrypi4
[Info]
[Info]
[Info]
[Info] This script is taken from the official
[Info]
[Info] Home Assistant Supervised script available at
[Info]
[Info] https://github.com/home-assistant/supervised-installer
[Info]
[Info]
[Info]
pi@rpi4b01:~ $

sudo docker ps shows no containers installed.

I suspect I’m having issues trying to reach registry-1.docker.io:

pi@rpi4b01:~ $ curl -vvv https://registry-1.docker.io/v2/                                * Expire in 0 ms for 6 (transfer 0x59f880)
* Expire in 1 ms for 1 (transfer 0x59f880)
* Expire in 0 ms for 1 (transfer 0x59f880)
* Expire in 2 ms for 1 (transfer 0x59f880)
* Expire in 0 ms for 1 (transfer 0x59f880)
* Expire in 0 ms for 1 (transfer 0x59f880)
* Expire in 2 ms for 1 (transfer 0x59f880)
* Expire in 0 ms for 1 (transfer 0x59f880)
* Expire in 0 ms for 1 (transfer 0x59f880)
* Expire in 2 ms for 1 (transfer 0x59f880)
* Expire in 0 ms for 1 (transfer 0x59f880)
* Expire in 0 ms for 1 (transfer 0x59f880)
* Expire in 2 ms for 1 (transfer 0x59f880)
* Expire in 1 ms for 1 (transfer 0x59f880)
* Expire in 1 ms for 1 (transfer 0x59f880)
* Expire in 2 ms for 1 (transfer 0x59f880)
* Expire in 1 ms for 1 (transfer 0x59f880)
* Expire in 1 ms for 1 (transfer 0x59f880)
* Expire in 4 ms for 1 (transfer 0x59f880)
* Expire in 2 ms for 1 (transfer 0x59f880)
* Expire in 2 ms for 1 (transfer 0x59f880)
* Expire in 4 ms for 1 (transfer 0x59f880)
* Expire in 2 ms for 1 (transfer 0x59f880)
* Expire in 2 ms for 1 (transfer 0x59f880)
* Expire in 4 ms for 1 (transfer 0x59f880)
* Expire in 3 ms for 1 (transfer 0x59f880)
* Expire in 3 ms for 1 (transfer 0x59f880)
* Expire in 4 ms for 1 (transfer 0x59f880)
* Expire in 4 ms for 1 (transfer 0x59f880)
* Expire in 4 ms for 1 (transfer 0x59f880)
* Expire in 4 ms for 1 (transfer 0x59f880)
* Expire in 4 ms for 1 (transfer 0x59f880)
* Expire in 4 ms for 1 (transfer 0x59f880)
* Expire in 8 ms for 1 (transfer 0x59f880)
* Expire in 6 ms for 1 (transfer 0x59f880)
* Expire in 6 ms for 1 (transfer 0x59f880)
* Expire in 8 ms for 1 (transfer 0x59f880)
* Expire in 6 ms for 1 (transfer 0x59f880)
* Expire in 6 ms for 1 (transfer 0x59f880)
* Expire in 8 ms for 1 (transfer 0x59f880)
* Expire in 8 ms for 1 (transfer 0x59f880)
* Expire in 8 ms for 1 (transfer 0x59f880)
* Expire in 8 ms for 1 (transfer 0x59f880)
* Expire in 9 ms for 1 (transfer 0x59f880)
* Expire in 9 ms for 1 (transfer 0x59f880)
* Expire in 16 ms for 1 (transfer 0x59f880)
* Expire in 12 ms for 1 (transfer 0x59f880)
* Expire in 12 ms for 1 (transfer 0x59f880)
* Expire in 16 ms for 1 (transfer 0x59f880)
* Expire in 12 ms for 1 (transfer 0x59f880)
* Expire in 12 ms for 1 (transfer 0x59f880)
* Expire in 16 ms for 1 (transfer 0x59f880)
* Expire in 16 ms for 1 (transfer 0x59f880)
* Expire in 16 ms for 1 (transfer 0x59f880)
* Expire in 16 ms for 1 (transfer 0x59f880)
* Expire in 50 ms for 1 (transfer 0x59f880)
* Expire in 50 ms for 1 (transfer 0x59f880)
* Expire in 32 ms for 1 (transfer 0x59f880)
* Expire in 50 ms for 1 (transfer 0x59f880)
* Expire in 50 ms for 1 (transfer 0x59f880)
* Expire in 32 ms for 1 (transfer 0x59f880)
* Expire in 50 ms for 1 (transfer 0x59f880)
* Expire in 50 ms for 1 (transfer 0x59f880)
* Expire in 50 ms for 1 (transfer 0x59f880)
*   Trying 52.5.11.128...
* TCP_NODELAY set
* Expire in 149924 ms for 3 (transfer 0x59f880)
* Expire in 200 ms for 4 (transfer 0x59f880)
* Connected to registry-1.docker.io (52.5.11.128) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=*.docker.io
*  start date: May 23 00:00:00 2020 GMT
*  expire date: Jun 23 12:00:00 2021 GMT
*  subjectAltName: host "registry-1.docker.io" matched cert's "*.docker.io"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
> GET /v2/ HTTP/1.1
> Host: registry-1.docker.io
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Content-Type: application/json
< Docker-Distribution-Api-Version: registry/2.0
< Www-Authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io"
< Date: Tue, 29 Sep 2020 05:20:59 GMT
< Content-Length: 87
< Strict-Transport-Security: max-age=31536000
<
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}
* Connection #0 to host registry-1.docker.io left intact

Any idea what I’m doing wrong?

Did you run as per the instructions?

sudo -i

.....

curl -sL "https://raw.githubusercontent.com/Kanga-Who/home-assistant/master/supervised-installer.sh" | bash -s -- -m raspberrypi3

edit: I just did a fresh Raspi OS install on a Pi4 4gb, and installed as per the guide. Fully up and running within 25 mins, so you must not have followed the instructions correctly.

@kanga_who

Sorry I didn’t. I missed the “sudo -i” command earlier. With it, now I get:

[Info] Creating NetworkManager configuration
[Info] Restarting NetworkManager
[Info] Install supervisor Docker container
Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 8.8.4.4:53: dial udp 8.8.4.4:53: connect: network is unreachable

And I would lose my ssh connection to my pi over wifi.

Should I start from the first curl command?

I’d start from scratch with a fresh base image.

i got same error… do you already know how to fix it?

Not yet unfortunately.

I did a fresh install from a Raspberry Pi OS image and I’m consistently getting this:

root@rpi4b01:~# curl -sL "https://raw.githubusercontent.com/Kanga-Who/home-assistant/master/supervised-installer.sh" | bash -s -- -m raspberrypi4
[Info]
[Info]
[Info]
[Info] This script is taken from the official
[Info]
[Info] Home Assistant Supervised script available at
[Info]
[Info] https://github.com/home-assistant/supervised-installer
[Info]
[Info]
[Info]
[Warning] Docker is using json-file and not 'journald' as the logging driver, this is not supported.
[Info] Creating NetworkManager configuration
root@rpi4b01:~#

The earlier curl command didn’t complete successfully the first time either.

I suspect from where I am, docker.com and docker.io aren’t consistently accessible.

# open/create a file with nano
sudo nano /etc/docker/daemon.json

# insert the following content then save (ctrl + s) and exit (ctrl + x)
{
  "log-driver": "journald",
  "storage-driver": "overlay2"
}

# restart docker
sudo systemctl restart docker

I managed to “fix” this by:

systemctl stop network-manager.service 
wget https://raw.githubusercontent.com/Kanga-Who/home-assistant/master/supervised-installer.sh
nano supervised-installer.sh 

comment out line 108:

#systemctl restart "${SERVICE_NM}"

and then in my case:

bash supervised-installer.sh -m raspberrypi4-64
systemctl start network-manager.service 

Just installed home assistant supervised on raspberry pi 4 booting from usb ssd nvme :crazy_face:

1 Like

@0kk0

I tried your method and got this:

root@rpi4b01:~# bash supervised-installer.sh -s -- -m raspberrypi4-64
[Info]
[Info]
[Info]
[Info] This script is taken from the official
[Info]
[Info] Home Assistant Supervised script available at
[Info]
[Info] https://github.com/home-assistant/supervised-installer
[Info]
[Info]
[Info]
[Info] Creating NetworkManager configuration
[Info] Restarting NetworkManager
supervised-installer.sh: line 192: --/hassio.json: No such file or directory

Also thought my DNS must be unreliable, so I set /etc/resolv.conf to use Cloudflare:

root@rpi4b01:~# cat /etc/resolv.conf
# Generated by resolvconf
nameserver 1.1.1.1
nameserver 1.0.0.1

but still not getting any further either way.

ohh sorry…try it without “-s --”

Like this:

bash supervised-installer.sh -m raspberrypi4

@0kk0

Your method works for me, thanks very much.

My ISP’s DNS must be really unreliable or maybe my Pi’s wifi module is degrading (yes, I know I should be using ethernet & eventually I will). I had to run the supervised-installer.sh tens of times before I finally got to:

[info] Home Assistant supervised is now installed
[info] First setup will take some time, when it's ready you can reach it here:
[info] http://192.168.20.138:8123

My next issue is pretty basic & I’m a docker noob so please forgive me - I’m unable to load up the UI using that URL above.

ha supervisor info says:

addons: []
addons_repositories:
- https://github.com/hassio-addons/repository
arch: armv7
channel: stable
debug: false
debug_block: false
diagnostics: null
healthy: true
ip_address: 172.30.32.2
logging: info
supported: false
timezone: UTC
version: "245"
version_latest: "245"
wait_boot: 5

How do I check if the ha services are running and confirm what URL to load?

Edit 1: OK my Pi’s network config must be messed up and I don’t know how to fix it. I managed to load up the Home Assistant UI by loading it from localhost, so I’m sure it’s up.

Weird thing is I see the install script says the IP is 192.168.20.138 but ifconfig shows 192.168.20.142. Loading either IPs from my desktop PC don’t work. Using its hostname rpi4b01.local doesn’t work.

What/where should I check?

Edit 2: Not sure exactly what helped, but I managed to reach my Pi using its hostname in the end.

Probably re-entering my wifi ssid and password using raspi-config, or selecting US for the wifi region since I just changed my home wifi to 802.11ac may have been the solution.

Thanks all.

1 Like

Hello, I am getting following error. I am on ‘Linux raspberrypi 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux’

pi@raspberrypi:~ $ sudo curl -sL "https://raw.githubusercontent.com/Kanga-Who/home-assistant/master/supervised-installer.sh" | bash -s -- raspberrypi3
[info] 
[info] This script is taken from the official
[info] 
[info] Home Assistant Supervised script available at
[info] 
[info] https://github.com/home-assistant/supervised-installer
[info] 
[info] Creating default docker deamon configuration /etc/docker/daemon.json
bash: line 73: /etc/docker/daemon.json: Permission denied```

Can you please help as i have been testing different commands since last 2 days and it always stuck at this point. 

Thank you

Follow the instructions, you don’t run the curl command with sudo.

1 Like

Cant get it to install on my pi 4 this time, this is last output:

[info] Creating NetworkManager configuration
[info] Restarting NetworkManager
[info] Install supervisor Docker container
invalid reference format

and then returns to the prompt. Any idea’s?

Edit: this might be caused by a faulty SD card… I’ll get back on this later.

Edit 2: Nope, tried different sdcard but also problems. They appear at different moments but seem to only occur after networkmanager is installed. My last install attempt actually resulted in a frozen pi, had to cycle the power. After this I can’t even access it anymore…

Edit 3: Turns out you’re not supposed to first boot the raspberry pi and use WIFI to connect… when you do networkmanager kills that connection and then totally disregards a working wifi network connection. After the networkmanager install I can only acces the pi using the lan port. And to top it off, it regularly requests a new ip address from the DHCP server for unclear reasons…

I got it working in the end but it still seems very unstable. Just did a restore of my settings and now HA doesnt come back up anymore :frowning:

1 Like

Hi, thanks i have now managed to install.

I was wondering where is the location for homeassistant folders in this case. I am tying to add ‘Hive’ customer integration and would add couple of files in homeassistant folder.

Thanks

/usr/share/hassio/homeassistant

1 Like

hey team, trying the install via Wifi and then afterwards on LAN and here is the error i’m facing.

root@raspberrypi:~# curl -sL “https://raw.githubusercontent.com/Kanga-Who/home-assistant/master/supervised-installer.sh” | bash -s – -m raspberrypi4
[info]
[info] This script is taken from the official
[info]
[info] Home Assistant Supervised script available at
[info]
[info] https://github.com/home-assistant/supervised-installer
[info]

It basically just dies. Based on the script I expect it to run until it gives me back a successful installation output. Any ideas?

It pauses for 20 seconds at that point, then proceeds.

There is no error shown from what you have posted.