Clean up server architecture for multi-instance deployment

- Remove main_cycling.py, main_multi.py, main_release.py (single main.py is canonical)
- Update setup.sh to read SERVICE_NAME and PORT from .env
- Update env.example with SERVICE_NAME and PORT for multi-instance support
- Fix server-csi to try rpicam-still before libcamera-still (Debian Trixie)

Deploy pattern: clone repo twice, configure each .env, run setup.sh
Each instance gets its own systemd service and install directory.
This commit is contained in:
Alex Kazaiev
2025-12-30 11:09:40 -06:00
parent 844502b4a1
commit e92b5a560b
6 changed files with 99 additions and 707 deletions

View File

@@ -6,12 +6,20 @@
# API Key for authentication (generate with: python3 -c 'import secrets; print(secrets.token_urlsafe(32))')
API_KEY=your-secret-key-here
# Camera identifier (used in events)
# Camera identifier (used in events and API responses)
CAMERA_ID=basement
# ============ Service Settings ============
# Service name for systemd (allows multiple instances)
SERVICE_NAME=vixy-vision-basement
# Port to run on (each instance needs unique port)
PORT=8443
# ============ Camera Settings ============
# Camera device index (0 = first USB camera)
# Camera device index (0 = /dev/video0, 2 = /dev/video2, etc.)
CAMERA_INDEX=0
# Resolution (camera will use closest supported)
@@ -40,8 +48,8 @@ MOTION_INTERVAL=0.5
# ============ Event Collector ============
# URL to POST motion events to (on Mac mini)
COLLECTOR_URL=http://192.168.1.50:8780/events
# URL to POST motion events to (collector on Mac mini)
COLLECTOR_URL=http://macmini.local:8780/events
# API key for collector (optional)
COLLECTOR_API_KEY=