Rpi 4 installation

Yours and hugh_man’s guides worked perfectly for me, but a couple of things I encountered were that dhcpcd is still running when you install network_manager. For my first try, I’d set up a static IP in dhcpcd.conf, so network manager went and got another through dhcp resulting in two IPs for my instance (oddly both worked at :8123 for HA). However, this created weird issues with SAMBA such that I couldn’t connect to upload my snapshot file (it asked for a password and then said it wasn’t the right one). So maybe include something about disabling dhcpcd if you want to run a static IP:

sudo systemctl stop dhcpcd
sudo systemctl disable dhcpcd

did the trick for me.

Then, use

nmcli con edit

to change method to manual, and IP, DNS and gateway to suit your network.

Secondly, and perhaps this was because of my weird dual IP issues, I couldn’t get the snapshot to restore properly. I could occasionally get into SAMBA to upload the snapshot file, and the addons would get restored, but none of the .yaml files or device/entity config files were. I tried 3 or 4 times, reformatting and rebuilding the SSD each time to ensure I had a clean install. Finally, (after fixing the IP problem) I booted off my old card (SD based HA install), manually copied the config and other HA directories through SAMBA to my laptop, booted back into a fresh SSD version of HA, installed the SAMBA addon, shut down HA via server controls (not host, just HA or SAMBA goes away), then copied all the HA files and folders from my laptop on top of whatever was in the default HA setup on the SSD. I then rebooted the pi and everything worked except the database (which I just deleted and let HA create another of). Note: make sure to get the hidden folders and files (.storage in particular) when you are copying.

I was coming from a hassos version of HA, so maybe that is why the restore failed, I don’t know.

Anyway, after 5 hours and 4 or 5 complete rebuilds of the SSD-based system it works. Hopefully my lessons and experiences can help others be more efficient with their attempts.

Ok, I am using the ‘Manual Installation on a Raspberry Pi’ instructions to install HA on buster lite… When I get to:

sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
source bin/activate

… upon entering ‘python3 -m venv’, i think to start a virtual environment… command line returns:
venv: error: the following argument are required: ENV_DIR

I’m on a clean install, only having done the steps in https://www.home-assistant.io/docs/installation/raspberry-pi/

… can anyone tell me what I need to set or am missing to get into the next step and have the user (homeassistant) in the virtual environment?

Thanks in advance for any help…

Paulie

@Paulie, try looking here: https://docs.python.org/3/library/venv.html

It seems like maybe its not recognizing ‘.’ as a directory, so maybe try the full path.

Hi There,

I followed the instructions and am running into the following issue. Does anyone know how to solve this?

[Info] Install supervisor Docker container - homeassistant/armhf-hassio-supervisor:201
[Info] Install supervisor startup scripts
chmod: cannot access ‘/usr/sbin/hassio-supervisor’: No such file or directory
root@raspberrypi:/home/pi#

There’s a new version of the hassio_install.sh since hugh_man wrote his instructions. In the new version there’s a -m switch (-m raspberrypi4 if you’re installing on an rpi4), so you don’t need to edit the script. If you edited the script, maybe that is causing a problem and you could try the new version and/or use the switch instead?

@skynet01 @Codec303

First that is for all your contributions.

I am a noob with a new RPi4 and SSD etc coming tomorrow.
The newer release of “HassOS 3” with RPi4 support, and changes/upgrades sound great (esp for a noob like me to get started).

So… I am curious if anyone has experimented with the new “HassOS 3” on RPi4?
Is Raspbian OS still faster then the new “HassOS 3” on RPi4?

Also if going the new “HassOS 3” on RPi4 way, is there any way to make edits to use the SSD in some form or other?

I started a post with more details trying to get me started in the right direction considering these advancements and changes in these past 1-2 months:

Noob with New Rpi4 Install ?s Hangin Me Up - 2020

Thank you all for all of your hard work and help. I can’t wait to get going!
Geo

Hi, I’m afraid I have no used ‘HassOS’ in a long time as Raspbian has been working great for me, so I thought ‘if it ain’t broke, don’t fix it’ :slight_smile:

