docs: add BUG-21 — OBD speed dropout mid-drive, GPS-only replay

This commit is contained in:
Mathieu Moran
2026-08-14 22:22:16 -04:00
parent 09eca4d39f
commit 0fa6cc4988
2 changed files with 21 additions and 0 deletions
+17
View File
@@ -24,6 +24,23 @@ 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 (proposed)**:
1. GPS-speed fallback in `_log_loop()` — when OBD speed is None/0 but GPS coords exist,
compute speed from the previous position (haversine / elapsed time) and log that as SPEED,
so the replay shows the real speed (sourced "gps").
2. Investigate why the OBD adapter didn't recover for ~20 min (reconnect on stalled reads).
---
## Resolved
+4
View File
@@ -2282,6 +2282,10 @@ logged as `BUG-XX` entries in [BUGS.md](./BUGS.md) (BUG-16 onward) and fixed + v
- **BUG-20 (server trip IDs inflate) — ✅ FIXED**: `trips.id BIGSERIAL` burned sequence values
on every upsert (recompute after each upload batch). Fixed: sequence clamped to `MAX(id)`
after each recompute + one-time renumber migration — trips now 1..10, sequence at 10.
- **BUG-21 (OBD speed dropout mid-drive) — OPEN**: ELM327 stopped returning speed for ~20 min
on 2026-08-13 (22:23:50→22:43:41 UTC); Pi logged NULL speed (no GPS-speed fallback), so the
replay shows 0 km/h for that stretch. Proposed: GPS-speed fallback in `_log_loop()` + OBD
reconnect on stalled reads.
Open items from the drive — fill in as reported:
- (none clock-related — BUG-17/BUG-18 closed 2026-08-14).