This document covers how to rebuild the Scripps Sandbox front desk Raspberry Pi if the device fails or needs to be replaced.
This repo contains the application code and most software dependencies. Sensitive credentials and tokens are not stored in Git and must be restored separately.
- runs the Sandbox front desk / check-in app
- looks up Sandbox users and waivers
- shows upcoming public-facing Sandbox reservations from Google Calendar
This repository includes:
- front desk application code
- Python dependencies in
requirements.txt - the calendar fetcher script in
src/sandbox_calendar.py - the front screen UI in
src/MainPage.py
These items must be restored from 1Password or another secure source:
src/creds.json- service account credential for Sandbox users / waivers lookups
src/calendar_creds.json- OAuth desktop credential for Google Calendar access
fabtoken.txt- Fabman token, if still used by this setup
These files are local-only and can be recreated:
src/token.json- generated after Google Calendar authorization
src/upcoming_events.json- generated cache of upcoming events
You will need:
- a new Raspberry Pi with Raspberry Pi OS installed
- network access
- access to the
sandboxuser account, or whatever account will run the kiosk - access to the credentials stored in 1Password
- access to the GitHub repo:
https://github.com/ScriptsSandbox/Check-In
Boot the Pi, connect it to the network, and update the system:
sudo apt update
sudo apt upgrade -y
sudo apt install -y python3-venv gitIf SSH is needed, enable it as part of your normal Pi setup.
cd ~
git clone https://github.com/ScriptsSandbox/Check-In.git
cd Check-Inpython3 -m venv .venv
source .venv/bin/activatepython -m pip install --upgrade pip
python -m pip install -r requirements.txtRestore these files into the repo:
~/Check-In/src/creds.json
~/Check-In/src/calendar_creds.json
~/Check-In/fabtoken.txt
Notes:
src/creds.jsonis the existing service account credential used for users / waiverssrc/calendar_creds.jsonis the Google OAuth desktop credential used for reading the Sandbox Staff Calendar- do not overwrite one with the other
Run the calendar fetcher once:
cd ~/Check-In
source .venv/bin/activate
python src/sandbox_calendar.pyThis should open a Google authorization flow in the browser.
After successful auth, it should create:
~/Check-In/src/token.json
~/Check-In/src/upcoming_events.json
You can verify the cache file with:
cat ~/Check-In/src/upcoming_events.jsonAdd this cron job for the sandbox_calendar.py refresh:
*/5 * * * * cd /home/sandbox/Check-In && /home/sandbox/Check-In/.venv/bin/python src/sandbox_calendar.py >> /home/sandbox/Check-In/calendar_refresh.log 2>&1To edit crontab:
crontab -eTo verify:
crontab -lcd ~/Check-In/src
source ../.venv/bin/activate
./runCheck the following:
- the main front desk screen loads
- QR flow works
- No ID button works
- users / waivers lookup works
- upcoming events card appears
- upcoming events are being pulled from Google Calendar
To manually refresh the calendar cache:
cd ~/Check-In
source .venv/bin/activate
python src/sandbox_calendar.pyIf the kiosk is supposed to launch automatically on boot, restore whatever startup method is being used on the current Pi.
This may be one of:
- LXDE / desktop autostart
- a systemd service
- a cron
@rebootjob - another local startup script
Document the current method on the live Pi and copy it here when confirmed.
Usually this means you are not running inside the virtual environment.
Use:
cd ~/Check-In
source .venv/bin/activateThen rerun the command.
This means the calendar script is pointing at the wrong credential file.
src/creds.jsonis a service account credentialsrc/calendar_creds.jsonmust be an OAuth desktop app credential
The front screen reads src/upcoming_events.json, not Google Calendar directly.
Check:
- whether
src/sandbox_calendar.pyis running successfully - whether cron is installed and active
- whether
src/upcoming_events.jsonhas a recentgenerated_attimestamp
Delete the generated token and rerun the calendar script:
rm ~/Check-In/src/token.json
cd ~/Check-In
source .venv/bin/activate
python src/sandbox_calendar.py- Pi boots and connects to network
- repo cloned to
~/Check-In - virtual environment created
- requirements installed
-
src/creds.jsonrestored -
src/calendar_creds.jsonrestored -
fabtoken.txtrestored if needed -
src/token.jsonregenerated -
src/upcoming_events.jsongenerated - cron job installed
- app launches
- front desk screen works
- calendar events appear
- auto-start on boot restored
See the 1Password secure note:
Sandbox Front Desk Pi Recovery
That note should contain:
- secret files / credentials
- file placement notes
- any tokens or account details that should not live in Git