Everything a young witch or wizard needs to get themselves set up.
This does need setting up as a google service account, your google calendars shared with this account, etc. I'll put instructions here.
- Download and install the Raspberry Pi Imager.
- Write
Raspberry Pi OS Lite
to an SD card, do not boot just yet. - Set up the Pi for wireless.
- Set up SSH for headless.
- Put the SD card in the Pi and boot.
- Some generic initial setup tasks, via
ssh [email protected]
raspi-config
to adjust passwordraspi-config
to adjust hostnamesudo apt-get update -y
sudo apt-get install python3-pip -y
sudo apt-get upgrade -y
- Some IoT setup tasks, still via
ssh [email protected]
- We will be using an
iot
account to execute our code, and thepi
account if we need terminal access. sudo adduser iot
sudo adduser iot sudo
su - iot
to switch to the new usersudo raspi-config
to configure auto-login
- We will be using an
- Reboot,
sudo reboot
- Create a folder for the code,
ssh iot@<hostname>.local 'mkdir /home/iot/src'
- Copy the application code,
scp -r ./* iot@<hostname>.local:/home/iot/src
- Install the dependencies
ssh iot@<hostname>.local 'sudo pip3 install -r src/diagon_alley/pi_requirements.txt'
- Start the program on login
ssh iot@<hostname>.local
sudo nano /home/iot/.bashrc
- Add
cd /home/iot/src
as the final line - Add
sudo python3 main.py <led_count> <calendar> ... <calendar>
as the final line - Save and close
sudo visudo
- Add
iot ALL = NOPASSWD: /usr/bin/python3, /usr/sbin/reboot
as the final line - Save, close and reboot