Hello everyone,
I decided to migrate from hassbian to Hass.io but on my conditions.
Very important for me was be able to boot from SSD, of course good microSD card like sandisk extreme pro will handle also great, but SSD drive will be much more durable.
Also had some scripts on hassbian and didn’t work on Hass.os that’s why i decided to run Hass.io on raspbian from SSD Drive.
There are few steps to make everything work just like You expect.
- Download latest Raspbian Lite and prepare bootable microSD card with balena etcher, after everything is complete create on boot partition empty file ssh to enable ssh login
- Boot the system, go to raspi-config and enable in interfacing options 1 Wire and I2C
- Reboot system, check is system availaible from SSH
- Prepare with balena etcher bootable USB SSD drive and also create empty ssh file on boot partition
- Plug the usb drive to Raspberry, list partitions fdisk -l to make sure that your USB SSD drive is visible in system
- type nano /boot/cmdline.txt and change root=PARTUUID to root=/dev/sd2
- Reboot system, if You did fine those steps You should boot from SSD
You should check partition size fdisk -l and it is not full size of pchysical size of drive - Before installing Hass.io you have to expand filesystem but on SSD to make it work You have to do:
cp /usr/bin/raspi-config ~
sed -i ‘s/mmcblk0p/sda/’ ~/raspi-config
sed -i ‘s/mmcblk0/sda/’ ~/raspi-config
~/raspi-config
- After system reboot when You check partition size fdisk -l You will se full size of partition
Now standard command
Now, when system is booted from USB SSD once again enable I2C and 1Wire in raspi-config
After reboot check if You Can see I2C devices → apt-get install i2c-tools → 2cdetect -y 1
Update system before installing Docker and Hass.IO
apt-get update
apt-get upgrade
Here are steps to install Docker and then install Hass.io so I will not duplicate it
- How to run commandline scripts on Hass.io just like on hassbian ?
Basicly Hass.io and Raspbian are separated systems but theres no problem to run shell command from Hass.io on Raspbian.
Log into home assistant, install OpenSSH, set SSH port for ex. 22222 and start addod - Log into Hass.io using SSH and port 22222 and run those commands
mkdir /config/.ssh
It will create folder inside home assistant folder
ssh-keygen
and as path for save keys set /config/.ssh/id_rsa
Save it without password !
Now You have to share saved keys with raspbian with the following command
ssh-copy-id -i /config/.ssh/id_rsa [TARGET USER]@[TARGET IP]
Once when it’s done You Just have to create shell_command in home assistant
gammu_sms: ssh -i /config/.ssh/id_rsa -o “StrictHostKeyChecking=no” [email protected] ’ gammu sendsms TEXT “{{ sms_number }}” -text “{{ sms_topic }}” ’
It’s working great even when I create variables in home assistant and system is reading values from input text !
Enabling I2C and 1 Wire was very tricky, long time couldn’t understand why Raspbian can’t list I2C devices, but it was issue with SSD drive. In Raspberry Pi 3 You can boot even without SD Card, but on Raspberry pi 4 system is booting from microSD Card for a short moment, and rest part of booting is from USB SSD Drive, but before it’s booting from USB SSD it’s takeing boot configuration from SD Card, so it;s very importand to enable I2C and 1 Wire it in raspi-config when system is booted from microSD.
I Think it’s only matter of time and when native boot from USB will be added to Rpi4 It will be easier.
I Home it will help all hassbian users to migrate to better Hass.io !