Commit Graph
11 Commits
Author SHA1 Message Date
Quintine 63e9aa6cc1 docs: save BYD Seal longitudinal control (Case A harness re-wire) plan for later
On hold. Captures the measured bus topology, the ADAS-pair-through-CAN1
re-wire approach, research gates, panda forwarding work, opendbc
fingerprint-based auto-detection design, validation ladder, and fallbacks.
2026-07-25 19:25:00 +10:00
Quintine 1abd13736b byd: fix SEAL bus topology from live dump — ADAS on bus 0, PCM_BUTTONS confirmed
Live bus dump from the Seal showed a different topology than the Han:
- ACC_HUD_ADAS (813) + ACC_CMD (814) are broadcast on the vehicle CAN
  (bus 0), not the camera CAN. Panda rx check expected 813 on bus 2 and
  never saw it -> safety config invalid -> controls blocked forever.
- PCM_BUTTONS (944) confirmed on bus 0 at 20Hz (MADS button placement OK)
- 482 MPC_LKAS_CMD_ANGLE present on bus 2 (angle LKAS cmd; for future use)

Changes:
- carstate: ADAS messages (ACC_HUD_ADAS/ACC_CMD) read from bus 0 on SEAL,
  bus 2 on HAN (cp_adas accessor); parsers built per platform/bus
- panda byd.h: 813 cruise check is bus-independent; rx checks accept
  813 on bus 0 or 2, 944 on bus 0 or 2 (first-seen-wins)
- interface: disable openpilot longitudinal for SEAL — stock ACC_CMD
  originates on bus 0 where the panda cannot intercept it. Stock ACC +
  MADS lateral it is (which is the point of MADS anyway).
- panda firmware rebuilt

Verified: SEAL (cruise+lkas button via bus 0, alphaLong=False) and
HAN (bus 2 topology, alphaLong=True) both canValid; 120 safety tests +
MISRA clean.
2026-07-25 18:57:17 +10:00
Quintine 5684dd9d0e tools: byd_can_dump — skip 'boot' dir, robust rlog/qlog discovery, fix sys.path
The auto-detect picked /data/media/0/realdata/boot (boot logs, no rlog).
Now scans newest-first for a dir that actually contains an rlog/qlog,
skips 'boot', and inserts repo root into sys.path so it runs from any CWD.
2026-07-25 18:42:59 +10:00
Quintine b598ba5dcb byd: support SEAL steering feedback on 508 STEERING_TORQUE_ANGLE
The Seal EPS reports steering torque/prepare/activated state on
508 STEERING_TORQUE_ANGLE (different bit layout; driver torque factor
0.1), unlike the Han which uses 792 STEERING_TORQUE. The Seal's
fingerprint contains 508 but not 792, so alive-checking 792 tripped
canError ("Unknown Vehicle Variant") the moment the interface started.

- carstate: per-platform steering message selection (508 strict-checked
  on Seal, 792 on Han; the other parsed opportunistically)
