Skip to content

nap: add Tinkla Buddy IC integration toggle + opendbc bump#1

Open
sveinmer wants to merge 3 commits into
MagZu:nap-C3-devfrom
sveinmer:buddy-ic-for-magzu
Open

nap: add Tinkla Buddy IC integration toggle + opendbc bump#1
sveinmer wants to merge 3 commits into
MagZu:nap-C3-devfrom
sveinmer:buddy-ic-for-magzu

Conversation

@sveinmer

@sveinmer sveinmer commented May 26, 2026

Copy link
Copy Markdown

NAP: Tinkla Buddy IC integration toggle + opendbc bump

Wires the UI toggle and Params-keys for the Tinkla Buddy IC feature
added in the linked opendbc PR. With this merged and a Buddy R2S
connected via EtherCAN bridge, openpilot renders path / lanes / lead
car / target speed / road-sign on the stock Tesla MCU1 instrument
cluster.

Companion opendbc PR: MagZu/opendbc#1

What's in this PR

New Params

  • NAPTinklaICIntegration (Persistent, BOOL, default 1 = on) — when
    set, the HUDController in opendbc emits IC frames on chassis bus 0.
    When unset, HUDController is a no-op regardless of Buddy presence.
  • NAPRoadSignFallbackKph (Persistent, INT, default 0) — fallback
    speed for Tesla IC road-sign widget when Tesla DI reports GPS SNA
    (no GPS-fix, no nav-DB hit, parking, private road). Default 0 =
    no sign rendered when SNA.

Both declared in common/params_keys.h.

UI toggle

  • selfdrive/ui/layouts/settings/nap.py — new toggle row in NAP
    settings panel: "Tinkla Buddy IC integration". Default on.
  • selfdrive/ui/layouts/settings/nap_content.py — Buddy IC instruction
    text (hardware requirements, what the toggle does).
  • selfdrive/ui/mici/layouts/settings/nap.py — mirror toggle for
    comma 4 / mici UI.

Pattern follows existing NAP settings: same toggle widget, same content-
file-extraction approach used for EPAS-flasher and pedal-calibration.

opendbc bump

Bumps opendbc_repo pointer to the HEAD of the companion opendbc PR's
branch (sveinmer:buddy-ic-for-magzu). Updates to MagZu/opendbc HEAD
once the opendbc PR is merged.

RELEASES.md entry

Version X.Y.Z (2026-05-XX)
========================
* Tinkla Buddy IC support: lane / target-speed / road-sign / lead-car
  overlay on stock Tesla MS cluster (requires Buddy R2S hardware via
  EtherCAN bridge on Tesla OBD port)

Format per docs-nap/contributing.md — short, user-facing, parsed by
the comma updater.

Default-state

NAPTinklaICIntegration=1 (on). Rationale: this is consistent with
how MagZu's other "is the hardware connected → use it" features
default (no pre-flight surveys before features activate). Users
without Buddy hardware see no IC change — the chassis-CAN traffic
they don't tap is harmless.

If MagZu prefers default=0 (opt-in), the change is one line in
common/params_keys.h.

Hardware required (for end-user)

  • Comma 3 or comma 3X
  • Tinkla Buddy R2S
  • EtherCAN-bridge cable (USB-C ↔ Tesla OBD-Ethernet pins)
  • 2014-2016 pre-AP Tesla Model S

Buddy firmware: v1.44 or v1.49 (both verified).

