How cosbif/medicam-server works
Medicam Server is a Radxa camera backend with a protected local HTTP API and an always-available BLE provisioning service. The main workflow is owner app → BLE QR-based authorization and Wi-Fi setup → local authenticated API → recording and media access; companion capabilities include camera preview, health diagnostics, version reporting, storage retention, and signed OTA. Edges reflect excerpted calls or explicit README workflow statements; deployment and service-tunnel behavior is documented, but implementation wiring not shown here is omitted.
Main entry points: routes.py HTTP API · diagnostics.py Health and tests · camera.py Camera recording · update_control.py Update coordination
Components 17
Device access
- BLE provisioning
app/bluetooth_provision.py - Device auth and Wi-Fi
app/utils.py - HTTP API
app/routes.py - API server
app/main.py
Capture and media
- Camera recording
app/camera.py - Audio capture
app/audio.py - Live preview
app/preview.py - Media library
app/utils.py
Operations
- Storage policy
app/storage_manager.py - Health and tests
app/diagnostics.py - Version reporting
app/version_info.py - Update coordination
app/update_control.py - Signed OTA
app/updater.py - BLE service manager
app/manage_ble.py - Service SSH tunnel
deploy/systemd/medicam-service-tunnel.service - Privileged OTA activator
scripts/medicam_ota_activate.py
Other components
- Owner app
Connections 27
- Owner app → BLE provisioning: provisions device
README.md - BLE provisioning → Device auth and Wi-Fi: uses device state
app/bluetooth_provision.py - Owner app → HTTP API: uses local API
README.md - API server → HTTP API: serves routes
app/main.py - HTTP API → Camera recording: controls capture
app/routes.py - HTTP API → Audio capture: uses audio
app/routes.py - HTTP API → Health and tests: requests health
app/routes.py - HTTP API → Live preview: serves preview
app/routes.py - HTTP API → Media library: serves media
app/routes.py - HTTP API → Storage policy: reads policy
app/routes.py - HTTP API → Update coordination: starts update
app/routes.py - HTTP API → Signed OTA: reads update status
app/routes.py - HTTP API → Version reporting: reports version
app/routes.py - Camera recording → Audio capture: captures audio
app/camera.py - Camera recording → Live preview: coordinates preview
app/camera.py - Camera recording → Media library: indexes recordings
app/camera.py - Health and tests → Camera recording: checks recording
app/diagnostics.py - Health and tests → Audio capture: tests audio
app/diagnostics.py - Health and tests → Live preview: pauses preview
app/diagnostics.py - Health and tests → Storage policy: checks capacity
app/diagnostics.py - Health and tests → Version reporting: reports version
app/diagnostics.py - Update coordination → Health and tests: reserves device
app/update_control.py - Update coordination → Camera recording: checks recording
app/update_control.py - Update coordination → Signed OTA: queues update
app/update_control.py - Signed OTA → Privileged OTA activator: requests activation
- BLE service manager → BLE provisioning: monitors service
README.md - Service SSH tunnel → Owner app: operator access
README.md