generated from CubeCraft-Creations/Tracehound
Dev #26
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Update main
- Add request validation: Content-Type check, body size limit (64KB) - Add field length validation (camera_id: 64, friendly_name: 128, mode: 32, resolution: 32) - Add FPS range validation (0-240) - Add battery_pct range validation (0-100) - Replace ad-hoc map[string]string errors with structured APIError {error, code, details} - Fix isUniqueConstraintErr to catch both camera_id and mac_address constraint violations - Fix MacAddress model field from string to *string for NULL handling - Fix splitSQL to strip -- line comments before splitting (was causing migration failures with modernc.org/sqlite) - Add 30 integration tests covering all endpoints - All tests pass: ok github.com/cubecraft/remoterig/internal/apiBattery calibration: - two-point linear cal (bat_raw_min->0%, bat_raw_max->100%) of the GoPro offset-57 raw byte, persisted in SPIFFS config - publish battery_pct in MQTT status only when calibrated (omit otherwise, per MQTT_CONTRACT); OLED shows % when calibrated, raw until then - set_battery_cal MQTT command: explicit {raw_min,raw_max} or capture-current {point:"full"|"empty"} for field calibration RGB STAT LED: - drive D0/D1/D2 (R/G/B) with health colors instead of the single green channel: red=offline, magenta=wifi-but-no-hub, yellow=hub-but-no-camera, green=healthy; blue during boot - RGB_COMMON_ANODE polarity flag; this module is common-anode Verified on hardware: boots, OLED ok, RGB shows correct colors (blue->red on the bench). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>Updating the buried ESP-01S currently means a USB-UART adapter and a GPIO0 jumper. Add a path to change its settings without reflashing, and lay the groundwork for full firmware updates over the existing UART. set_config (no reflash for settings): - ESP-01S: add saveConfig() + a set_config command — updates GoPro SSID/password/IP and poll interval, persists to LittleFS, acks, and re-associates Wi-Fi if creds changed - XIAO: forward an MQTT set_camera_config down to the ESP-01S over UART (hub -> MQTT -> XIAO -> UART -> ESP-01S/LittleFS) UART-OTA groundwork ("XIAO as flasher"): - reserve XIAO GPIOs ESP01_RST_PIN=D8, ESP01_PGM_PIN=D10 for driving the ESP-01S serial bootloader (not driven yet) - docs/design/esp01s-uart-ota.md: full design (why Wi-Fi OTA doesn't fit the 1MB ESP-01S on the GoPro AP, bootloader entry, ROM flash protocol, HTTP-pull delivery, scope) - hardware/README.md: fix stale ESP32-C3 -> XIAO ESP32-C6 wiring, add the two control lines (Notion wiring diagram updated to match) Both firmwares build clean and are flashed; set_config round-trip needs the broker to exercise end-to-end. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>The Pi is on a closed travel-router LAN, so push-based deploy from a runner can't reach it. Switch to pull: the runner builds + publishes, the Pi fetches. - build-dev.yaml: after the arm64 build, publish the binary + sha256 + version.txt to a rolling "dev" Gitea release (replaces the upload-artifact + repository_dispatch -> deploy-dev hop) - remove deploy-dev.yaml (push/scp-based deploy no longer used) - scripts/pi-update.sh: poll the dev release, verify sha256, install via deploy.sh (backup/restart/rollback); only updates when version changes - scripts/remoterig-update.{service,timer}: run the updater every 5 min - setup-pi.sh: install deploy.sh + pi-update.sh + update.env template + the updater timer; summary now reflects the pull flow - README: document the pull-based CI/CD; fix stale GOARM=6 (Zero 2 W is arm64 on 64-bit OS / arm GOARM=7 on 32-bit) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>The service unit hard-defaulted to User=pi, but not every Pi has a 'pi' user (e.g. this hub uses 'overseer') — systemd then fails with 217/USER. Default SERVICE_USER to ${SUDO_USER:-pi} so the service + /opt/remoterig ownership match the actual operator. Override with --service-user. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>A release tag named "dev" collides with the dev branch, making refs ambiguous ("refname 'dev' is ambiguous") and breaking git push/checkout. Publish the rolling build to tag "dev-latest" instead; pi-update.sh pulls from there. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>Three bugs surfaced once the camera reported in: - ListCameras LEFT JOIN returns NULL status columns for a camera with no status rows yet, which failed scanning into non-nullable int/time fields (recording_state, online, recorded_at) and emptied the whole list. COALESCE them (recorded_at falls back to the camera's created_at). - handleHeartbeat rejected every heartbeat ("cannot unmarshal number into string") because the node sends a numeric millis() timestamp. The handler doesn't use it, so drop the Timestamp field and let it be ignored. - handleAnnounce kept a stale cam-NNN row registered by MAC under the old (pre-self-id) scheme, so self-id status inserts hit a FOREIGN KEY error. When a MAC is known under a different id than the node's self-id, migrate: drop the old row and re-register under the self-id. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>The /cameras/{id}/start and /stop handlers only wrote a recording_events row — they never published the command, so the camera never recorded. Add Subscriber.PublishCommand (publishes {"command":...} to remoterig/cameras/<id>/command, which the XIAO forwards to the ESP-01S), thread a CommandPublisher into the recording handlers, and wire mqttSub in via apiRouter. Tests pass nil (publish skipped). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.