Repository navigation
fix(vehicle): recover telemetry without requiring fresh SoC - #1521
Merged
Merged
Conversation
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. |
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.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.
Vehicle telemetry refresh no longer requires the fresh SoC it is trying to recover. Core selects an enabled configured vehicle that explicitly declares telemetry_wake, independently of the planning and charge_start picker. Without an explicit binding, multiple vehicles or connected loadpoints produce an ambiguity error. Read-only and observe-only drivers remain ineligible.
The Lua host adds Unix time and a durable telemetry-wake reservation keyed by hardware identity. It commits attempts before network I/O, permits at most three in 30 minutes with a 90-second gap, and retains the budget across restart and rename. Goal refresh does not reset charge_start counters. A requested read interval now reaches the active driver timer.
Vehicle SoC may carry its source timestamp. Core rejects invalid, future and repeated timestamps as new observations, preserves the last trusted value and writes SoC history at source time. The startup replan waits for usable fresh SoC, so an old cached response cannot consume the recovery trigger.
Refs #1253. Paired with srcfl/device-drivers#167 (Tesla driver 0.2.5). The bundle is pinned to the merged driver commit c9de25106b07071fde55c9f8f5e95b69c58e6fc9 and carries Tesla 0.2.5. The existing 40-driver list stays in place. The pin also takes the already merged Heishamon 0.8.0 and MyUplink 1.2.3 updates; the MyUplink change adds F750 validation metadata. #1449 overlaps this pin but keeps its unique three-driver addition and minor changeset; its next rebase must retain this newer pin. The owner requested installation of this fix. Keep #1253 open until Tesla BLE hardware acceptance.
Validation: make verify on the combined bundle; the Heishamon integration test checks the heating view's outdoor-temperature and heat-mode power fields; full-stack FTW_E2E=1 go test ./test/e2e -timeout 180s; targeted race tests across state, telemetry, loadpoint, drivers and cmd/ftw. Regressions cover persisted/concurrent wake budgets and write failure, source freshness and full-car recovery, missing/stale SoC recipient selection, multi-vehicle ambiguity, read-only boundaries, independent charge_start counters, caller deadlines, prompt reads and rename. A local combined probe loads the paired real driver in Core's Lua VM against a fake HTTP proxy and DB; no Tesla or production box received commands.