From f03dbb056dd60bf772a1d5d020de9b78aa00304e Mon Sep 17 00:00:00 2001 From: Joshua King Date: Fri, 5 Jun 2026 14:37:57 -0400 Subject: [PATCH] =?UTF-8?q?docs:=20CONTEXT.md=20=E2=80=94=20mark=20camera?= =?UTF-8?q?=20pipeline=20end-to-end=20verified?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Camera rig-86d978 registers + lists in the API/dashboard with status ingested. Add decisions for modernc/sqlite datetime scanning and legacy camera-id migration. Co-Authored-By: Claude Opus 4.8 --- CONTEXT.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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).