What's NOT in this PR

  • Pedal-tier 2.x PID tuning — our smoothness adjustments
  • Lateral-gate dashcamOnly safety-lock — fork-specific safety policy
  • T2A/T2B upstream Tesla CC port — MagZu has equivalent
  • Panda IC-generator firmware — verified null-effect on our hardware
    (Tesla gateway doesn't forward chassis 0x239 to IC-bus); fix path is
    openpilot Python only
  • scripts/buddy_sprint/ debug suite — can be a follow-up tools-PR if
    interesting
  • Our .claude/, CLAUDE.md, docs/NAP_*, sprint memory — fork-only

Test evidence

Local

  • scons -j$(nproc) — green on nap-C3-dev baseline + PR
  • pytest opendbc_repo/opendbc/safety/tests/test_tesla_preap.py -v
  • pytest opendbc_repo/opendbc/car/tesla/preap/tests/ — green
  • ✅ Docker CI build per docs-nap/contributing.md

Hardware (Sveins c3, 2014 Tesla S P85)

  • ✅ Full Buddy IC functionality live since 2026-05-25 (lanes,
    target-speed, road-sign, lead-car all rendered on Tesla MCU1)
  • ✅ Multiple drive sessions, no regression on existing engagement /
    stalk-spoof / pedal-mode flows
  • ⚠️ Drive-validated on our fork's full state; this PR isolates the
    Buddy-relevant subset

What's NOT validated

  • ❌ This PR in isolation on MagZu-baseline hardware — recommend bench
    validation (parked, ignition-on) on c3 with MagZu-base + PR before
    merge: verify cabana shows expected DAS-frame values
  • ❌ MagZu-specific hardware quirks (different panda rev, etc.)
  • ❌ Drive-validation of MagZu-base + PR — community / acceptor

Verification on MagZu hardware (recommended pre-merge)

# On dev-box with MagZu/openpilot:nap-C3-dev base + this PR
cd opendbc_repo
git submodule update --init
scons -j$(nproc)

# On c3 (parked, ignition-on)
sudo cp panda/board/obj/panda.bin.signed /data/openpilot/panda/board/obj/
sudo systemctl restart comma

# Verify
python -c "
from cereal import messaging
sm = messaging.SubMaster(['can'])
# Check for 0x239 / 0x659 / 0x2B9 with correct field values
"

# Set toggle on, parked
echo 1 > /data/params/d/NAPTinklaICIntegration

# Verify on Tesla IC:
#   - Lanes visible (static at low speed)
#   - Target-speed visible when stalk-engaged
#   - Road-sign visible if GPS gives speed-limit (else NAPRoadSignFallbackKph)

Commit structure

Single commit (small openpilot delta):

nap: add Tinkla Buddy IC integration toggle


🤖 PR-body authored with Claude Code

Wires UI toggle for the Buddy IC feature added in opendbc companion PR.
With this merged and a Tinkla Buddy R2S connected via EtherCAN bridge on
Tesla OBD port, openpilot renders path / lanes / lead-car / target-speed /
road-sign on the stock Tesla MCU1 instrument cluster.

Default on: NAPTinklaICIntegration=1. Users without Buddy hardware see
no IC change (the chassis-CAN traffic they don't tap is harmless).

Changes:
- NAPTinklaICIntegration param (PERSISTENT BOOL, default 1 = on)
- NAPRoadSignFallbackKph param (PERSISTENT INT, default 0 = no sign
  rendered when Tesla GPS SNA)
- selfdrive/ui/layouts/settings/nap.py: new toggle row under "Tinkla
  Buddy IC" section header
- selfdrive/ui/mici/layouts/settings/nap.py: mirror toggle for mici UI
- opendbc bump to buddy-ic-for-magzu HEAD (ac463ef2)
- RELEASES.md entry

Companion opendbc PR: MagZu/opendbc#1

Hardware required (end-user): comma 3/3X + Tinkla Buddy R2S +
EtherCAN-bridge cable + 2014-2016 pre-AP Tesla Model S. Buddy firmware
v1.44 or v1.49 (both verified).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 26, 2026 09:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds UI and parameter support for a new “Tinkla Buddy IC” integration toggle, updates params to include new keys/defaults, and bumps the opendbc submodule.

Changes:

  • Add a new “Tinkla Buddy IC Integration” toggle to NAP settings (both standard UI and Mici UI).
  • Introduce new params keys for Tinkla IC integration and road-sign fallback kph.
  • Update release notes and advance the opendbc submodule pointer.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
selfdrive/ui/mici/layouts/settings/nap.py Adds a new BigParamControl for Tinkla Buddy IC integration in the Mici settings layout.
selfdrive/ui/layouts/settings/nap.py Adds a new “Tinkla Buddy IC” settings section and toggle in the main settings UI.
common/params_keys.h Adds new persistent params keys, including default values.
RELEASES.md Documents the new Tinkla Buddy IC support in the release notes.
opendbc_repo Updates the opendbc submodule commit reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread common/params_keys.h
{"NAPRadarOffset", {PERSISTENT, FLOAT, "0.0"}},
{"NAPRoadSignFallbackKph", {PERSISTENT, INT, "0"}},
{"NAPScriptRunning", {CLEAR_ON_MANAGER_START, BOOL}},
{"NAPTinklaICIntegration", {PERSISTENT, BOOL, "1"}},
Comment thread RELEASES.md
@@ -1,3 +1,9 @@
Version 0.11.2 (2026-05-26)
========================
sveinmer and others added 2 commits May 26, 2026 11:19
Pulls in opendbc 644c7147 which replaces `from cereal import car` in
hud_module.py with `from opendbc.car import structs`. Required because
opendbc public CI builds the package standalone (no cereal installed)
and was failing import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps opendbc submodule pointer to 90819d48 which replaces the
`from cereal import car` with `from opendbc.car import structs` in
preap/hud_module.py. Required for opendbc standalone CI builds where
cereal is not installed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sveinmer

Copy link
Copy Markdown
Author

Heads-up: failing review check is a workflow-config bug on master, not this PR.

The failed review check (action ID 77842201577) is from .github/workflows/auto_pr_review.yaml running on magzu/master (via pull_request_target trigger).

Root cause: magzu/master has:

uses: actions/first-interaction@v3
with:
  issue_message: ""
  pr_message: |
    <!-- ... -->

actions/first-interaction@v3 rejects empty-string issue_message:

Error: Input required and not supplied: issue_message
    at Object.getInput (...)

This will fail on every PR opened against any magzu/openpilot branch until the workflow is fixed.

Suggested fix (either approach works):

  1. Downgrade to v1 (matches what's still on nap-C3-dev):

    uses: actions/first-interaction@v1
    with:
      repo-token: ${{ secrets.GITHUB_TOKEN }}
      pr-message: |
        ...
  2. Or fix the v3 syntax by providing a real issue_message:

    uses: actions/first-interaction@v3
    with:
      repo_token: ${{ secrets.GITHUB_TOKEN }}
      issue_message: "Thanks for opening your first issue!"
      pr_message: |
        ...

Easy to verify: the review job that passes (action ID 77842346942) is the actual review-related step. The failing one is just the "first timers welcome comment" failing to fire. Functionality of the review itself is unaffected.

Happy to send a separate small PR with the workflow fix if useful.

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.

2 participants