Docs and TODO after the MilCAN / NGVA notes (docs/design.adoc "What the military vehicles do"): Silent Watch, Blackout of our own devices, a hardware interlock; the Pi on 12 V only behind a HAT with an STM32C5 (power supervisor, watchdog, the Pi's CAN, 5.1 V / 5 A); the outputs' controller moves to that STM32C5 ("The controller on the Pi's HAT": requests from keypads, mcu-lvgl and maptool, Zephyr, 16 MB flash for MCUboot and a black box; native_sim on SocketCAN first). TODO: can.json curves, multiplexing and warning limits after candinista; the mcu-lvgl panel in the Garmin style; TPMS off the car's CAN; Android Auto with the Pi as the phone (AOA over USB-OTG); a universal STM32C5 board v1 with TCAN1043
This commit is contained in:
1 parent
cba14300b5
commit
462303eed6
2 files changed
+208
-14
No files matched your search
@@ -254,6 +254,17 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
|
||||
names) or a vxcan pair moved into the container's namespace by a host script
|
||||
** [ ] The car-CAN → CANopen bridge's mapping (not decided yet) as signals in `data/can.json`;
|
||||
a dashboard panel for the `car.*` signals
|
||||
** [ ] Signals in `data/can.json`, after candinista (github.com/mikeypi/candinista, its
|
||||
`config.yaml`) — for third-party devices whose conversion we can't change:
|
||||
*** [ ] A sensor curve: `x_values` → `y_values`, linear interpolation between points (NTC
|
||||
temperature senders, pressure sensors), instead of `scale` / `offset`
|
||||
*** [ ] Multiplexed signals: one byte of the frame says which channel it carries (`mux_byte`,
|
||||
`mux_value`; e.g. Haltech TPMS, wheel 1–4 on one ID)
|
||||
*** [ ] Warning limits per signal (`low_warn`, `high_warn`): the value coloured on its tile
|
||||
** [ ] A display node on the CANopen bus (`mcu-lvgl`, ESP32-8048S043, 4.3" 800×480, LVGL) with
|
||||
its own switch screens — it only sends requests to the controller and draws the state the
|
||||
controller reports, so it works with the Pi off. The look: Garmin style, picked in the Design
|
||||
canvas (PanelGarmin: Switches, Power, Tanks, Settings; the status bar is the navigation)
|
||||
** [x] The GNSS node's PDO layout as `gnss.*` signals — `mcu-stm32-xiao-c5-2` (node 0x21,
|
||||
esphome-canopen), `data/can.json` in docs/deployment.adoc
|
||||
** [x] `/can.html` diagnostics: interfaces, nodes (heartbeat, last EMCY, what they send),
|
||||
@@ -307,6 +318,12 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
|
||||
** [ ] Off the route: the gyro's yaw rate (the IMU node) or the compass, with map matching
|
||||
** [ ] Back out of the tunnel: the first fixes taken only once consistent (HDOP, the jump from
|
||||
the estimate); the trip log keeps a straight line through the tunnel for now
|
||||
* [ ] TPMS off the car's CAN (2026-12-05): the car's own TPMS read by the car gateway and passed on
|
||||
as `car.tpms.*` signals in `data/can.json` (the 4 wheels, pressure, temperature where sent);
|
||||
warnings: low pressure, a fast drop (a puncture). Find where the Yaris Cross has it — broadcast
|
||||
on a CAN the gateway sees, or only on request (UDS from the TPMS ECU). No radio node of our own;
|
||||
sniffing the 433 MHz sensors (`rtl_433` on the uConsole's SDR) only if the car's CAN doesn't
|
||||
carry it
|
||||
|
||||
=== 3D navigation mode
|
||||
|
||||
@@ -399,16 +416,32 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
|
||||
*** [ ] Brick ↔ the car: a trip planned at home on brick handed to the car's server (with
|
||||
the library sync, or "send to the car")
|
||||
*** [ ] Push instead of polling (SSE) if 2 s ever feels slow
|
||||
** [ ] Android Auto: the browser can't be cast there, only a native app — a small one with
|
||||
the Car App Library's NavigationTemplate drawing its own map surface (MapLibre Native) off
|
||||
the car server's trip and position (`/api/trip`, `/api/gnss/position`); only the map and
|
||||
the next maneuver, planning stays on the web. Testable without the car: the tablet runs the
|
||||
Android Auto head unit emulation (DHU)
|
||||
** [ ] Android Auto with the Pi as the phone (2026-12-05): the Pi connects to the car's existing
|
||||
Android Auto and shows maptool's navigation to the driver on the car's screen; the display on
|
||||
the Pi / the tablet over Wi-Fi are the navigator's. No phone in the loop
|
||||
*** [ ] Over USB first: the head unit is the host, switches the "phone" into Android Open
|
||||
Accessory (AOA) mode, then the Android Auto protocol (AAP over TLS). The Pi must be a USB
|
||||
gadget — USB-OTG: the Pi 5's USB-C port (`dwc2` peripheral), on a CM5 whether its carrier
|
||||
brings out the USB 2.0 port; power from the HAT through the header, the USB-C data only
|
||||
(car VBUS not connected). Wireless (Bluetooth, then Wi-Fi) later
|
||||
*** [ ] First check the head unit accepts a foreign phone side: AARE
|
||||
(github.com/prototux/AARE, an open phone-side reimplementation, an Android app) on a phone
|
||||
in the Yaris Cross; from AARE, whether the head unit checks the phone's certificate (if it
|
||||
wants a Google-signed one, this way is closed). No open phone side for Linux was found
|
||||
*** [ ] Then a Linux phone side (the AAP messages are aasdk's protobufs, the same both ways),
|
||||
tested at home against Google's Desktop Head Unit. Video is H.264: the Pi 5 / CM5 have no
|
||||
hardware encoder, so software (x264 ultrafast) at the head unit's 800×480 or 1280×720,
|
||||
30 fps, one or two cores. Back from the car: touch and the rotary into maptool; to the car:
|
||||
navigation prompts on AA's own audio channel, the turn arrows in the cluster where supported
|
||||
*** [ ] Fallback: a native app on the phone — the Car App Library's NavigationTemplate drawing
|
||||
its own map surface (MapLibre Native) off the car server's trip and position (`/api/trip`,
|
||||
`/api/gnss/position`); only the map and the next maneuver, planning stays on the web
|
||||
*** [ ] Views by who's driving off which screen: no Android Auto connected → the 16" display
|
||||
shows the 3D follow view (heading-up, pitched) for the driver; Android Auto connected → it
|
||||
streams the 3D navigation to the driver, and the co-driver's display stays 2D (north-up
|
||||
overview, planning). Needs the app to report connected/disconnected to the server (e.g.
|
||||
next to `/api/gnss/position`) and the driving view to switch on it
|
||||
overview, planning). Needs the Android Auto link (the Pi's phone side, or the fallback app)
|
||||
to report connected/disconnected (e.g. next to `/api/gnss/position`) and the driving view
|
||||
to switch on it
|
||||
** [ ] A native Android app on Ferrostar (rerouting, Valhalla speed limits, TTS built in) over
|
||||
our Valhalla (`format: osrm`) — only if navigation is wanted on a phone outside the car; the
|
||||
car's 16" display is the Pi's browser either way. Ferrostar's web components are beta: no
|
||||
@@ -466,6 +499,21 @@ Planning in the NPS look, driving in the cockpit look, joined by the Unigrid bla
|
||||
Inspired by Garmin Tread / zūmo, but open and over CANopen — the nodes' side and the options
|
||||
are in home-gitops `docs/canopen-nodes.adoc` ("Inšpirácia: Garmin Tread / zūmo"):
|
||||
|
||||
* [ ] A universal STM32C5 board v1 (2026-12-05) instead of XIAOs (~9 € + VAT + 10 € postage
|
||||
each; out of stock) and before role-specific boards — one design, one round of first-spin
|
||||
fixes, 8–10 pieces for the IO nodes, the car gateway, the Meshtastic bridge, the
|
||||
controller prototype. JLCPCB in batches, Basic parts assembled, the MCU by hand. The bare MCU
|
||||
isn't reliably in stock either (TME showed 0, ~3.6 USD) — check before ordering the PCBs
|
||||
** STM32C5A3CGT6 (LQFP48), 16 MB flash on QSPI (W25Q128, as on the XIAO, for Zephyr)
|
||||
** 2× CAN transceiver, both TCAN1043 (CAN FD, VIO for 3.3 V, wake on bus traffic or the local
|
||||
WAKE pin, INH switching the board's regulator → Silent Watch at µA); one part everywhere (one
|
||||
JLCPCB extended-part fee), ~0.4–1 USD more than a TJA1051 at LCSC. Not selective wake
|
||||
(TJA1145 / TCAN1145, SPI): any bus traffic wakes every node, fine while the bus is quiet
|
||||
** Automotive 12 V in: reverse polarity, TVS, a buck to 3.3 V; SWD; the power + CAN connector
|
||||
the same as the xt30_can_5v board (XT30 2+2)
|
||||
** Headers with every free GPIO, SPI and UART: role add-ons on top — an output board, a
|
||||
Meshtastic radio on UART (its firmware doesn't run on the C5)
|
||||
|
||||
* [ ] Hardware buttons (a CANopen keypad / a steering-wheel controller, read off `can0`):
|
||||
actions in `data/can.json` — pan, zoom ±, add a point (the position into the library or the
|
||||
trip), mark a place, switch views (navigation / overview / dashboard), mute / volume, the
|
||||
@@ -476,6 +524,17 @@ are in home-gitops `docs/canopen-nodes.adoc` ("Inšpirácia: Garmin Tread / zūm
|
||||
*** [x] Positions, strobe and dimmer (2026-12-04): a key steps through outputs (a knob up and down), blinking with a period, a knob's level by a step (a dimmable module: a byte per channel); in /keypad.html and /sim.html. Nothing real behind them yet
|
||||
*** [x] Switch tiles on the screen (2026-12-04, the canvas' GridSwitches): Menu → Switches (only when `/api/outputs` answers), 3×3 tiles per page (name, On / Off / Flashing / level, the key and mode driving it, its LED colour line), a group per module, All off, More ▸; a tap toggles (`switchesMenu` in `drive_menus.js`)
|
||||
*** [ ] Interlocks and conditions (speed, ignition), long press
|
||||
*** [ ] The controller moves to the STM32C5 on the Pi's HAT (docs/design.adoc "The controller on
|
||||
the Pi's HAT", 2026-12-05): first the CANopen objects for requests (toggle / on / off / level
|
||||
from keypads, `mcu-lvgl`, maptool), the outputs' state (TPDO) and the configuration (bindings
|
||||
over SDO), used by maptool's `outputs.rb` now; then the Zephyr firmware (MCUboot's second slot,
|
||||
the black box and the bindings in the 16 MB external flash), checked against `outputs.rb`;
|
||||
maptool fetches the black box when it comes up
|
||||
**** [ ] Before more STM32C5 boards arrive (both XIAOs are in use): the controller in Zephyr as
|
||||
`native_sim` on SocketCAN (`zephyr,native-linux-can`) — on a PC against `vcan0` with
|
||||
`/sim.html` and the simulated outputs, on rpi-dev against `can0` and the real keypads; the
|
||||
external flash emulated in a file; the same inputs give the same outputs as `outputs.rb`.
|
||||
Only the chip's layer (CAN, flash, power) moves to the board later. Order more XIAO STM32C5
|
||||
** [x] CANopen TIME from maptool while no node sends it (2026-12-04, `lib/maptool/can_time.rb`); the GNSS node takes over once esphome-canopen has TIME
|
||||
*** [ ] A knob's hold (the eye), the focused row's badges in keypad mode, the knobs' LEDs (8Encoder colours over SDO)
|
||||
** [x] The key mapping in our diagnostics (2026-12-04, `/keypad.html`, the canvas' GridBinding): pick a key or knob (or press it), what it drives, mode, menu, LEDs; saved per car in `data/drive/bindings.json`. Not yet: interlocks, conditions, long press; drive mode picks a change up only on reload
|
||||
@@ -483,6 +542,14 @@ are in home-gitops `docs/canopen-nodes.adoc` ("Inšpirácia: Garmin Tread / zūm
|
||||
* [ ] A virtual switch panel for the PDM node (like Garmin's PowerSwitch: tiles with icon,
|
||||
label, state and current, groups) + rules: by speed, sun/time of day, geofence (the trip's
|
||||
camp), ignition and battery voltage
|
||||
** [ ] Blackout / camp mode: one key — keypad LEDs ~2 % dim red, screen Night at its lowest,
|
||||
auxiliary outside lights off and inhibited (door → awning light) until left; road lights untouched
|
||||
** [ ] Sleep (Silent Watch): outputs to their safe state, nodes NMT stopped / asleep, screen off;
|
||||
what wakes them (a key, ignition / wake line, CAN wake-up) — node side in home-gitops
|
||||
`docs/canopen-nodes.adoc` (TCAN1043 on every board: wake + INH, transparent until the firmware
|
||||
uses its EN / nSTB pins; the "everyone to sleep" command from the controller)
|
||||
** [ ] A node's hardware interlock (winch, inverter, heater off on a wire, MCU or bus dead or not)
|
||||
shown on its tiles as "locked out"
|
||||
* [ ] The group over LoRa (Meshtastic / MeshCore through a node on the Pi): the others' positions
|
||||
as a live layer with trails, short messages, "come here" into the trip
|
||||
* [ ] Audio: volume / mute from the keypad and the app, navigation prompts ducking the music
|
||||
@@ -509,6 +576,16 @@ already offline work on the road. The Pi only serves; heavy builds stay on brick
|
||||
* [ ] 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
|
||||
* [ ] Powering the Pi (docs/design.adoc "What the military vehicles do"): preferred, the Pi on
|
||||
12 V only, anywhere in the car — the gateway node tells "car running" (car CAN data or its IGN
|
||||
input); a HAT with an STM32C5 turns the Pi on (car running, or a wake from the network), asks
|
||||
it to shut down cleanly and cuts power after, measures voltage / current; the HAT also has the
|
||||
Pi's CAN (SPI controller + transceiver, `can0`), the STM32C5 a node on the same bus and the Pi's
|
||||
watchdog (maptool's heartbeat — it sends none yet —, power-cycle when it hangs). The Pi 5 takes
|
||||
5 V only and wants ≥ 5 A: the HAT's buck 5.1 V / 5 A+ into the header's 5 V pins, and
|
||||
`PSU_MAX_CURRENT=5000` in the EEPROM (powered off the header it can't tell, and limits USB to
|
||||
600 mA); the 12 V side survives a cold crank or shuts down cleanly. Fallback: the Pi on
|
||||
the bus, 6-pin Deutsch DT (12 V, GND, CAN H, CAN L, IGN, spare), IGN read by the Pi
|
||||
* [x] 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. Done: the
|
||||
session cookie is checked locally (90 days, no Gitea after the login), and rpi-dev has
|
||||
|
||||
Reference in new issue
Block a user