Skip to content

Handle GNSS fix times sent in Unix seconds - #244

Merged
natekspencer merged 1 commit into
mainfrom
fix-gnss-unix-seconds
Nov 13, 2026
Merged

natekspencer merged 1 commit into
mainfrom
fix-gnss-unix-seconds

Conversation

@natekspencer

Copy link
Copy Markdown
Collaborator

Some vehicles send the dynamics.vehicle.gnss fix time in Unix seconds (e.g. 1794604023 = 2026-11-13 21:07:03 UTC). _gnss_unix_ms only expected Unix ms or GPS-epoch ms, so a seconds value fell under the 2020 cutoff and was read as GPS ms, decoding to 1980-01-26.

Impact in the integration: every once-a-minute GNSS fix looks older than the last trip-progress fix, so gnssLocation is never updated after navigation ends and the device tracker stays at its last trip position (and gnssTimeStamp/gnssError carry 1980 timestamps).

Change

  • Times below 10^11 (1973 in ms, year 5138 in seconds) are treated as seconds and multiplied by 1000, then the existing GPS-time check applies.
  • Test with the real value from a vehicle's log.
  • Updated the time comment in dynamics.proto (comment only; gencode unaffected).

🤖 Generated with Claude Code

Some vehicles send dynamics.vehicle.gnss's time in Unix seconds. Those
fell below the 2020 cutoff and were read as GPS-epoch milliseconds,
giving fixes dated January 1980. Times below 10^11 are now taken as
seconds before the GPS time check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@natekspencer
natekspencer merged commit 5cd77a9 into main Nov 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant