Repository navigation
fix: one session request per wake; resend session and command requests unchanged - #95
Merged
Conversation
…s unchanged A waking car sends a burst of VCSEC status updates. Once the infotainment session info request was out, each further "awake" status restarted the auth and sent another request (5 in 0.6 s seen on a car), queued behind each other, so the first command after a wake took about 8 s instead of 0.5 s. Now only a command still waiting for the wake reacts to it. A single request sent the moment VCSEC reports the car awake is often ignored by its still-waking infotainment, and the command then waited the full 25 s auth timeout. An unanswered session info request is now resent unchanged every TRANSPORT_RETRY_INTERVAL (1 s), at most MAX_AUTH_RESENDS (10) times, as vehicle-command does. Same bytes and request UUID, so whichever copy the car answers is accepted. When a command gets no reply in time, it is resent as the identical encoded bytes instead of being rebuilt with a new counter, as vehicle-command does. If the first copy arrived and only the reply was lost, the car sees a duplicate instead of a new command, so toggles (trunk, media play/pause, volume step) are not executed twice. After a new session the request is built again. Tests in tests/test_vehicle.cpp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yoziru
force-pushed
the
upstream-pr/wake-session-resend
branch
from
October 10, 2026 11:38
26e5230 to
137fa62
Compare
Owner
|
Rebased onto current
238/238 tests pass locally; CI runs on the updated head. This is a great fix — the wake-burst session-request leak and the duplicate-command hazard are exactly the kind of thing that is invisible without a car. |
darek-margas
added a commit
to darek-margas/tesla-ble
that referenced
this pull request
Oct 10, 2026
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
Three related fixes in how requests are sent around a wake, all matching Tesla's vehicle-command:
TRANSPORT_RETRY_INTERVAL(1 s), at mostMAX_AUTH_RESENDS(10) times. Same bytes and request UUID, so whichever copy the car answers is accepted.Tests in
tests/test_vehicle.cpp. Running on two cars (ESP32) since early October: the first command after a wake now completes in about 0.5–7 s instead of failing after 25 s.Independent of #94; touches
vehicle.cppin different places from #90 and #91.