docs: close BUG-17 + BUG-18 — DS3231 RTC verified across power loss
This commit is contained in:
@@ -8,44 +8,6 @@ When CLOSED, move the entire entry to Resolved — don't duplicate.
|
||||
|
||||
## Open bugs
|
||||
|
||||
### BUG-17 — Server trip timestamps wrong after an offline period
|
||||
- **Status**: `OPEN` 2026-08-13
|
||||
- **Phase**: 29
|
||||
- **Symptom**: two trips from the 2026-08-13 drive have bad timestamps on the server:
|
||||
- Trip **25136** — time is wrong.
|
||||
- Trip **25137** — starts 09:59, then jumps to 14:xx after the first point.
|
||||
- **Cause (hypothesis)**: the Pi has no RTC, so while offline it runs on a stale
|
||||
`fake-hwclock` time; when NTP later re-syncs, the clock snaps forward, producing the
|
||||
timestamp jump mid-trip. Root cause is BUG-18.
|
||||
|
||||
### BUG-18 — Pi needs offline timekeeping (no RTC)
|
||||
- **Status**: `IN PROGRESS` 2026-08-14
|
||||
- **Phase**: 29
|
||||
- **Problem**: the Pi 3 has no real-time clock. Without internet (no NTP) the system clock
|
||||
is wrong across power cycles, corrupting tracking/trip timestamps (BUG-16/BUG-17).
|
||||
- **Progress 2026-08-14**: DS3231 module installed + working. Pi config done:
|
||||
`dtparam=i2c_arm=on` + `dtoverlay=i2c-rtc,ds3231` in `/boot/firmware/config.txt`,
|
||||
`i2c-tools` installed, `fake-hwclock` disabled, `i2c-dev` added to `modules-load.d`.
|
||||
The DS3231 now probes at `0x68` (`UU`), its 24C32 EEPROM at `0x57`, `/dev/rtc0` registered,
|
||||
and `hwclock -r` matches system time. (First scan was an empty bus — a data-line wiring
|
||||
issue, since resolved.)
|
||||
**Pending**: power-cycle persistence test — unplug, replug, confirm correct time at boot
|
||||
without NTP. Also: the charge diode was re-added during debugging and must be removed again
|
||||
for the CR2032.
|
||||
- **Fix plan (both, they complement each other)**:
|
||||
1. **DS3231 RTC module (primary)** — battery-backed RTC on the free I²C bus (SDA pin 3,
|
||||
SCL pin 5, 3.3V pin 1, GND pin 6). Enable `dtparam=i2c_arm=on` +
|
||||
`dtoverlay=i2c-rtc,ds3231` in `/boot/firmware/config.txt`, install `i2c-tools`, disable
|
||||
`fake-hwclock`. Use a **CR2032** and first **desolder the module's charging resistor +
|
||||
diode** (cheap ZS-042-style boards charge the coin cell — unsafe for a CR2032; the
|
||||
well-known DS3231 charging-circuit issue). Gives correct time instantly at boot, ±2 ppm.
|
||||
2. **SIM868 CR1220 RTC backup (secondary)** — the HAT has a CR1220 holder on the back
|
||||
(item 20). A CR1220 keeps the SIM868's internal RTC alive across power-off, enabling
|
||||
faster GNSS warm starts and letting the Pi optionally read the module time at boot
|
||||
(`AT+CCLK`) as an offline fallback.
|
||||
- Keep `systemd-timesyncd` for online NTP; fall back to the RTC (DS3231) and optionally
|
||||
GNSS time when offline.
|
||||
|
||||
### BUG-19 — Dashboard OBD values slow to appear while the car is running
|
||||
- **Status**: `OPEN` 2026-08-13
|
||||
- **Phase**: 29
|
||||
@@ -66,6 +28,29 @@ When CLOSED, move the entire entry to Resolved — don't duplicate.
|
||||
|
||||
## Resolved
|
||||
|
||||
### BUG-18 — Pi needs offline timekeeping (no RTC)
|
||||
- **Status**: `CLOSED` 2026-08-14
|
||||
- **Commit**: `PENDING`
|
||||
- **Fix**: DS3231 RTC module installed on the free I²C bus (SDA pin 3, SCL pin 5, 3.3V pin 1,
|
||||
GND pin 6) with a CR2032 (charge diode removed). Pi config: `dtparam=i2c_arm=on` +
|
||||
`dtoverlay=i2c-rtc,ds3231` in `/boot/firmware/config.txt`, `i2c-tools` installed,
|
||||
`fake-hwclock` disabled, `i2c-dev` persisted via `modules-load.d`. CR1220 also installed in
|
||||
the SIM868 HAT holder (secondary RTC backup).
|
||||
- **Verification**: DS3231 probes at `0x68` (`UU`), its 24C32 EEPROM at `0x57`, `/dev/rtc0`
|
||||
registered. Power-cycle test passed — after a full unplug/replug the boot log reads
|
||||
`setting system clock to 2026-08-14…` from the RTC (was `2000-01-01` before), and
|
||||
`hwclock -r` matches system time. (Debugging note: the first scans were an empty bus due to
|
||||
a data-line wiring issue, resolved during re-soldering.)
|
||||
|
||||
### BUG-17 — Server trip timestamps wrong after an offline period
|
||||
- **Status**: `CLOSED` 2026-08-14
|
||||
- **Commit**: `PENDING`
|
||||
- **Fix**: root cause was BUG-18 — no RTC, so offline the Pi ran on a stale `fake-hwclock`
|
||||
time and NTP snapped the clock forward mid-trip. Fixed by installing the DS3231 (BUG-18).
|
||||
- **Verification**: RTC power-cycle test passed (BUG-18). Historical trips 25136/25137 keep
|
||||
their bad timestamps (raw tracking rows were recorded with a wrong clock and can't be
|
||||
retroactively corrected) — future trips will be correct.
|
||||
|
||||
### BUG-15 — Phone can't host the hotspot and connect to the Pi's AP at once
|
||||
- **Status**: `CLOSED` 2026-08-13
|
||||
- **Commit**: `ab79820`
|
||||
|
||||
@@ -2272,13 +2272,15 @@ logged as `BUG-XX` entries in [BUGS.md](./BUGS.md) (BUG-16 onward) and fixed + v
|
||||
set and local trip building was silently blocked since BUG-10. The flag is now persisted
|
||||
across reboots; also fixed a NULL-GPS speed-only row crash in the trip builder. Verified the
|
||||
2026-08-13 drive now appears locally.
|
||||
- **BUG-17 (trip timestamps wrong) — OPEN**: no RTC → clock drifts without internet.
|
||||
- **BUG-18 (no RTC) — 🚧 IN PROGRESS**: DS3231 installed + configured + detected on I²C (`0x68`),
|
||||
`hwclock` reads correct time; `fake-hwclock` disabled; `i2c-dev` persisted. Pending the
|
||||
power-cycle persistence test. Secondary: SIM868 CR1220 RTC backup still to install.
|
||||
- **BUG-17 (trip timestamps wrong) — ✅ FIXED**: root cause was BUG-18 (no RTC). Fixed by the
|
||||
DS3231 install; historical trips 25136/25137 keep their bad data, future trips will be correct.
|
||||
- **BUG-18 (no RTC) — ✅ FIXED**: DS3231 on I²C (`0x68`) + CR2032 (charge diode removed), config
|
||||
(`dtparam=i2c_arm=on` + `dtoverlay=i2c-rtc,ds3231`), `fake-hwclock` disabled, `i2c-dev`
|
||||
persisted. Power-cycle test passed — boots with correct time from RTC. SIM868 CR1220 also
|
||||
installed (secondary). Optional follow-up: `AT+CCLK` boot-time clock fallback in `app_gps.py`.
|
||||
|
||||
Open items from the drive — fill in as reported:
|
||||
- BUG-17 (clock) — blocked on BUG-18 power-cycle verification.
|
||||
- (none clock-related — BUG-17/BUG-18 closed 2026-08-14).
|
||||
|
||||
## Working Notes / Environment Gotchas
|
||||
|
||||
|
||||
Reference in New Issue
Block a user