Repository navigation
V2.1.1-beta.4: Updates, Telemetrie und Release-Prozess absichern - #29
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
An unresolved active finding remains, flagging that the comment and vehicleActive() name no longer match the function's broader block-on-unknown/stale behavior.
1 open issue
What changed in this PR
This PR hardens the V2.1.1-beta.4 release of the CAN OBD2 reader firmware across three areas: update safety (block OTA when vehicle status is unknown/stale, add an explicit, authenticated bench "maintenance mode", and gate boot confirmation on local initialization health with automatic rollback), telemetry correctness (expire live values after 60 s even while radio traffic continues, discard invalid/old PID data, and compute average consumption by time-integrating fuel volume and distance), and release/build process (unified JSON escaping, split web assets and display rendering into separate TUs, a download-failure-safe release index, and checksum-verified debug archives). It also refreshes version, changelog, and operations docs while keeping the radio protocol at v3.
Changes:
- New shared modules:
UpdateSafety,BootValidation::HealthGate,Obd::ConsumptionAccumulator,Json::escape, plus snapshot value expiry inLiveData. - Refactors: HTML pages moved to
lib/web/DevicePages.cpp; display page/widget rendering moved toDisplayRenderer; JSON escaping consolidated ontoJsonEscape.h. - Release tooling:
fetch_previous_manifest.py,archive_build.py, stricterrelease_manifest.py/check_secrets.py, with CI/release workflow updates and regression tests.
I traced the new state machines (UpdateSafety, HealthGate, ConsumptionAccumulator) and the Python retry/validation logic against their tests, verified no dangling references remain to removed symbols (calcConsumption, BlockInstallWhileVehicleRunning, consumption helpers), and confirmed the new lib files land in directories already registered in platformio.ini. The code is clean, cohesive, and well covered by both native and Python tests. I found one minor documentation/naming inconsistency.
| File | Description |
|---|---|
lib/update/UpdateSafety.h |
New gate separating unknown/parked/active states and timed, non-persisted maintenance mode. |
lib/update/BootValidation.{h,cpp} |
HealthGate requiring continuous local health before confirming an image; rollback after deadline. |
lib/obd/ConsumptionAccumulator.h |
Time-integrates fuel/distance only while both inputs are fresh; derives instant/avg consumption. |
lib/telemetry/LiveData.{h,cpp} |
Expires stale values in snapshot and rejects non-finite updates; age-field semantics documented. |
lib/display/LiveValueView.{h,cpp} |
Freshness limits re-derived from config; coolant/ECU voltage treated as slow PIDs. |
src/sender/{SenderApp,SenderLiveData,SenderPower,OBDHandler}.cpp |
Wire UpdateSafety/consumption/boot-health; discard invalid PID responses. |
src/display/{DisplayApp,DisplayReceiver,DisplayWeb,DisplayUi,DisplayRenderer}.* |
Observe vehicle condition, expose readiness, split rendering from UI; install-blocker uses UpdateSafety. |
lib/web/{WebAssets,DevicePages,ManagementServer,AuthHelpers}.* |
Externalize device HTML, add maintenance endpoint + confirmation header, unify JSON escaping. |
lib/utils/JsonEscape.h, lib/update/{UpdateManifest,FirmwareUpdateManager}.cpp, lib/wifi_station/WifiStationManager.cpp |
Shared control-character-safe JSON escaping. |
scripts/{fetch_previous_manifest,archive_build,release_manifest,check_secrets}.py |
Index-safe fetch/validate, checksummed debug archives, redacted secret locations. |
.github/workflows/{ci,release}.yml |
Archive debug images, extended retention, explicit index initialization. |
VERSION.txt, CHANGELOG.md, README.md, docs/*, platformio.ini, include/config/UpdateConfig.h, include/{PID_Converter,OBDHandler}.h, lib/runtime/SenderRuntimeState.h, lib/obd/ObdDiagnostics.h |
Version/docs/config updates and API cleanup supporting the above. |
test/** |
New/updated native and Python regression tests for all new behavior. |
Review effort: Balanced
| // Updates must not interrupt the driver: block while the sender reports a | ||
| // running vehicle. | ||
| bool vehicleActive() { | ||
| const String& state = DisplayData::runtime().vehicleState; | ||
| return DisplayData::isEspNowConnected() && (state == "Running" || state == "StartStop" || state == "Idle"); | ||
| return FirmwareUpdate::updateSafety.blocked(millis()); |

Setzt die Review-Korrekturen für V2.1.1-beta.4 um: Updates bei unbekanntem Fahrzeugzustand sperren, expliziten Wartungsmodus und lokale Boot-Gesundheitsprüfung ergänzen, ungültige/veraltete Messwerte verwerfen und Verbrauch aus Kraftstoffmenge und Strecke berechnen.
JSON-Escaping vereinheitlicht, Web-Assets und Display-Rendering getrennt, Release-Index gegen Downloadfehler geschützt und exakte Debug-Artefakte mit Prüfsummen archiviert. Versionsdatei, Changelog und Betriebsdokumentation aktualisiert; Funkprotokoll bleibt v3.
Validierung: 181 native Tests und 27 Python-Tests bestanden; sender, display, sender_dev und display_dev erfolgreich gebaut. Image-Metadaten, Debug-Archive, JavaScript-Syntax, Secret-Scanner und Diff-Prüfung erfolgreich.
Hardwareprüfungen für CAN, ESP-NOW, OTA und Rollback stehen aus. Dieser PR veröffentlicht keine signierten Firmware-Releases und installiert keine Geräte.