Commit Graph

6 Commits

Author SHA1 Message Date
Hermes fe193701ae CUB-230: hub-side deduplication for offline buffering replay
Build (Dev) / build (push) Failing after 10s
CI/CD / lint-and-typecheck (push) Successful in 6s
CI/CD / test (push) Successful in 6s
CI/CD / build (push) Failing after 8s
CI/CD / deploy (push) Has been skipped
- Add dedup check in handleStatus using (camera_id, recorded_at) uniqueness
- Skip insert if duplicate detected - logs replayed entries
- Go mod: updated version to 1.19
2026-05-23 07:40:06 +00:00
Hermes f200cd9782 feat: add MQTT subscriber for ESP32 camera status ingestion
Implements MQTT subscriber (internal/mqtt/subscriber.go) that:
- Connects to Mosquitto broker with auto-reconnect
- Subscribes to remoterig/cameras/+/status, +/heartbeat, +/announce
- Parses and validates incoming messages per MQTT contract
- Inserts status_logs with duplicate prevention
- Auto-detects recording state changes and manages recording_events
- Broadcasts camera status changes via SSE hub
- Camera auto-registration via announce (MAC-based, sequential cam-NNN)
- Heartbeat watchdog marks cameras offline after 120s silence
- Wired into main.go with graceful degradation (warns if broker unreachable)

Dependency: github.com/eclipse/paho.mqtt.golang v1.5.0

Closes CUB-232.
2026-05-21 21:16:08 +00:00
overseer 7a0a76bbd5 CUB-182: Chi router setup with auth middleware and graceful shutdown 2026-05-18 17:47:06 -04:00
overseer dcd64ee199 CUB-183: SQLite schema migration + DB init 2026-05-18 17:44:50 -04:00
overseer ede6696792 CUB-181: Add yaml.v3 dependency via go mod tidy 2026-05-18 17:43:53 -04:00
overseer ad55e94c9c CUB-181: Scaffold Go module, directory layout, config, and main.go entry point 2026-05-18 17:43:46 -04:00