Prefer slides? View the Workflow Slides for a visual walkthrough.
GitHub repo lives on your LOCAL computer. Copy files to Pi as needed.
┌─────────────────────────────────┐
│ YOUR LOCAL COMPUTER │
│ │
│ 📁 smart-objects-cameras/ │
│ ├── person_detector.py │
│ ├── fatigue_detector.py │
│ ├── gaze_detector.py │
│ ├── discord_bot.py │
│ ├── utils/ │
│ ├── docs/ │
│ └── README.md │
│ │
│ ✏️ Edit code here │
│ 🧪 Test logic here │
│ 📝 Commit to GitHub here │
└─────────────────────────────────┘
│
│ scp (copy files)
▼
┌─────────────────────────────────┐
│ RASPBERRY PI (orbit/gravity/ │
│ horizon) │
│ │
│ 📁 ~/oak-projects/ │
│ ├── person_detector.py ◄─── Only files you need
│ ├── discord_notifier.py │
│ ├── .env ◄───────────────── Created on Pi, never in GitHub!
│ ├── latest_frame.jpg │
│ └── camera_status.json │
│ │
│ ▶️ Run code here │
│ 📸 Camera connected here │
└─────────────────────────────────┘
On your local computer:
# Clone the repository
git clone https://github.com/[your-org]/smart-objects-cameras.git
cd smart-objects-camerasOn the Raspberry Pi:
# SSH into Pi
ssh orbit # or gravity, or horizon
# Create project directory
mkdir -p ~/oak-projectsFrom your local computer (not on the Pi!):
# Navigate to repo
cd ~/path/to/smart-objects-cameras
# Copy the files you need
scp person_detector_with_display.py orbit:~/oak-projects/
scp discord_notifier.py orbit:~/oak-projects/
# For fatigue/gaze, also copy utils
scp -r utils orbit:~/oak-projects/Replace orbit with gravity or horizon for other Pis.
On the Raspberry Pi:
# SSH in
ssh orbit
# Check if .env already exists (it should!)
ls ~/oak-projects/.env
# Edit the existing .env file
nano ~/oak-projects/.envIf .env already exists, add ONLY your personal bot token at the bottom:
# Personal DM Bot (optional - for private notifications to you only)
DISCORD_USER_ID=your_discord_user_id_here
DISCORD_DM_BOT_TOKEN=your_dm_bot_token_hereWhat's already configured (DO NOT MODIFY):
# These are already configured on each Pi - don't change them!
DISCORD_WEBHOOK_URL=... # Shared webhook for class
DISCORD_APPLICATION_ID=... # Camera bot config
DISCORD_PUBLIC_KEY=... # Camera bot config
DISCORD_BOT_TOKEN=... # OrbitBot/GravityBot/HorizonBot tokenIf .env doesn't exist (unlikely), create it with all tokens:
# Discord Webhook (for person detection --discord notifications)
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/YOUR_WEBHOOK_URL_HERE
# Discord Bot Configuration (for public camera bot - ask instructor)
DISCORD_APPLICATION_ID=ask_instructor
DISCORD_PUBLIC_KEY=ask_instructor
DISCORD_BOT_TOKEN=ask_instructor
# Personal DM Bot (optional - for private notifications)
DISCORD_USER_ID=your_discord_user_id_here
DISCORD_DM_BOT_TOKEN=your_dm_bot_token_hereSave (Ctrl+O, Enter, Ctrl+X) and secure:
chmod 600 ~/oak-projects/.envOn the Raspberry Pi:
# SSH in
ssh orbit
# Activate environment
activate-oak
# Navigate to project
cd ~/oak-projects
# Run your script
python3 person_detector_with_display.py --displayEdit code on your LOCAL computer:
# On your laptop
cd ~/path/to/smart-objects-cameras
nano person_detector_with_display.py # or use VS Code
# Make your changes...Copy updated file to Pi:
# Still on your local computer
scp person_detector_with_display.py orbit:~/oak-projects/Run updated code on Pi:
# SSH to Pi
ssh orbit
# Run updated script
activate-oak
cd ~/oak-projects
python3 person_detector_with_display.py --displayCopy these:
person_detector_with_display.py(orperson_detector.py)discord_notifier.py(if using --discord flag)
Copy these:
fatigue_detector.pyutils/folder (entire directory)discord_notifier.py(if using Discord)
Copy these:
gaze_detector.pyutils/folder (entire directory)discord_notifier.py(if using Discord)
Copy these:
discord_bot.py(public camera bot)discord_dm_notifier.py(personal DM bot)
# DON'T DO THIS ON THE PI:
git clone https://github.com/.../smart-objects-cameras.gitWhy: Unnecessary files, risk of committing .env to GitHub
# You edit on local computer...
# ... but forget to scp to Pi
# ... Pi still runs old version!Fix: Always scp after editing
git add .env # DON'T!Why: Contains secret tokens that would be publicly visible
scp file.py orbit:~/oak-projects/scp -r utils orbit:~/oak-projects/scp file1.py file2.py file3.py orbit:~/oak-projects/ssh orbit "ls ~/oak-projects/"hostname # Shows 'orbit'/'gravity'/'horizon' on Pi
# Shows your laptop name on local computerInstead of using scp, you can use VS Code Remote SSH to work directly on the Pi:
- Install "Remote - SSH" extension in VS Code
- Connect to Pi:
Ctrl+Shift+P→ "Remote-SSH: Connect to Host" →orbit - Open folder:
/home/yourusername/oak-projects - Edit files directly on Pi (they save immediately to the Pi)
Pros: No need to scp after every change - edits save directly to Pi
Cons: None! This is actually the recommended workflow
- Open two VS Code windows:
- Window 1: Local repo on your laptop
- Window 2: Remote connection to Pi (
~/oak-projects/)
- Drag files from local window to remote window
- Or copy/paste files between windows
This is often easier than scp commands!
| Action | Where | Command |
|---|---|---|
| Clone repo | Local computer | git clone ... |
| Edit code | Local computer | Use your favorite editor |
| Copy files | Local computer | scp file.py orbit:~/oak-projects/ |
| Create .env | Raspberry Pi | nano ~/oak-projects/.env |
| Run scripts | Raspberry Pi | python3 script.py |
| Commit changes | Local computer | git add, git commit, git push |
Remember: Repo on laptop, files on Pi, run on Pi!