diff --git a/CONTEXT.md b/CONTEXT.md index dbed0ae..1d2152f 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -176,6 +176,13 @@ reach; the Pi pulls instead. now defaults the service user to `$SUDO_USER`. 12. **Hub embeds the frontend** via `//go:embed all:src/dist`; Vite builds into `cmd/server/src/dist` (a committed `index.html` placeholder keeps the embed valid). +13. **SQLite/modernc datetime:** `modernc.org/sqlite` returns a `COALESCE()`/expression + as a raw string (no type affinity) → can't scan into `time.Time`. Scan plain + `DATETIME` columns (returned as `time.Time`) via `sql.NullTime`; `ListCameras` + `COALESCE`s NULL int/bool status columns. Nodes send no usable timestamp on + status/heartbeat (numeric `millis()`) — the hub ignores it / stamps server-side. +14. **Legacy id migration:** `handleAnnounce` migrates a MAC registered under a + different `camera_id` (e.g. a pre-self-id `cam-NNN`) to the node's self-id. ## 10. Conventions @@ -192,13 +199,11 @@ reach; the Pi pulls instead. - Full CI/CD loop proven: commit → CI build → `dev-latest` → Pi self-update (checksum, atomic replace, health-check) → service active. - C6 (fw `0.4.0`) joins RemoteRig, connects to the broker, announces as `rig-86d978`, - publishes status. ESP-01S UART link alive. + and is **registered + listed** in `GET /api/v1/cameras` and the dashboard, with + status/heartbeat ingested cleanly. Shows `online:false` / zeros until a GoPro is + attached (expected on the bench). ESP-01S UART link alive. **End-to-end verified.** **In progress / unresolved:** -- **Verifying the hub registered `rig-86d978`** — needs confirmation that the hub is on - build `18db26c2` (Option B) and that the camera is in the DB / dashboard - (`GET /api/v1/cameras`, header `X-API-Key: changeme`). Status currently shows - `online:false` because no GoPro is attached on the bench (expected). - **GoPro Hero 3 protocol fix** (ESP-01S `fetchStatus` shutter bug) — required before real battery/recording data; needs a real Hero 3. - **Rotate the Gitea runner registration token** (was exposed in a setup paste).