Background
Over the last few weeks, I have rebuilt my Docker lab and Home Assistant set up a few times. The heart of the setup is a Raspberry 4. Finally, all the hardware I ordered has arrived and I have a bit of time to rebuild my setup. Hopefully, I won't need to rebuild for a while.Plan
This time I want to set up a Rasberry Pi 4 Model B (2GB) with Raspbain Buster then configure the Pi to use a 1 TB SSD. Since the Rasberry Pi 4 doesn't currently support booting from an SSD, I will use the workaround from James Chambers. Once the Rasberry Pi is set up and a basic configuration is done, I will then install IOTstack from Graham Garner. This will help me set up Docker, HASS.io, Portainer, Mosquitto, and Tasmoadmin.What I am hoping to get out of this is a stable platform for learning and experimenting with Docker, Home Automation, Internet of Things, and electronics.
Notes
Setting up the Raspberry Pi
- Used balenaEtcher to flash Raspbian Buster with desktop to an 8 Gig SD Card
- Used balenaEtcher to flash Raspbian Buster with desktop to a 1 TB SSD
- Plugged in a monitor, keyboard, mouse, network cable and applied power
- I waited for about 5 minutes for the system to run through its first-time power-up.
- created an empty file named ssh and placed it the boot folder for both SD and SSD
- created the file wpa_supplicant.conf and placed it in the boot folder for both SD and SSD
- Set basic config values for keyboard
- changed the pi default password
- skipped the update
- sudo fdisk /dev/sda
- set the SSD PARTUUID to d34db33f
- sudo blkid
- made backup of /boot/cmdline.txt
- edited /boot/cmdline.txt to use the PARTUUID that was set earlier
- sudo reboot
- verified the SSD is being used
- findmnt -n -o SOURCE /
- updated /etc/fstab
- changed the PARTUUID to d34db33f
- sudo reboot
- resizing filesystem
- delete the partition /dev/sda2
- create a new partition with a first sector at 532480
- sudo resize2fs /dev/sda2
- This takes a while
- df -h
- verify /dev/root shows a size value close to the size of the drive
- sudo reboot
Configuring the Raspberry Pi
- set Hostname
- boot to CLI
- auto login: uncheck mark
- sudo reboot
- verified Raspberry Pi configuration
- verified that I can ssh into the raspberry pi
- sudo apt update
- sudo apt upgrade
Install IOTstack
- ensure git is installed
- sudo apt install git
- clone IOTstack
- git clone https://github.com/gcgarner/IOTstack.git ~/IOTstack
- run menu
- cd IOTstack
- ./menu.sh
- installed docker
- installed Hass.io
- installed Portainer
- installed Mosquitto
- installed tasmoadmin
- docker-compose up -d
References
YouTube: Andreas Spiess 'Boot a Raspberry Pi4 with an SSD to make it reliable and fast'
YouTube: Andreas Spiess '#255 Node-Red, influxDB, and Grafana Tutorial on a Raspberry Pi'
YouTube: Andreas Spiess '#295 Raspberry Pi Server base on Docker, with VPN, Dropbox, Influx, Granfana, etc.'