If I was starting from scratch again, I may give the new shiney ‘HassOS’ a try, but last time I tried ‘HassOS’ I had issues trying to get it to connect to a a MQTTS server with a self signed cert, there were some networking issues that I could not fix.

Good luck with whatever you choose to go with, if you are starting out ‘HassOS’ may be better as it’s aim is to offer an automated install, but I’ve not used it in over a year so I have no idea what it’s like now.

I was running it on Raspbian desktop but’s as it is not 64bit and the 64-bit raspbian kernel is still in testing on Pi4, I am testing it running on Manjaro XFCE on a USB-C 3.1 enclosure with a 120GB M.2 SATA SSD now as it is a 64bit OS so I can install VS Code add-on and it is running great so far and was so easy to set it up just by having the just the boot partition on the SD card and the just the root partition on the SSD and editing the cmdline.txt on the SD card to
root=/dev/sda1 rootfstype=ext4 rw ...
It was easier than Raspbian setup on USB boot.

You should work with identifiers, not just mount points. Otherwise every restart is a gamble, if something else comes first for /dev/sdx, it won’t boot.

Better use the PARTUUID. Like root=PARTUUID=54bacdxxx rootfstype=ext4 rw ...

Hey, that sounds interesting. So could you do a write-up of what you did?

Yes as long as you don’t have any other USB drives plugged in when rebooting it shouldn’t matter but I have done it now just to make sure it works every time.

Download Manjaro I got the XFCE edition as it is the fastest DE’s available and the most stable but it should be the same with the minimal if you don’t want a desktop OS.

Etch manjaro to SD card.

I Used MiniTool Partition Wizard Free to copy the root partition from SD card to the unpartitioned SSD.

Edit the cmdline.txt on the boot partition on the SD card to boot the SSD.

root=/dev/sda1 rootfstype=ext4 rw ...

Optional, as my monitor is old so I had to add this to config.txt on the SD card so it will use the native resolution as it was off the screen.

disable_overscan=1

overscan_left=30
overscan_right=30
overscan_top=16
overscan_bottom=16

hdmi_group=1
hdmi_mode=16

Place SD card and SSD on the Rpi4 boot it and go through the setup.

Once it is up and running get the PARTUUID for SSD.

sudo blkid

Edit boot cmdline.txt.

sudo nano /boot/cmdline.txt

root=PARTUUID=SSDUUID rootfstype=ext4 rw ...

Save it and reboot to make sure it works.

Update Manjaro.
I had to update the package mirror list with Manjaro-ARM-xfce-rpi4-19.12.1 Accidentally removed /usr/share/icons trying to install a cursor. How to recover the folder? - Support - Manjaro Linux Forum

sudo pacman -U https://ftp-osl.osuosl.org/pub/manjaro-arm/repo/stable/core/aarch64/pacman-mirrorlist-20200217-1-any.pkg.tar.xz

Update the Kernel.
sudo pacman -Syu linux-rpi4-mainline

Reboot.
Check kernel updated 5.5.2.1.
cat /proc/version

Install any other programs you need/want if using Manjaro XFCE.

Install dependencies.

 apparmor
 avahi
 ca-certificates
 curl
 dbus
 docker
 jq
 socat

reboot.

Set up docker.

sudo systemctl start docker
sudo systemctl enable docker

Check docker.

sudo docker version

Reboot again.
Make sure docker is running.

sudo docker version

Install Hassio

sudo curl -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh" | bash -s -- -m raspberrypi4-64

I can’t get hassio also ,can somebody help me

sudo -i
apt-get update
apt-get install -y software-properties-common apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat
systemctl disable ModemManager
curl -fsSL get.docker.com | sh

apt-get update

wget https://download.docker.com/linux/raspbian/gpg

root@raspberrypi:~# apt-key add gpg
OK

echo "deb https://download.docker.com/linux/raspbian stretch stable " | tee -a /etc/apt/sources.list.d/docker.list

apt-get update

apt-get -y install docker-ce

dpkg: error processing package aufs-dkms (–configure):
installed aufs-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
aufs-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

ystemctl start docker && systemctl enable docker

curl -sL “https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh” >> hassio_install.sh
sudo bash hassio_install.sh -m raspberrypi4

root@raspberrypi:~# sudo bash hassio_install.sh -m raspberrypi4
ModemManager.service enabled
[Warning] ModemManager service is enabled. This might cause issue when using serial devices.
[Info] Install supervisor Docker container
[Info] Install supervisor startup scripts
Created symlink /etc/systemd/system/multi-user.target.wants/hassio-supervisor.service → /etc/systemd/system/hassio-supervisor.service.
[Info] Install AppArmor scripts
Created symlink /etc/systemd/system/multi-user.target.wants/hassio-apparmor.service → /etc/systemd/system/hassio-apparmor.service.
[Info] Run Hass.io

root@raspberrypi:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2d1ee939c70c homeassistant/raspberrypi4-homeassistant:landingpage “/run.sh” 10 seconds ago Up 8 seconds homeassistant
92def09042fe homeassistant/armv7-hassio-dns:1 “coredns -conf /conf…” 19 seconds ago Up 17 seconds hassio_dns
fc7d97c080a2 homeassistant/armv7-hassio-supervisor “/bin/entry.sh pytho…” 33 seconds ago Up 31 seconds hassio_supervisor

root@raspberrypi:~# docker attach --sig-proxy=false 2d1ee939c70c
^C

root@raspberrypi:~# docker logs fc7d97c080a2
20-03-01 01:01:51 INFO (MainThread) [main] Initialize Hass.io setup
20-03-01 01:01:51 INFO (MainThread) [hassio.docker.network] Can’t find Hass.io network, create new network
20-03-01 01:01:52 INFO (MainThread) [hassio.bootstrap] Create Home Assistant configuration folder /data/homeassistant
20-03-01 01:01:52 INFO (MainThread) [hassio.bootstrap] Create Hass.io SSL/TLS folder /data/ssl
20-03-01 01:01:52 INFO (MainThread) [hassio.bootstrap] Create Hass.io Add-on data folder /data/addons/data
20-03-01 01:01:52 INFO (MainThread) [hassio.bootstrap] Create Hass.io Add-on local repository folder /data/addons/local
20-03-01 01:01:52 INFO (MainThread) [hassio.bootstrap] Create Hass.io Add-on git repositories folder /data/addons/git
20-03-01 01:01:52 INFO (MainThread) [hassio.bootstrap] Create Hass.io temp folder /data/tmp
20-03-01 01:01:52 INFO (MainThread) [hassio.bootstrap] Create Hass.io backup folder /data/backup
20-03-01 01:01:52 INFO (MainThread) [hassio.bootstrap] Create Hass.io share folder /data/share
20-03-01 01:01:52 INFO (MainThread) [hassio.bootstrap] Create Hass.io DNS folder /data/dns
20-03-01 01:01:52 INFO (SyncWorker_0) [hassio.docker.supervisor] Attach to Supervisor homeassistant/armv7-hassio-supervisor with version 201
20-03-01 01:01:52 INFO (SyncWorker_0) [hassio.docker.supervisor] Connect Supervisor to Hass.io Network
20-03-01 01:01:53 INFO (MainThread) [main] Setup HassIO
20-03-01 01:01:53 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.systemd1 - /org/freedesktop/systemd1
20-03-01 01:01:53 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.hostname1 - /org/freedesktop/hostname1
20-03-01 01:01:53 WARNING (MainThread) [hassio.dbus.rauc] Host has no rauc support. OTA updates have been disabled.
20-03-01 01:01:53 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.NetworkManager - /org/freedesktop/NetworkManager/DnsManager
20-03-01 01:01:53 INFO (MainThread) [hassio.host.info] Update local host information
20-03-01 01:01:53 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/hostname1
20-03-01 01:01:53 INFO (MainThread) [hassio.host.services] Update service information
20-03-01 01:01:53 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ListUnits on /org/freedesktop/systemd1
20-03-01 01:01:54 INFO (MainThread) [hassio.host.network] Update local network DNS information
20-03-01 01:01:54 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/NetworkManager/DnsManager
20-03-01 01:01:54 INFO (MainThread) [hassio.host.apparmor] Load AppArmor Profiles: {‘hassio-supervisor’}
20-03-01 01:01:54 INFO (MainThread) [hassio.host.services] Reload local service hassio-apparmor.service
20-03-01 01:01:54 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ReloadOrRestartUnit on /org/freedesktop/systemd1
20-03-01 01:01:54 INFO (MainThread) [hassio.dns] No CoreDNS plugin Docker image homeassistant/armv7-hassio-dns found.
20-03-01 01:01:54 INFO (MainThread) [hassio.dns] Setup CoreDNS plugin
20-03-01 01:01:54 INFO (MainThread) [hassio.updater] Fetch update data from https://version.home-assistant.io/stable.json
20-03-01 01:01:54 INFO (SyncWorker_0) [hassio.docker.interface] Pull image homeassistant/armv7-hassio-dns tag 1.
20-03-01 01:02:02 INFO (MainThread) [hassio.dns] CoreDNS plugin now installed
20-03-01 01:02:02 INFO (MainThread) [ha

Someone is working on an automated solution for all this soon, in the meantime I’ve documented the manual steps here: https://github.com/home-assistant/operating-system/issues/164#issuecomment-602145682

I note that there is still no Raspberry Pi 4 option for direct boot to SSD, and it doesn’t look imminent either. You have to use an SD+SSD configuration.

1 Like

I have got HassOS working on a SSD on Rpi4 but using the SD card to point to the SSD.

I etched the img to the SD card and SSD but just did the first boot/install on the SD card to get it working once done used linux to expand the sda8 on the SSD using gparted and then copy the hassos-data folders using the cmd line.

Then added

root=/dev/sda rootfstype=ext4 rw

to the cmdline.txt on the SD card once done loaded it into the rpi4 and booted it and it worked but had a few errors in the log and on reboot the supervisor was blank so I run the core rebuild cmd as I got it hooked up to a monitor and keyboard and it was back and have installed 6 addons and rebooted it a lot and it seems to be good so far but not sure if an update will break it as I changed the cmdline.txt and broke the supervisor again but the rebuild cmd fixed it.

1 Like

…to quote myself… :wink:

I’m not sure, that the installation or better writing of the whole image to ssd is a good way. In theory, it should be the same, regardless if you write it on the SSD versus using rsync after the first boot to clone that exact partition.

I for one always use the rsyncmethod, as it never gave me a problem, where the image writing was mostly with errors afterwards.

Yes as I am just testing it I did change it to use the PARTUUID and is all good and as I am new to Linux and it commands only started towards the end of last year when I got this rpi4 I still got a lot to learn.

Thanks for this great guide, works like a charm!
I did spend three hours afterwards trying to get my RaspBee to work with deConz, for anyone attempting, these steps did the job for me: (taken from Docker)

Configuring Raspbian for RaspBee

Raspbian defaults Bluetooth to /dev/ttyAMA0 and configures a login shell over serial (tty). You must disable the tty login shell and enable the serial port hardware, and swap Bluetooth to /dev/S0, to allow RaspBee to work properly under Docker.

To disable the login shell over serial and enable the serial port hardware:

  1. sudo raspi-config
  2. Select Interfacing Options
  3. Select Serial
  4. “Would you like a login shell to be accessible over serial?” Select No
  5. “Would you like the serial port hardware to be enabled?” Select Yes
  6. Exit raspi-config and reboot

In addition I added this line to my config.txt (below the two lines suggested in the deConz setup instructions)
dtoverlay=uart0-full

1 Like

Hi Geoff

After getting told that what I did with ubuntu was wrong, I’ve attempted your procedure with manjaro xcfe instead.
I can’t get it working, the kernel still says:

Linux version 4.19.97-1-MANJARO-ARM (root@aarch64) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Fri Jan 24 19:39:39 UTC 2020

I did follow the link on where to get an updated mirrorlist, and found the latest mirror list, and installed it, and when I do the kernel update it says it’s 5.11, but I still see some 404 errors when I try to do updates and stuff, and the docker doesn’t work.

Any ideas?

I am not using Manjaro anymore I am using xUbuntu Server 18.04.4 from here https://github.com/TheRemote/Ubuntu-Server-raspi4-unofficial as it is a lot more stable.

1 Like