- carcontroller: don't send 792-layout camera feedback on the Seal;
  stock 508 forwards unmodified for now (camera-feedback spoofing for
  the Seal's 508 to be evaluated after a bus dump + road test)
- panda byd.h: rx check accepts 792 or 508 (first-seen-wins), torque
  sampling handles both layouts, driver torque rescaled for 508's 0.1x
  factor
- panda firmware rebuilt (panda_h7.bin.signed)
- tests: Seal(508) + Han(792) both verified canValid with correct
  torque values; 120 safety tests + MISRA clean
2026-07-25 18:32:42 +10:00
Quintine 264ebf956e tools: add byd_can_dump.py — per-bus CAN address/rate dump for BYD bring-up
BYD Seal reports steering torque on 508 STEERING_TORQUE_ANGLE while the
Han uses 792 STEERING_TORQUE, and PCM_BUTTONS bus assignment is harness
dependent. This tool prints bus/addr/len/rate tables (with key BYD
addresses flagged) from either the latest recorded route (safe, no
hardware) or a live panda sniff (manager stopped).
2026-07-25 18:25:27 +10:00
Quintine fbaba23ec1 byd: regenerate CARS.md docs with BYD models 2026-07-25 17:55:42 +10:00
Quintine 530f54fa2a byd: regenerate car_list.json with BYD HAN EV 2023 + BYD SEAL PERFORMANCE 2025
car_list.json is generated from the platform registry; the staging copy
was built before BYD existed, so the Vehicle panel's platform selector
had no BYD entries. Regenerated via platform_list.py (377 -> 379 cars).
2026-07-25 17:54:09 +10:00
Quintine 2b743a3a59 Remove accidentally committed .serena tool metadata 2026-07-25 17:38:06 +10:00
Quintine bd58431b9b byd: fix canError ("Unknown Vehicle Variant") from strict parser alive checks
Explicit parser frequencies made canValid=False when state-dependent
messages are absent (PCM_BUTTONS is event-driven; MPC_LKAS_CMD/ACC_CMD
only flow when stock ADAS is active), tripping EventName.canError.

- Alive-check only control-critical messages, at a conservative 10Hz
  (1s timeout): ESC, BRAKE_APPLIED, PEDAL, STEER_MODULE, STEERING_TORQUE,
  DRIVE_STATE, ACC_HUD_ADAS
- Parse-but-don't-alive-check (nan) the rest: STALKS, METER_CLUSTER,
  MPC_LKAS_CMD, ACC_CMD
- PCM_BUTTONS is parsed on both pt and cam parsers (bus assignment is
  harness dependent); MADS reads LKAS_ON_BTN from whichever bus sees it

Verified: canValid=True with idle stock ADAS, LKAS button events work
from either bus, canValid stays True throughout.
2026-07-25 17:37:52 +10:00
Quintine 1a4f296aa8 tools: add deploy_to_device.sh — git-archive-over-ssh deploy that preserves symlinks
Copying the tree to a device with scp/file managers mangles symlinks
(car_list.json et al become text files containing the target path),
crashing the UI with JSONDecodeError. This script deploys via
'git archive HEAD | ssh tar -x', which preserves symlinks, verifies
them on-device, and keeps the previous install for rollback.
2026-07-25 16:53:38 +10:00
Quintine c8903e592c byd: add BYD car port (HAN EV 23 / Seal Performance 2025) with MADS support
Car port adapted from HotIce0/openpilot develop_byd_comma4 to sunnypilot's
opendbc API (CP_SP signatures, (ret, ret_sp) carstate returns):

- opendbc/car/byd/: interface, carstate, carcontroller, bydcan, values,
  fingerprints (BYD_SEAL_PERFORMANCE_25 with full 91-msg fingerprint)
- opendbc/dbc/byd_common.dbc
- Brand registration: car/values.py, car/fingerprints.py (+MIGRATION),
  car.capnp SafetyModel byd @35, torque_data/params.toml
- safety/modes/byd.h: SAFETY_BYD 35U with real TX checks (steer torque
  cmd checks, longitudinal accel checks), MADS LKAS button from
  PCM_BUTTONS (944), pcm_cruise_check, ESC vehicle_moving. MISRA clean.
- safety/tests/test_byd.py: 120 tests (stock + longitudinal variants)
- opendbc/sunnypilot/car/byd/mads.py: MadsCarState tracking the
  dedicated LKAS steering wheel button
- sunnypilot/mads/mads.py: allow_always for byd (dedicated LKAS button)
- panda: restore SConstruct/SConscript build system, rebuild
  panda_h7.bin.signed (TIZI) with SAFETY_BYD + MADS lateral gating

Known limitation: BYD_HAN_EV_23 fingerprint is a subset of the Seal's,
so HAN requires FINGERPRINT=BYD_HAN_EV_23 env var (live fingerprint
cannot distinguish it; Seal fingerprints natively).
2026-07-25 15:09:00 +10:00