diff --git a/BUGS.md b/BUGS.md index aca528c..d8ae0a7 100644 --- a/BUGS.md +++ b/BUGS.md @@ -38,9 +38,19 @@ When CLOSED, move the entire entry to Resolved — don't duplicate. - **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). -- **Fix direction**: add a battery-backed RTC (DS3231) on I²C so time survives power-off, - and/or derive time from the SIM868 GNSS fix (GPS time) while offline. Keep - `systemd-timesyncd` for online sync and fall back to the RTC/GNSS source when offline. +- **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. --- diff --git a/PLAN.md b/PLAN.md index 7c18b07..c3d7920 100644 --- a/PLAN.md +++ b/PLAN.md @@ -2273,7 +2273,8 @@ logged as `BUG-XX` entries in [BUGS.md](./BUGS.md) (BUG-16 onward) and fixed + v 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) — OPEN**: add a battery-backed RTC (DS3231) / GNSS time source. +- **BUG-18 (no RTC) — OPEN**: plan set — DS3231 RTC on I²C (desolder charging circuit, CR2032) + + SIM868 CR1220 RTC backup; NTP online, RTC/GNSS fallback offline. Open items from the drive — fill in as reported: - BUG-17 / BUG-18 (clock) pending.