Rpi 4 installation

You can find it here: https://github.com/home-assistant/hassos/issues . Has anyone tried comparing the speed of Running HA on HassOS vs Native pi + docker on pi4? Trying to see which way I should go

I have it running with the beta and my snapshot from my Rpi3. It’s just that you cannot transfer over the whole config cuz some things are breaking it. I had to ssh into and stop duckdns and some other things for it to start properly. So do a snapshot but choose carefully what you transfer over :slight_smile:

1 Like

Hugh_man’s guide worked perfectly. Now I got Pi4 Rasspbian + hass.io docker + SSD NVMe HD running. Btw, the hassio install script got updated so now you actually don’t have to modify install script.

Oh and just like Alexander above said disable nginx / duckdns addons when you are restoring from snapshot, and just reinstall them again manually. I spent 15 minutes trying to get back in.

Any guide for using SSD with pi 4?

The only way I got SSD booting on Pi4 is to go with Raspbian Buster instead of HassOS and then install Hassio on top.

The caviat is that you will still have to have sd card plugged in to boot but then everything will run of SSD usb. I got a Kingston A2000 NVMe drive (it’s pretty cheap considering the speed you get) and Shinestar adapter for it . While you are there pickup yourself this bad boy heat sink case Pi4 runs much hotter then pi3 and will throttle, and you will be back at pi3 speed :joy:

It was actually pretty easy setup from there

------------ Step by step Pi4 + SSD guide------------

Install Raspbian Buster and Setup SSD handover

  • install official Raspbian Buster Lite version (burn it using BalenaEtcher), (put SSH file on SD boot partition so you can connect to it on boot). Don’t worry about the SSD just yet.
  • boot it up, then plugin your new drive and follow this guide: https://tomshardware.com/news/boot-raspberry-pi-from-usb,39782.html
  • there is a typo in that guide when editing cmdline.txt file, it should be sudo nano /boot/cmdline.txt instead of sudo nano /boot/cmdlinetxt
  • After the reboot you will be running completely of USB, you must have sd card inserted in order for it to boot up though. You can test by running findmnt -n -o SOURCE / it should now say /dev/sda1 or sda2
  • Run an update to get the latest kernel etc sudo apt-get update && sudo apt-get dist-upgrade

(borrowed from hugh_man above)
Install docker (instructions taken from this thread on docker ) :
$ sudo curl -sL get.docker.com | sed 's/9)/10)/' | sh

Install hassio dependencies (instructions taken from here )
$ sudo apt-get install apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat software-properties-common

