Offline hiking trails drawn only from zoom 10 (a whole country's lanes rebuilt per zoom froze the zoomed-out map); TODO: server in the car (RPi CM5) — builds on brick, offline login, HTTPS, Pi kiosk display, home ⇄ car sync with conflict handling, hardware buttons over CAN
CI / check (push) Successful in 19s
CI / deploy (push) Successful in 17s

This commit is contained in:
randy committed 2026-11-23 15:56:20 +01:00
1 parent 2470099877
commit fdd77986c1
2 files changed
+52 -5

No files matched your search

+47 -4
View File
@@ -161,10 +161,10 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
=== 3D navigation mode
* [ ] A "follow" mode like a car navigation: camera locked to the GNSS position, rotated to the
heading, pitched ~60°, smooth easing; the rotation lock released while it's on. The pieces
exist: pitch toggle, raster-dem terrain (MapLibre can also do real 3D relief from it),
Liberty's `building-3d` extrusions
* [x] A "follow" mode like a car navigation: camera locked to the GNSS position, rotated to the
heading, pitched ~60°, smooth easing — the tracker's "Navigate" (see the Tablet-friendly
section); follows the MQTT tracker, not the browser's own GNSS control yet
** [ ] Real 3D relief from the raster-dem terrain and Liberty's `building-3d` extrusions while navigating
* [ ] While following a planned route: the route ahead highlighted, distance to the next
maneuver from Valhalla's directions
@@ -174,6 +174,49 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
* [ ] Victron/Home Assistant via MQTT or WebSocket — battery SoC, tank levels, temperatures
* [ ] Plot GPS track with historical battery/speed data
== Server in the car (RPi CM5, 8 GB)
The tablet talks to a server far away today, so without internet nothing loads. Moving the
server into the car (on the car's Wi-Fi, next to the MQTT broker) makes everything that's
already offline work on the road. The Pi only serves; heavy builds stay on brick.
* [ ] Run the existing docker-compose stack on the CM5 (arm64: our image handles it, check
that the Valhalla and kiwix-serve images have arm64 builds); data on NVMe, not the SD card
* [ ] Build on brick, ship to the Pi: `offline.pmtiles`, `terrain.pmtiles`, Valhalla
`tiles.tar`, `places/*.sqlite`, `hiking_trails/*.geojson`, the ZIM — an rsync (only when
refreshed, which is rare) instead of the Pi's own build buttons; hide/disable those there
* [ ] Login without internet: Gitea OAuth can't run offline — let the car's LAN through
without login (e.g. `TRUSTED_NETWORKS` CIDR list), or a local fallback account
* [ ] HTTPS on the LAN (the secure session cookie, the PWA and the service worker need it):
the same hostname resolved to the Pi by the car router's DNS, Let's Encrypt cert via DNS-01
* [ ] A touch display on the Pi itself (USB touchscreen, Chromium in kiosk mode on
`http://localhost`) as the car display — solves a lot at once: localhost is a secure
context (no certificate needed for the PWA/service worker) and can skip login, it doesn't
depend on the car's Wi-Fi, buttons plug straight into the Pi (a USB/BLE keypad is just a
keyboard to Chromium, a CAN keypad via SocketCAN on the Pi). The tablet/phone stay optional
* [ ] Sync home ⇄ car — two servers, each fully usable on its own:
** Bulk data (pmtiles, Valhalla tiles, places, hiking trails, ZIM) only on the home network
(the car joining the home Wi-Fi as the trigger), never over LTE
** User data (library: folders/items/notes, tracker settings, logged trail) whenever both
ends are reachable, LTE included — small, incremental
** Builds on the library's existing pieces (docs/library-design.adoc): `rev` change counter,
`GET /api/library/changes?since=<rev>`, tombstones, `item_history` for the losing version.
Missing for two servers: per-peer high-water marks (my rev on your side and vice versa),
ids that never collide (UUIDs, already for items), and a base version per item so a real
conflict (both sides changed since the last sync) is told apart from a plain update
** Conflicts: per item, newer `updated_at` wins (clocks: the Pi needs NTP/GNSS time), the
other version into `item_history` and flagged in the UI so it can be restored; a delete vs.
an edit keeps the edit
** Logged tracker positions: append-only, merged by timestamp, no conflicts
* [ ] Hardware buttons: keyboard shortcuts in the page (zoom, Navigate, night mode, …) — the
cheap way with any BLE/USB keypad that sends plain keys
* [ ] … and the full way: a CANopen keypad (Blink Marine style) on the CAN bus wired straight
to the Pi (SocketCAN `can0`) → the small CAN → MQTT bridge on the host (see "Later in the
van" above; NMT start, key bitmap from `0x180+node`, LEDs via `0x200+node`) → maptool → the
browser over Server-Sent Events; the page's state (navigating, night) back the same way to
light the keypad's LEDs. Server needs to know which browser is "the car display" (a
per-device switch — or simply the Pi's own kiosk display)
== Admin / ops tooling
* [ ] Offline build log readability — a failed pmtiles/terrain build currently surfaces as one