Portable setup and deployment scripts for Raspberry Pi. For ease of development, most of this was edited on a Raspberry Pi 5 desktop environment (vscode) and tested locally, but the finishing touches had to be done on the pi zero, so these scripts were born.
Location: Project root
Runs on: Dev Raspberry Pi with display/speaker installed.
Purpose: Guided install for apt deps, venv, Python packages, and optional systemd service
./install_pi.sh
./install_pi.sh --with-service
./install_pi.sh --no-serviceWhat it does:
- Installs apt packages from
requirements/pi-apt.txt - Creates
.venvwith--system-site-packages - Installs
requirements.txt - Runs runtime verification
- Optionally installs and enables
notemachine.service
For service installs, runtime module/arguments are configured in /etc/default/notemachine.
Location: scripts/pi/
Runs on: Raspberry Pi
Purpose: Sets up Python virtual environment and installs dependencies
IMPORTANT: Install system packages first:
sudo apt install python3-aubio python3-numpy python3-pil python3-dev portaudio19-devThen run bootstrap:
./scripts/pi/bootstrap_pi.shWhat it does:
- Creates
.venvwith--system-site-packages(required for Pi apt packages) - Upgrades pip, wheel, and setuptools
- Installs remaining dependencies from
requirements.txt
Why --system-site-packages? On Raspberry Pi, especially Pi Zero 2 W, pip builds of aubio/numpy often fail or are very slow. Using apt packages with --system-site-packages venv is the reliable approach.
Location: scripts/pi/
Runs on: Raspberry Pi
Purpose: Installs Whisplay HAT driver (LCD, audio codec, RGB LED support)
bash scripts/pi/install_whisplay_driver.shRequires reboot after install. This may be expanded to support other hardware (there's a Pimoroni Pirate Radio display hat over here) but for now Whisplay only.
Location: scripts/pi/
Runs on: Raspberry Pi
Purpose: Re-renders and installs systemd service from template
bash scripts/pi/refresh_service.sh
bash scripts/pi/refresh_service.sh --no-restartUpdates service definition and optionally restarts it.
Location: scripts/pi/
Runs on: Raspberry Pi
Purpose: Validates Python dependencies and runtime environment
python scripts/pi/verify_runtime.pyTest pitch detection accuracy by playing a tone and immediately listening for it. Do not operate with partner/spouse/roommates/coworkers nearby unless they are very patient.
python scripts/dev/looptest.py --labels "C4,D4,E4,F4,G4,A4"Sweep chromatic range to test detection reliability:
python scripts/dev/wind_tuner.pyUse notemachine.toml.example as your base.
Runtime apps (notemachine.notemachine, notemachine.tonewatch) load config from:
--config /path/to/notemachine.tomlNOTEMACHINE_CONFIG=/path/to/notemachine.toml./notemachine.toml~/.config/notemachine/notemachine.toml/etc/notemachine.toml
Service installs use /etc/notemachine.toml and /etc/default/notemachine.