Skip to content

Add a CommaView settings panel (comma 3X and comma four) - #3

Draft
RhynoTech wants to merge 1 commit into
masterfrom
commaview-settings
Draft

RhynoTech wants to merge 1 commit into
masterfrom
commaview-settings

Conversation

@RhynoTech

@RhynoTech RhynoTech commented Nov 28, 2026 •

Copy link
Copy Markdown

A CommaView entry in Settings. It installs, updates and removes the CommaView runtime, and pairs a phone, tablet or car head unit with this comma, from the comma's own screen. Nothing CommaView-related is downloaded, installed or run until someone taps Install.

This replaces #1, which was made against staging.

What it adds

  • Settings › CommaView, on the comma 3X (layouts/settings/commaview.py) and the comma four (mici/layouts/commaview.py):
    • Install, or check for update once installed. A check asks commaview.com right away; the button shows "up to date" or turns into update.
    • Pair, Reboot (after an install or update) and Remove.
    • Install, update and remove happen only while parked or offroad. Asked while driving, the runtime queues the job for the next time the car is parked.
  • A pairing screen (commaview_pairing_dialog.py, both comma models): a one-time code from the runtime, as a QR code and as text with the comma's address. Each code works once, for ten minutes, on the same Wi-Fi. The QR code is dark on light, which every phone scanner reads.
  • sunnypilot/commaview/integration.py: what the panels call. Every call returns at once; the work runs in threads.
    • Status comes from the runtime's local control API.
    • The current release comes from commaview.com, every 15 minutes, when the panel opens, and on Check.
    • Jobs run the runtime's installer: the hosted install.sh for a first install, the installed one for an update, uninstall.sh to remove.
  • The menu icon is sunnypilot's own for now: icons/link.png in the comma 3X's settings and icons_mici/settings/device/phone.png on the comma four. sunnypilot keeps images in LFS on Hugging Face, which we can't upload to, and an image missing there fails every CI job at setup. CommaView's logo is here (sha256 43056f04e3e48060f8570e318a6f1d0989e65ed00607ee632d903e3954025ec6), for a maintainer to add with git lfs push if you'd like it.

Behaviour worth reviewing

  • Process priority. openpilot's UI runs at realtime priority (SCHED_FIFO) on one core, and processes it starts inherit that. The installer and pairing helper are started as ordinary processes on every core, at nice 10 (_as_background). Without that, an install stuttered the UI (frames up to ~480 ms with the rest of the comma idle).
  • Screen timeout. The pairing screen keeps Settings open for its code's ten minutes, as the driver training guide does. The panel does the same while a job or a check runs. Otherwise Settings closes after 5–10 s with the car on.
  • Network. Only commaview.com, with a User-Agent of its own, and the runtime's local API on 127.0.0.1:5002.
  • Logs. Each job writes /data/commaview-integration/<install|update|uninstall>.log, each line with the seconds since the job started.

Tests

sunnypilot/commaview/tests/test_integration.py, 30 tests, cover:

  • status;
  • install, update and remove outcomes, one job at a time, and download failures;
  • pairing codes, and runtimes too old to make one;
  • update detection and the on-demand check;
  • the job log;
  • the User-Agent;
  • ordinary scheduling for the installer, including from a realtime parent.

ruff with the repository's config passes. Tested on a comma four: install, pair by QR code, update check and remove.

CI

Static analysis, unit tests and docs pass. Process replay fails for a reason that comes from upstream, not this change. Every process's output matches the reference except one sanity check: plannerd's jerk_rms on route regenB328FF8BA0A|2025-04-08--22-57-45--0 is 0.15746, over its 0.15 limit (check_jerk_rms, added in openpilot #39286, Nov 12). This PR doesn't touch plannerd. sunnypilot master fails the same step: its latest run (#4772, 55b3192) shows exit code 1 on process replay. The workflow lets that step fail on master only (continue-on-error: ${{ github.ref == 'refs/heads/master' }}), so it shows red only on pull requests.


Generated by Claude Code

Settings › CommaView installs, updates and removes the CommaView runtime
and pairs a phone, tablet or car head unit with this comma from its own
screen. Nothing is downloaded or run until someone taps Install.
@github-actions

Copy link
Copy Markdown

Process replay diff report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ 0 changed, 80 passed, 0 errors

This branch has not been deployed

No deployments
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