Install hassio borrowed from here

  1. Save hassio installer to file: $ curl -sL "https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh" >> hassio_install.sh

  2. Run install script: `$ sudo bash hassio_install.sh -m raspberrypi4’
    or you can do raspberrypi4-64 if you are feeling adventures.

Restore HA Snapshot
All done, you should now be able to access Home Assistant from your pi ip. Login and restore your snapshot. I would also uncheck nginx or duckdns addons if you had those and reinstall them manually. I had to edit my local host file just to get back in because of them.

Also it appears that HA doesn’t get started automatically after the snapshot restore, you will have to start it up by connecting your homeassistant docker container and running “hassio ha start” , I gave it 15min and then started it (or you can reboot your Pi4 that should start it up again)

If you used Zwave Aeotec Z-Stick Gen5 stick on Pi3
Buy the Sabrent 4 port USB2.0 adapter. Otherwise your Zwave Aeotec stick won’t work, more info on this here. I tried 2 different ones some of them sort of work but they glitch, this one has been solid for a few days. Make sure you get the USB2.0 version, plug it in to a usb2.0 port. I got 50+ zwave devices on this thing and they are all humming along. You can also switch to HUSBZB-1 (if you don’t want to deal with the hub) and will give you Zigbee as well. The only issue is that you will have to remove all your Zwave devices one by one and then re-add them back to the new stick one by one (no thank you). If anyone knows away around this I would LOVE to hear it.

Remove ModemManager from Rasspbian apparently this conflicts with Zwave devices
From the main pi (not from hassio ).
Run sudo systemctl disable ModemManager
Followed by sudo apt-get purge modemmanager

If you used GPIO ports, some now are disabled
I was using about 10 ports for my home alarm reed sensors. Pi4 has the same Gpio layout however for some reason ports don’t get set to pull up resistor which is needed to read the switches. They still show up active under hardware menu but will be useless without the pull up resistor (this happend on HassOS as well btw). The workaround is you have to manually set them to “pull up” during boot inside raspbian. Here is a guide on how to do that

Pi4 + SSD Performance Difference
The performance with that drive is huge! I’ve been getting score of 9500 with that drive vs 300. You can benchmark yourself, while you are in Raspbian run:
curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash

You can see other’s people benchmarks here: https://jamesachambers.com/raspberry-pi-storage-benchmarks/
In the real world it means no more waiting when clicking between screens. Recorder and Event log is actually usable, you click it and things instantly show up. Before I had to count to 10 to get it to show up.

Raspbian vs HassOS difference
For those who are wondering if Raspbian OS is faster then HassOS !

  • benchmark with HassOS
  • with Raspbian
    so pretty much the same thing

Thanks for the great instructions @skynet01!

I’ve currently been running manual installation of HA because I have couple of local python scripts that are polling for GPIO changes and reporting the data to HA via depricated homeassitant.remote.

My question is, can I use the same process when running HA in docker image and does it support local python scripts?

not sure about local python scripts. But it’s pretty much no difference between Raspbian +Hass.io and Hassos + Hass.io . For both of them gpio pins work as i use those myself.

Currently I’m with Pi 3 with HassOS + Hass.io and I was wondering if I want to keep it that way or go with RAspbian + Hass.io. Because there is no noticeable performance benefit from hassos ( just the simple setup ) I definitely will prefer Raspbian as Im old school linux user.

Raspbian vs HassOS difference
For those who are wondering if Raspbian OS is faster then HassOS !

Yep I found the network benchmark faster in HassOS vs Raspbian also, however checking config and restarting HA is far far faster using Raspbian.

I’m talking 5 seconds to check config in Raspbian vs over 2 minutes in HassOS!

Thanks for the guide and buying tips. I didn’t know about the cool pi-4 heat sync case. I had the little heat sinks and fan, I upgraded :wink: Bought the SSD and adapter too. Nice!

I had a few hiccups:
Formatted SSD fat32 used mini tool partition wizard
From Tom’s Shareware link, several items are a bit different on latest buster. One missing (.) slowed me down for a bit.{ sudo nano /boot/cmdline**.**txt (was missing (.)}

This link helped me with just the boot cmdline.txt edit.

Looks like I have docker, Hassio supervisor, and DNS installed, but hassio won’t run. Do I need to edit the hassio_install.sh script?


pi@raspberrypi:/ $ hassio ha start
-bash: hassio: command not found
pi@raspberrypi:~ $ sudo docker ps
CONTAINER ID        IMAGE                                   COMMAND                  CREATED             ST                                                                        ATUS              PORTS               NAMES
f6a72fbee8ed        homeassistant/armv7-hassio-dns:1        "coredns -conf /conf…"   10 minutes ago      Up                                                                         10 minutes                           hassio_dns
ed0580e47968        homeassistant/armv7-hassio-supervisor   "/bin/entry.sh pytho…"   21 minutes ago      Up                                                                         10 minutes                           hassio_supervisor
pi@raspberrypi:~ $ docker --version
Docker version 19.03.2, build 6a30dfc

Well fist you were support to format it as ext4 and not fat32 (it will work but your file size will be limited), sudo mkfs.ext4 /dev/sda1 the reason you cant start Hass is because you are trying to run that command from rasspbian, you need to connect to your hass docker container then run it in there.

It looks like your Hass.io container is running but for some reason hass is not starting. You can see the logs of the container by running “sudo docker logs hassio_supervisor” and to connect directly to a container you would use sudo docker exec -it hassio_supervisor /bin/bash

You don’t have to modify hassio_install.sh

1 Like

Thanks for the help,
I found an error. I will paste now and start searching for cure.

sudo docker logs hassio_supervisor
19-09-14 05:59:07 INFO (SyncWorker_7) [hassio.docker.interface] Pull image homeassistant/raspberrypi4’-homeassistant tag landingpage.
19-09-14 05:59:07 ERROR (SyncWorker_7) [hassio.docker.interface] Can't install homeassistant/raspberrypi4’-homeassistant:landingpage -> 400 Client Error: Bad Request ("invalid reference format").
19-09-14 05:59:07 WARNING (MainThread) [hassio.homeassistant] Fails install landingpage, retry after 30sec
pi@raspberrypi:~ $

I think it’s due to this Invalid Reference format · Issue #115 · home-assistant/hassio-build · GitHub
when you ran the install script did you specify that you have pi4? with sudo bash hassio_install.sh -m raspberrypi4

1 Like

I am pretty sure I followed your scripts.
I just ran sudo docker system prune
then did the scrips again.

pi@raspberrypi:~ $ sudo curl -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh" >> hassio_install.sh
pi@raspberrypi:~ $ sudo bash hassio_install.sh -m raspberrypi4
[Info] Install supervisor Docker container
[Info] Install supervisor startup scripts
[Info] Install AppArmor scripts
[Info] Run Hass.io
pi@raspberrypi:~ $

From there should I be able to open web? http://my-p4-ip:8123/

Docker info:

pi@raspberrypi:~ $ sudo docker info
 Debug Mode: false

 Containers: 2
  Running: 2
  Paused: 0
  Stopped: 0
 Images: 3
 Server Version: 19.03.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
   Profile: default
 Kernel Version: 4.19.71-v7l+
 Operating System: Raspbian GNU/Linux 10 (buster)
 OSType: linux
 Architecture: armv7l
 CPUs: 4
 Total Memory: 3.814GiB
 Name: raspberrypi
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
 Live Restore Enabled: false

WARNING: No swap limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
pi@raspberrypi:~ $
1 Like

Yeah you should be able to access it from the site now. when you do docker sudo docker ps do you see homeassistant on there? What do the logs say if you do

sudo docker logs hassio_supervisor


sudo docker logs homeassistant

What if you do sudo docker exec -it hassio_supervisor /bin/bash followed by hassio ha start

1 Like
sudo docker logs hassio_supervisor
19-09-14 07:27:25 INFO (SyncWorker_18) [hassio.docker.interface] Pull image homeassistant/raspberrypi4’-homeassistant tag landingpage.
19-09-14 07:27:25 ERROR (SyncWorker_18) [hassio.docker.interface] Can't install homeassistant/raspberrypi4’-homeassistant:landingpage -> 400 Client Error: Bad Request ("invalid reference format").
19-09-14 07:27:25 WARNING (MainThread) [hassio.homeassistant] Fails install landingpage, retry after 30sec

pi@raspberrypi:~ $ sudo docker logs homeassistant
Error: No such container: homeassistant
pi@raspberrypi:~ $ sudo docker exec -it hassio_supervisor /bin/bash followed by hassio ha start
/bin/bash: followed: No such file or directory
pi@raspberrypi:~ $

Thank you!

Thanks for the help I got it running.
Deleted all containers, and reinstalled. (Found How to remove all Docker containers and images from the host scripts here

pi@raspberrypi:~ $ docker stop $(docker ps -q)
pi@raspberrypi:~ $ docker rm $(docker ps -qa)
pi@raspberrypi:~ $ docker rmi -f $(docker images -q)

pi@raspberrypi:~ $ docker system prune
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all dangling images
  - all dangling build cache

Are you sure you want to continue? [y/N] y
Total reclaimed space: 0B
pi@raspberrypi:~ $

pi@raspberrypi:~ $ sudo curl -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh" >> hassio_install.sh
pi@raspberrypi:~ $ sudo bash hassio_install.sh -m raspberrypi4
[Info] Install supervisor Docker container
[Info] Install supervisor startup scripts
[Info] Install AppArmor scripts
[Info] Run Hass.io
[Info] Install supervisor Docker container
[Info] Install supervisor startup scripts
[Info] Install AppArmor scripts
[Info] Run Hass.io
pi@raspberrypi:~ $

Now I will restore my pi3 image onto the pi-4 :smiley:

1 Like

Hahah yes this looks very familiar.

1 Like

I’ve been trying to get Hass.io working on my Raspberry 4…
Tried 32 bit a few times, tried 64 bit. But all nothing.
Going to http://hassio.local:8123/ gives nothing. Going to port 8123 on the IP of the raspberry seems to be doing something, but eventually gives a time-out. Connected a screen to the raspberry Pi, it shows all black…
Pinging to the Pi gives no repsonse as well…

I’m lost!! What’s going on here? Anyone has an idea?

Been doing a lot of Googling, but everything I find on installing Hass. io starts from the user interface… I can’t be the only one who’s unable to even get to the interface? Right?