Skip to content

feat(camera): provide TURN relay and validate firmware bootstrap - #155

Merged
Lash-L merged 7 commits into
mainfrom
feat/camera-turn-ha-onboarding
Oct 12, 2026
Merged

Lash-L merged 7 commits into
mainfrom
feat/camera-turn-ha-onboarding

Conversation

@Lash-L

@Lash-L Lash-L commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #144 (merged), which added the /fwapi/createca route and the [turn] config.

Camera previews can fail after successful vacuum onboarding because firmware uses different bootstrap hosts: the tested Qrevo MaxV (a87) uses the stripped token.r hostname and its explicit port, while the Saros 10R (a144) uses country_domain. This change adds disabled/provided/external TURN modes and validates the selected model's actual camera endpoint before sending Wi-Fi settings.

Changes

  • TURN modes. [turn] mode = disabled | provided | external replaces the boolean from feat(camera): answer the robot's fwapi/createca TURN request for live video (#18) #144; enabled = true without a mode is still read as external. Provided mode starts coturn in the container, reports relay health in status, and keeps HTTPS/MQTT running if the relay fails. Cleanup also runs after partial supervisor startup. Relay logs go to container stdout.
  • Credentials. TURN passwords are redacted from the persisted HTTP log; the response sent to the robot is unchanged.
  • Camera preflight. After device selection, onboarding checks trusted TLS and the createca response (against the configured TURN host/port) on the endpoint the selected model actually uses. Unknown models are checked on both. Older servers without TURN status are rejected with update guidance.
  • Port publishing. TURN UDP ports are published through an opt-in compose.turn.yaml overlay, or explicit Home Assistant Network mappings (unpublished by default). The HA add-on exposes turn_mode (default disabled), generates and persists a password for provided mode, and rejects custom listener ports in provided mode.
  • Onboarding GUI. Shows the destination SSID before sending, allows editing settings, and can keep waiting after five minutes on the same session without another pairing packet.
  • Docs. docs/camera.md covers model-specific DNS/TLS requirements, certificate renewal choices, drawing-pattern PIN conversion, TURN mappings and troubleshooting.

No version bumps: package and add-on versions stay at 1.2.1 and the beta add-on is untouched. Releasing this (version bump, changelog, image publish) is a separate release PR.

Validation

Limits

Only a87 and a144 bootstrap behavior is established. Preflight runs from the onboarding computer and cannot prove the robot's DNS visibility or UDP media connectivity. Supplied/proxy certificates need their own renewal arrangement; Actalis automatic issuance covers only the API hostname.

- Keep package and add-on versions at 1.2.1 and leave the unused beta add-on
  untouched; version bumps and image publishing belong in a release PR.
- Drop the never-released HA turn_enabled option and show turn_mode
  (default disabled) in the add-on options. config.toml still reads the
  [turn] enabled = true form from #144 as external mode.
- Lowercase turn.mode before choosing the provided-mode username default.
- createca docstring and known limitations now describe the model-specific
  bootstrap host (a144 country_domain, a87 token.r) instead of a single rule.
- Remove stray blank lines and a placeholder-free f-string.
@Lash-L
Lash-L force-pushed the feat/camera-turn-ha-onboarding branch from 0139b35 to da736a0 Compare October 12, 2026 17:16
@Lash-L
Lash-L merged commit c3b3284 into main Oct 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant