Skip to content

Latest commit

 

History

History
44 lines (37 loc) · 1.9 KB

File metadata and controls

44 lines (37 loc) · 1.9 KB

Diagon-Alley

Everything a young witch or wizard needs to get themselves set up.

Google Service Installation

This does need setting up as a google service account, your google calendars shared with this account, etc. I'll put instructions here.

Raspberry Pi Setup

  1. Download and install the Raspberry Pi Imager.
  2. Write Raspberry Pi OS Lite to an SD card, do not boot just yet.
  3. Set up the Pi for wireless.
  4. Set up SSH for headless.
  5. Put the SD card in the Pi and boot.
  6. Some generic initial setup tasks, via ssh [email protected]
    • raspi-config to adjust password
    • raspi-config to adjust hostname
    • sudo apt-get update -y
    • sudo apt-get install python3-pip -y
    • sudo apt-get upgrade -y
  7. Some IoT setup tasks, still via ssh [email protected]
    • We will be using an iot account to execute our code, and the pi account if we need terminal access.
    • sudo adduser iot
    • sudo adduser iot sudo
    • su - iot to switch to the new user
    • sudo raspi-config to configure auto-login
  8. Reboot, sudo reboot

Application Installation

  1. Create a folder for the code, ssh iot@<hostname>.local 'mkdir /home/iot/src'
  2. Copy the application code, scp -r ./* iot@<hostname>.local:/home/iot/src
  3. Install the dependencies
    • ssh iot@<hostname>.local 'sudo pip3 install -r src/diagon_alley/pi_requirements.txt'
  4. Start the program on login
    1. ssh iot@<hostname>.local
    2. sudo nano /home/iot/.bashrc
    3. Add cd /home/iot/src as the final line
    4. Add sudo python3 main.py <led_count> <calendar> ... <calendar> as the final line
    5. Save and close
    6. sudo visudo
    7. Add iot ALL = NOPASSWD: /usr/bin/python3, /usr/sbin/reboot as the final line
    8. Save, close and reboot