Repository navigation
fix(tesla_vehicle): recover missing SoC with bounded telemetry wakes - #167
Merged
Merged
Conversation
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Missing SoC, partial HTTP 200 and old cached payloads now trigger a bounded telemetry wake/read instead of waiting for the 30-minute startup cadence. The driver uses the dedicated wake_up endpoint, which vehicle_data cache hits cannot bypass, and keeps the BMS timestamp instead of renewing SoC at HTTP receipt.
Core saves the wake budget by hardware identity before a request: at least 90 seconds between attempts, at most three per 30-minute window. Restart and rename do not restore it. The driver keeps the three-minute 408/503 backoff and rejects unsuccessful wake results even with HTTP 200. Telemetry recovery never sends charge_start; its existing charging path remains separate.
Requires the paired Core change for unix_ms, reserve_vehicle_wake, source timestamps and a refresh recipient independent of fresh SoC. Hosts without the new functions do not run recovery or treat an unknown source age as fresh. This remains beta; no physical Tesla BLE recovery test has run.
Refs srcfl/ftw#1253. Paired with srcfl/ftw#1521. Core #1449 already owns the bundle pin; reconcile that pin after the driver merge before publishing a beta with this fix.
Validation: make test-driver ID=tesla_vehicle; make check (4,810 passed, 923 skipped); the recovery harness also passes under a double-precision Lua interpreter. It covers cold start, missing/old/invalid source data, empty/partial/invalid HTTP 200, HTTP failures, 408/503, saved restart budget, wake-only goal refresh and rejected wake responses. A local probe also loaded this exact source in Core's gopher-lua runtime against a fake proxy and state DB: missing/old SoC recovered to 100%, repeated cache did not renew source time, and rename did not add a wake.