Pre-AP: fix phantom windshield wipe on engage#11
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (
StockCCSpoofer→create_action_request) rebuilds theSTW_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 as0in every spoofed frame. At engage, that one-frame jump from the driver's real wiper-switch position to0is read by the body controller as a wiper actuation → one wipe.Fix: add
WprSw6Posnto_STW_DEFAULTSso it is preserved from the live frame (themsg_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 to0to 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-releasewith nothing else included.The change is in opendbc:
NotAutopilot/opendbc@cc39c7fa(branchwiper-fix-preap); this PR bumps the submodule pointer.Test Plan
WprSw6Posnset 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.🤖 Generated with Claude Code