docs: close BUG-21 (GPS-speed fallback verified)

This commit is contained in:
Mathieu Moran
2026-08-14 22:37:21 -04:00
parent 2fee2de357
commit 7c8f27b84d
2 changed files with 18 additions and 23 deletions
+14 -19
View File
@@ -24,29 +24,24 @@ When CLOSED, move the entire entry to Resolved — don't duplicate.
fills the cards immediately on load (and every 15 s) via REST. Needs in-car
verification.
### BUG-21 — OBD speed drops out mid-drive, replay shows 0 km/h (GPS-only)
- **Status**: `OPEN` 2026-08-14
- **Phase**: 29
- **Symptom**: in the portal trip replay, a ~20-minute stretch of the 2026-08-13 evening
drive shows "GPS: 0.0 km/h" even though the car was moving (GPS positions advance).
- **Cause**: the Pi's OBD adapter (ELM327) stopped returning speed mid-drive — the last OBD
speed reading in trip #9 was 22:23:50 UTC and it didn't return until 22:43:41 UTC (trip #10),
a ~20-minute gap. During that gap `_log_loop()` logged rows with GPS coords but NULL speed
(`insert_tracking(gps_x, gps_y, speed=None, …)`) — there is no GPS-derived speed fallback, so
the SPEED column stays NULL and the replay shows 0.0 km/h (`speed_source="gps"`).
- **Data**: trip #9 has 723 points — 570 with OBD speed, 25 with speed=0, 128 with NULL speed.
- **Fix**: mirror the Pi's `route_points` GPS-speed fallback in the server's `get_trip_route()`
(`server/modules/db.py`) — when OBD speed is missing, derive speed from the previous point's
movement (haversine / elapsed time, ≥8 m, ≤220 km/h) so the replay shows the real speed
instead of flatlining at 0 km/h. (The Pi's own replay already did this; only the portal was
missing it.)
- **Follow-up**: investigate why the OBD adapter didn't recover for ~20 min (reconnect on
stalled reads).
---
## Resolved
### BUG-21 — OBD speed drops out mid-drive, replay shows 0 km/h (GPS-only)
- **Status**: `CLOSED` 2026-08-14
- **Commit**: `PENDING`
- **Fix**: the Pi's OBD adapter (ELM327) stopped returning speed for ~20 min on 2026-08-13
(last OBD reading 22:23:50 UTC, back at 22:43:41 UTC), so the portal replay flatlined at
0 km/h for that stretch. The server's `get_trip_route()` now mirrors the Pi's `route_points`
GPS-speed fallback — when OBD speed is missing it derives speed from the previous point's
movement (haversine / elapsed time, ≥8 m, ≤220 km/h). The Pi's own replay already did this;
only the portal was missing it.
- **Verification**: trip #9 points at 22:23:55 previously returned speed 0.0 — now return
GPS-derived speeds (e.g. 61.9 km/h at 22:23:55, labelled `gps`). API rebuilt + healthy.
- **Follow-up**: investigate why the OBD adapter dropped for ~20 min (reconnect on stalled
reads).
### BUG-20 — Server trip IDs inflate far beyond the real trip count
- **Status**: `CLOSED` 2026-08-14
- **Commit**: `9af71e2`