WBA image setup instructions - overthesun/simoc-sam GitHub Wiki
Burn the standard image
- Open Raspberry Pi Imager
- Select Raspberry Pi Zero 2
- Select default image (64bit)
- Select SD card (16+ GB)
- Edit configuration
- Enter WiFi details (can skip if you have ethernet)
- Enter hostname (locationN, e.g. lunares1, sam2)
- Burn image on the SD card
- Make sure the sensor is array is assembled
- Insert the SD in the RPi Zero 2 and power it on
Set up image
- SSH into the RPi Zero 2
- Set up repo
git clone https://github.com/overthesun/simoc-sam.git
cd simoc-sam
git switch wba
source bash_aliases
- Set up SIMOC Live
sam initial-setup
sam create-venv
sudo raspi-config
- enable I2C (under interfaces)
- Set up sensors
sam sensors-info
- copy MQTT Certs (change the hostname)
sam setup-sensors
sam services-info
- Set up SIMOC Web
- On your PC (Linux/WSL)
git clone https://github.com/overthesun/simoc-web.git
cd simoc-web
git fetch origin direct-to-live
git switch direct-to-live
python3 simoc-web.py setup (Ctrl+c if it wants to copy the dir)
scp -r dist [email protected]:/home/pi
- On the RPi Zero 2
sudo mv /home/pi/dist /var/www/simoc
- (Optional?) Fix permissions if the dashboard doesn't work
sudo chown -R www-data:www-data /var/www/simoc
sudo chmod -R o+rX /var/www/simoc
sam setup-nginx
sam setup-siobridge
sam services-info
Create the image
- Double check that everything work (after reboots too)
- check that the MQTT data are received from the ThingsBoard
- check that the SIMOC dashboard works
- check that
sam sensors-info doesn't give any error
- Remove the SD and plug it into the PC
- (Optional) mount the SD to remove the logs in
/home/pi/logs
sudo dd if=/dev/mmcblk0 of=wba.img conv=sparse bs=512 status=progress
- Shrink the image
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
chmod +x pishrink.sh
sudo ./pishrink.sh wba.img
- Upload the image to GDrive