Skip to content

State looks live while the car is asleep or the CAN bus is silent #11

Open
0 of 3 issues completed
Open

Description

@Tichael

Problem

  • state_update_task republishes the full state every 5 s (STATE_HEARTBEAT_INTERVAL, cars/egmp/src/lib.rs:223), whether or not any CAN frame arrived. So when the car sleeps, or the bus goes quiet because of a bus fault, wiring or a WiCAN issue, the device keeps sending the last known values as if they were fresh.
  • The app marks state live on any update (30 s liveness timer, mobile-app/lib/providers/vehicle_state_provider.dart:182). The dashboard then shows "Updated just now" (egmp_dashboard.dart:282) for values that may be hours old.
  • Values that are only meaningful while the car is awake stay frozen at their last reading: speed, power flow, charging state, time to 80%, and so on.

Open questions

  • What does an E-GMP car send before going to sleep? Do the last frames leave a consistent "off" state (Park, not ready, not charging)?
  • Which values are still valid while asleep (doors, locks, SoC, odometer) and which should be marked unknown?
  • How should the app show "car asleep, last seen at X" compared with "device connected, no CAN data"?

Ideas

  • Track the time of the last frame that matched a filter, and send it with each state update (or as a system-state field).
  • Stop the heartbeat, or flag the state as stale, after N seconds without frames.
  • Clear values that only make sense while awake when the bus goes quiet.
  • Check this against a log of the car falling asleep and waking up.

Done when
The app can tell live data from data the car last reported before going quiet, and shows the difference.

Sub-issues

Sub-issues

0 of 3 Issues completed
Loading 3 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions