Fix GPS modem selection and add a GPS-only time source

This commit is contained in:
Luxferre committed 2026-11-10 13:18:14 +02:00
1 parent eaf08abcd4
commit a50c01b416
18 files changed
+682 -16

No files matched your search

+16
View File
@@ -611,7 +611,9 @@ The **Xlibre** display server (`modesetting_drv.so`) uses **Glamor + DRI3 + GLX
bananarchy-gps nmea # print raw NMEA sentences from ModemManager / QMI PDS
bananarchy-gps watch 2 # continuously poll GPS fix and satellite telemetry every 2s
bananarchy-gps disable # stop standalone GNSS engine to save power
bananarchy-gps modem # show the resolved ModemManager modem and its location capabilities
```
All CLI and `gps.so` queries go through `/usr/bin/bananarchy-gps-modem.sh`, which picks the modem advertising `gps-nmea` (with `--location-enable-3gpp`, `--location-enable-gps-nmea`, `--location-enable-gps-raw`, `--location-set-gps-refresh-rate=2` and `--enable`). Plain `mmcli -m any` is ambiguous on the dual-SIM 2720 Flip and used to leave every GPS query empty.
### 5.7 Network time synchronisation (`bananarchy-time-sync.sh`)
@@ -625,6 +627,20 @@ bananarchy-time-sync.sh force # re-resolve the pool and burst immediately
bananarchy-time-sync.sh sync # force and print a human-readable result
```
### 5.8 GPS-only system time (`bananarchy-gps-time-sync.sh`)
**Config -> Time source** toggles between `Network (NTP)` (the default) and `GPS only`. In GPS-only mode `chronyd` is stopped, `bananarchy-time-sync.sh` declines every boot/network-up/force NTP burst, and the system datetime is set **solely** from GNSS: `/usr/bin/bananarchy-gps-time-sync.sh` enables the modem's location sources, reads either ModemManager's `modem.location.gps.utc` or a valid `$GNRMC`/`$GPRMC` fix, steps the clock with `date -u -s`, writes the RTC with `hwclock -w -u`, and republishes the status bar clock. No DNS, NTP pool or network connection is used. The boot service calls `boot` in this mode, so a cold start with a 1970 RTC still recovers the date from GPS.
**Config -> Sync GPS time** (`/usr/bin/bananarchy-sync-gps-time.sh`) runs the same one-shot sync immediately and shows the resulting UTC timestamp (or the failure reason) as a notification; it works in either time-source mode. From the shell:
```bash
bananarchy-gps-time-sync.sh get # network | gps
bananarchy-gps-time-sync.sh source gps # select GNSS as the sole source
bananarchy-gps-time-sync.sh source network # restore NTP and chronyd
bananarchy-gps-time-sync.sh sync # one-shot GPS clock step
bananarchy-gps-time-sync.sh status # source, last fix, modem capabilities
```
---
## 6. Rebuilding the OS from a clean clone