Skip to content

Pre-AP: fix phantom windshield wipe on engage#11

Merged
SloPOS merged 1 commit into
nap-releasefrom
wiper-fix-preap
Jul 1, 2026
Merged

Pre-AP: fix phantom windshield wipe on engage#11
SloPOS merged 1 commit into
nap-releasefrom
wiper-fix-preap

Conversation

@SloPOS

@SloPOS SloPOS commented Jun 30, 2026

Copy link
Copy Markdown

Summary

Every time openpilot is engaged with a cruise-stalk pull on the Pre-AP Model S, the windshield wipers do a single wipe. This fixes it.

Root cause: The cruise-stalk engage spoof (StockCCSpoofercreate_action_request) rebuilds the STW_ACTN_RQ (0x45) frame from _STW_DEFAULTS, which copies each listed signal from the live stalk frame. WprSw6Posn (the wiper 6-position switch, DBC bits 48–50) was not in that list, so the packer wrote it as 0 in every spoofed frame. At engage, that one-frame jump from the driver's real wiper-switch position to 0 is read by the body controller as a wiper actuation → one wipe.

Fix: add WprSw6Posn to _STW_DEFAULTS so it is preserved from the live frame (the msg_stw.get(key, default) pattern then carries the driver's real value). Only this one signal is added — the other unpreserved bits (StW_Sw07..15, SpdCtrlLvrStat_Inv) are deliberately left forced to 0 to avoid spoofing a horn / high-beam / other stalk press.

This is a baseline Pre-AP bug — it predates and is independent of the lane-change auto-signal work. Branched from nap-release with nothing else included.

The change is in opendbc: NotAutopilot/opendbc@cc39c7fa (branch wiper-fix-preap); this PR bumps the submodule pointer.

Test Plan

  • New unit tests: WprSw6Posn set non-zero in the live frame is preserved in the spoofed frame (byte 6 reads the live value, not 0); regression guard that it stays in the preserve list.
  • Existing STW_ACTN_RQ spoof tests still pass (engage byte0=0x50, lever bits, VSL_Enbl_Rq) — engage behavior unchanged.
  • On-device: confirmed the phantom wipe on engage is gone.

🤖 Generated with Claude Code

Every cruise-stalk engagement triggered a single windshield wipe. The
STW_ACTN_RQ engage spoof rebuilt the stalk frame without preserving
WprSw6Posn (the wiper 6-position switch), so the packer wrote it as 0; the
one-frame jump from the driver's real wiper position to 0 was read by the
body controller as a wiper actuation.

Bumps opendbc to preserve WprSw6Posn from the live stalk frame (only that
signal; other unpreserved bits stay forced to 0 to avoid spoofing a
horn/high-beam press). Baseline bug, independent of the lane-change feature.

opendbc: NotAutopilot/opendbc@cc39c7fa (branch wiper-fix-preap).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SloPOS
SloPOS merged commit 002891f into nap-release Jul 1, 2026
7 of 9 checks passed
@SloPOS
SloPOS deleted the wiper-fix-preap branch July 1, 2026 16:19
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