Files

578 lines
28 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
= Design: the park brochure and the cockpit
MapTool has two jobs with two moods, and a style for each:
* *Planning, dreaming, remembering* — the map, the library, the trip, the
search: the *NPS* look. Warm Park Tiles cartography (`map_themes.js`),
the brochures and their symbols (`docs/nps-resources.adoc`), the olive
accent.
* *Driving* — whatever the driver glances at: the dashboard, the next
maneuver, the speed limit, the switch panel, warnings: the *cockpit*
look. Avionics (PFD/MFD) and chartplotters: displays over a bus, dark
bezel, big numbers, no decoration, colors that always mean the same.
They aren't two designs bolted together: the NPS brochures are Massimo
Vignelli's *Unigrid* (1977) — a strict grid, a black band with a white
sans-serif title, lots of white space, few colors. That's the same
modernist restraint as a glass cockpit. The black band is the shared
element: the topbar (`#1a1a1a`) is the brochure's band, the instruments'
bezel is the same black.
== Colors
Defined once as custom properties on `:root` (`public/css/style.css`);
nothing outside them for these meanings.
=== Planning (NPS)
[cols="1,1,3"]
|===
|Token |Value |Use
|`--accent` |`#546619` |active items, selected options, primary buttons (NPS boundary olive)
|`--accent-bg` |`#e1e5cf` |their light background (sage)
|`--band` |`#1a1a1a` |the Unigrid black band: the topbar, panel headers, and the instruments' bezel
|===
The map's own colors are Park Tiles' (`map_themes.js`), not tokens.
=== Instruments (cockpit)
Each color has one meaning, as in avionics — so a glance is enough and
a color never decorates.
[cols="1,1,3"]
|===
|Token |Value |Means
|`--inst-bezel` |`--band` at the card's opacity |the instrument's background
|`--inst-text` |`#f2f2f2` |values
|`--inst-muted` |`#9aa0a6` |labels, scales, what's inactive
|`--inst-ok` |`#3ccf4e` |normal, engaged (a switch on, a node alive)
|`--inst-caution` |`#ffb300` |attention: past a soft limit (roll > 20°), off the route, a stale signal
|`--inst-warning` |`#ff3b30` |act now: over the speed limit, past a hard limit, a fault
|`--inst-active` |`#e040fb` |*magenta*: the active route and the next waypoint / maneuver / lane to take — the avionics convention for what navigation is following
|`--inst-selected` |`#00d5ff` |*cyan*: a value you set yourself (a speed bug, the camper's own limit, a chosen target)
|===
Road signs stay road signs: the speed limit is the white disc with the
red ring — read as a sign, not as a color (`--sign-*`, only dimmed by
night).
=== Day, dusk, night (after IHO S-52)
Marine electronic charts (ECDIS) have the most worked-out rules for one
display across bright sun and a dark bridge — the IHO's S-52 (Edition
6.1.1, 2015): *three colour tables, Day, Dusk and Night*, every color a
named token with a value per table (the Presentation Library's Appendix
A). We do the same: the tokens above, three sets of values, `<html
data-palette="dusk|night">` (Day the default), meanings unchanged between
them. From S-52:
* *Day*: a light background with dark foreground details, strong contrast —
bright sun washes a display out. (Our instruments keep their dark bezel,
a full-opacity one for sun on the screen.)
* *Dusk*: a black-background table, "for optional use by day as well as at
twilight".
* *Night*: dark background, light foreground, dim enough not to impair night
vision; at low light colors are hard to tell apart, so important things
get a second cue (shape, line style), not color alone. Adjust by
contrast, not brightness (dark colors drop to black).
* Anything added on the chart's screen (panels, text) "should never generate
more light than the chart display itself" at night, and text panels
mustn't outshine the chart.
Our night values are roughly a third of Day's luminance, warm greys, blue
kept low; no white areas (the speed limit sign dims too). The map has its
own night palette (`NightMap`, `map_themes.js`); a Dusk map is still to do.
The night mode sets the palette (`map.js`): automatic by the sun or on →
Night (with the night map), "◑" → Dusk over the day map, off → Day. The
planning UI's greys are the `--ui-*` tokens (`--ui-bg`, `--ui-bg-2` for
hover, fills and the section bands, `--ui-line`, `--ui-fg`, `--ui-muted`);
MapLibre's controls and popups take them too, and a dark palette sets
`color-scheme: dark` (native checkboxes, scrollbars) and lifts the map
controls off the dark map (`--ui-bg-2` with a `--ui-line` ring). The first
try (2026-12-01) left the section bands light, checkboxes white and the
controls black on black — tokens missed by the first pass.
The driving mode (`driving.js`, "Drive" in the topbar) is the cockpit's
input side: big band-black buttons down the map's left — follow, zoom,
2D/3D, night, the route overview — and the planning sidebar hidden.
=== How others switch day and night (research, 2026-12-01)
[cols="1,3"]
|===
|Who |How
|Garmin G1000 / G3X (aviation)
|Color scheme *Day / Night / Auto* apart from the *backlight*, which a
photocell sets on its own (a curve between a minimum and maximum, and a
time constant so it doesn't jump), or the aircraft's dimmer bus, or by
hand (down to 0.22 % on the PFD).
|Garmin GPSMAP (boats)
|Color mode Day / Night / Auto (by the time of day or the light outside);
the night scheme itself selectable: *full color, red and black, or green
and black*; the backlight a setting of its own; display settings shared
with the other displays over NMEA 2000. Night charts "in muted tones
with enhanced contrast".
|Raymarine (boats)
|Night mode: red text and icons on dark backgrounds; warns that going
back to Day at night jumps to full brightness and spoils night vision.
|Garmin zūmo (motorbikes)
|Day / Night / Auto (by the time of day), brightness by hand — no
light sensor found in the manuals.
|Ships (IMO MSC.191(79), IEC 62288, S-52)
|Colors and brightness for daylight, dusk and night, readable everywhere
on the bridge "with due consideration to the night vision" of the watch;
color never alone (size, shape, orientation too), red for alarms.
Furuno: Day / Dusk / Night palettes, each in a gray or blue variant, at
about 110 / 50 / 5 cd/m²; JRC: Day Bright, Day Whiteback, Day Blackback,
Dusk, Night.
|Android Auto / CarPlay (cars)
|Automatic by the car's headlights or its light sensor, Day / Night by
hand; known to flip in tunnels and under bridges.
|===
What it means for us:
* *Colors and brightness are two controls.* Everyone keeps the palette
(which colors) apart from the backlight (how bright); Night at ~5 cd/m²
is a backlight thing — CSS can't get a lit display that dim. The car's
display's backlight (DDC/CI or the panel's own dimmer) wanted for that.
* *Auto by what the vehicle knows:* the sun today; the headlights from
the car's CAN once they're on the bus (as Android Auto), a light sensor
on a node later (as the photocell) — with hysteresis, not flipping in a
tunnel.
* *A red night* (red/black) as Garmin's and Raymarine's option, for the
darkest roads.
* *One setting for all the car's screens* (Garmin shares it over NMEA
2000): the night mode the server's, not each browser's, when they're in
the same car.
* *No flash on the way back to Day* at night: the switch eased in.
Sources: Garmin G1000 manual (Display backlighting); Garmin G3X install
manual (photocell parameters); Garmin GPSMAP display settings and
"Changing the color mode" help pages; Garmin's "Navigate confidently in
the dark" blog; Raymarine display mode docs; Garmin zūmo 395/396 display
settings; IMO MSC.191(79) §5.3, §5.5; Furuno FAR-2107 / FE-800 and JRC
JAN-701B manuals; Google Maps / Waze help and 9to5Google on Android Auto.
=== Buttons while driving: how others do it (research, 2026-12-01)
Our driving bar (`driving.js`) came from OsmAnd's map buttons: seven
76×64 px buttons down the left (follow, zoom ±, 2D/3D, night, route
overview, exit). What the others do:
[cols="1,3"]
|===
|Who |How
|Android Auto (Google's car design guidelines)
|Touch targets at least *76×76 dp* (the distance to the head unit, quick
taps); content readable in *2 s*, a response within 0.25 s; the map's
*action strip at most four buttons* (pan, recenter, zoom in/out). Google
Maps: *recenter only appears once the map was moved* and goes when
tapped; the compass toggles heading-up / north-up; route overview,
sound (mute / alerts only) and report on the edges.
|Garmin zūmo XT (motorbikes)
|The rider *picks which buttons the map shows* (a wrench, top left); the
rest in a side panel from the bottom right; reviewers still find the
buttons small with gloves.
|Garmin G1000 (aviation)
|*Softkeys*: a fixed row of physical keys along the display's bottom
bezel, their labels drawn on the screen right above them, changing with
the page; concentric knobs for values. Nothing to aim at — the hand finds
the key.
|Garmin G3000 (aviation)
|Most input moved off the displays onto separate *touch controllers*
(GTC) on the pedestal, each driving a pane of the big displays; some
knobs and keys kept.
|Ships (ECDIS, IMO S-Mode MSC.1/Circ.1609)
|Trackball and a key panel with *dedicated keys* (dimming up/down among
them); S-Mode standardizes the terms, icons and hot keys of the common
functions so every bridge works the same.
|===
What it means for us:
* *Fewer buttons on the map*: four, not seven — zoom +, zoom −, the
view (2D/3D, heading-up/north-up), the route overview. Night is
automatic (and a topbar thing), "exit" is the topbar's Drive button
already.
* *Recenter only when needed*: "Follow" and "Back to the position" are the
same thing — one button, shown only while the map isn't following, in
one place.
* *76 px square* targets at least (ours are 76×64).
* *Softkeys for the CAN keypad* (Blink Marine style): its keys' labels
on the screen's edge next to them, changing with the screen — the G1000
way, no aiming while driving.
* *A second screen as the controller* (G3000's GTC): the tablet or phone
drives the cab's display (the shared trip already works that way for
the route).
* *Pick your buttons* (zūmo) — later, if four fixed ones don't fit.
Sources: Google's car design guidelines (sizing; map action strip);
Google Maps help and the Navigation SDK docs (recenter, compass,
overview); zūmo XT owner's manual and reviews (Motorcycle.com, Bennetts);
Garmin G1000 pilot's guide (softkeys, knobs); AIN and Aviation Consumer on
the G3000's GTCs; JRC JAN-701B and Kongsberg ECDIS manuals; IMO
MSC.1/Circ.1609.
=== Layout: a grid, not floating panels (2026-12-01)
Floating cards and buttons over the map (OsmAnd's way, ours so far) cover
the map and move around. Chart displays on boats and ships dock
everything to the edges instead:
[cols="1,3"]
|===
|Who |How
|Ship's ECDIS (photo from a bridge)
|A *strip of values across the top* (HDG, STW, COG, SOG), a *column on the
right* with the route (active waypoint, ETA, TTG, distance), a *row of
tabs at the bottom* (Charts, Overlays, Route Planning, Targets, Tasks).
The chart in the frame between them.
|Marine plotter (16″, photo)
|Data boxes in a column on the left (COG, DTG, TTG, fuel, time), keys in a
column on the right, depth and SOG in a strip at the bottom.
|Garmin (plotters, cars, bikes)
|*Data fields*: the screen's cells are the user's — which value goes in
which cell is picked per field.
|OpenCPN
|The *Dashboard* plugin ships with OpenCPN: the instruments shown are
picked per pane; a pane can be docked to the left or right edge, and
docked it is dimmed at night. Colour schemes day, dusk, night (S-52; F5
cycles them in the inland ECDIS manual).
|===
What it means for us: *a grid* (Vignelli's Unigrid, which the NPS look
comes from, is one too) of *16 × 10 cells of 80 px* on the navigator's
1280×800:
* top row: the manoeuvre (4 cells), then fields (2 cells each);
* the map 13 × 8 cells, nothing over it;
* right column 3 cells wide: the next stop, km and ETA, the rest to the
end, the elevation ahead (3 cells; the inclinometer moved to the
Terrain profile, below), a small compass (1 cell);
* bottom row: the menu's tabs (Trip, Points, Layers, Search, Menu), the
map keys (−, +, 3D, Follow), day/dusk/night — all 80 px, the
Android Auto 76 px at least;
* a menu opens into 7 × 8 cells in place of the right column, a row per
item (a stop: name over 3 cells, ✓ ↑ ↓ ✕ a cell each), the map
narrows to 9 × 8.
* Every field is "which cell, which value" — the Garmin/OpenCPN way, the
user's to arrange later.
Mockups: the Design canvas (claude.ai, private), artboards Grid,
GridTrip, GridSearch, GridPoints, GridLayers, GridTerrain. To be tried
against: OpenCPN itself.
Built (2026-12-03): `driving.js` lays the page out as the profile's cells
(`public/drive/road.json`), the menus in `drive_menus.js` — Trip and
Search, Points (the library nearest the car, along the route ahead, shown,
or by folder), Layers (the On the map panel's own switches, presets Road /
Off-road / Overnight, + Keep saves what's on into one) and Terrain. A menu
is a grid of cells too: a row per item, a cell per action.
Sources: OpenCPN manuals — Dashboard
(opencpn-manuals.github.io/main/dashboard), inland ECDIS getting started;
the photos of the bridge and the plotter.
=== Screen profiles (2026-12-02)
The grid's cells belong to a *profile*: planning (standing, a big map and
the trip), road (the Grid above), terrain, later others. A profile is
its cells — `{area, widget, options}`, the widget a value field (any
signal from the bus or GNSS, label, unit, decimals, amber/red limits), a
dial (inclinometer, compass), a chart (elevation), a list (stops), the
map, a menu panel or a row of keys — plus the condition that switches it
on. Every cell is configurable; the grid differs per screen (16″
1280×800 is 16 × 10), so profiles are per screen type. Edited in the app,
standing only: tap a cell → widget and signal, drag a corner → its size.
Today one profile, `public/drive/road.json` (`columns`, `rows`, the map's
area, the menu's area and the map's beside it, `cells`: `{area, widget,
value | action | km}`; widgets `maneuver`, `field`, `status`,
`elevation`, `compass`, `key`); once the editor exists it saves to
`data/` and the file is the default.
*Keys* (artboard GridKeys): a `key` cell's `key` is the keyboard key
that clicks it (the uConsole has no touch), `keypad` the CAN keypad's;
the menus' own buttons carry theirs (1 2 3, H). In an open menu ↑ ↓
move the row (the keypad's encoder sends the same arrows), Enter its
first button, Space its eye, + adds it, ⌫ up a folder, Esc closes.
Every bound button shows its key in the corner, from the first key
pressed on. Keypads are channels (`pad.K1`, `pad.E3`) and the
profile's `"bindings"` say what each does (below, a binding), so any
keypad fits; a keypad's heartbeat switches the labels to its channels by
itself, a line under each screen key in its LED colour (menus cyan, the
map white, the view amber, green while on).
Still to do: the switch (auto / keyboard / keypad) and the mapping in our
diagnostics.
*Terrain* (artboard GridTerrain): the inclinometer only off-road — on
the road its cells show the elevation ahead. A 7 × 8 panel like a menu,
the map 9 × 8: roll (a rear view) and pitch (a side view), each with
amber past 20° / 25° and red past 1.5× (as `dashboard.js`), the maximum
held until reset; heading, the climb and the side slope ahead (DEM), the
elevation of the next 2 km; the surface in the top row in place of the
limit; "Level here" (the node levels itself, SDO, `/can.html`'s action
already), "Reset max", "Road view". It switches itself on when the car
leaves paved road (OSM `surface`, `tracktype` ≥ 2, or off any road) or
roll/pitch stay past 10° for 10 s, back after 2 km of paved road or by
hand; the menu has "Terrain view: automatic / by hand" (automatic by
default).
=== Switches and the keypad: how others do it (research, 2026-12-02)
Relay modules and lights on the CANopen bus, keys and rotary encoders on
a CANopen keypad (RGB LED per key), all driven by maptool.
[cols="1,3"]
|===
|Who |How
|Garmin PowerSwitch (app, custom layouts)
|A button: label, icon, colour. Actions per switch: *Toggle*, *Turn On*,
*Turn Off*. Button modes: *Normal* (one touch), *Momentary* (on only
while touched), *Strobe* (on and off at a chosen interval). A brightness
slider for lights.
|Garmin OnDeck (ActiveCaptain / chartplotter)
|*Latching* (on until turned off) or *Momentary* for a selected
*duration*; a name, an icon, a switch can be hidden.
|MaxxECU PDM, CAN keypads (Blink Marine, Grayhill/MoTeC)
|Button steps: *Momentary* or *2 to 6 positions* (each press moves to the
next state). *Keep state* at power loss: keep the last state or reset to
off. LED: a colour per state, a *fault indication* (blinks red on any or
a given fault), *user colours* on a condition; only green, orange and red
on the Grayhill/MoTeC keypads. Encoders: steps 0–255, LED pattern single
LED / bar graph / one + first/last. Backlight always on or with the
ignition (with an off delay), dimmed with the lights.
|ECUMaster PMU (5x3MT, RacePad)
|RGB, 7 colours. Encoder modes: *encoder* (a channel's value, first /
last / default state, autosaved), *changer* (pages, wrap from last to
first), *parameter controller* with buttons as *parameter selectors*
(radio buttons choosing what the knob changes; pressing the selected one
again releases the knob). 16 LEDs around each encoder show its value
(start offset, inverted, bi-directional from the centre).
|PDM and marine practice (not in the pages above)
|Timers (auto-off), exclusive *interlock* groups (winch in ⟂ out),
conditions (ignition, engine running, speed), a defined state when
communication is lost, a confirmation for dangerous circuits.
|===
What it means for us:
* *One controller*: keypads, relay modules and lights are I/O; the
modes, timers, strobe, interlocks, conditions and LED colours run in
one place — unless a device has its own firmware for that function,
which is outside our scope. Today that's maptool; it moves to the
STM32C5 on the Pi's HAT (below, "The controller on the Pi's HAT").
* *A binding* = an input (keypad node, key or encoder) + a mode + a
target: an output (a relay or light channel, SDO/RPDO) or a screen
function (zoom, the next profile, the next stop). Bindings live in the
screen profile, so a key can do something else off-road.
* *Modes*: Toggle, On, Off, Hold (momentary), Pulse (on for a duration),
Positions 1..N, Strobe (interval), Dimmer (a level, an encoder turns
it); per binding an interlock group, "only when", a long press, a
confirmation, the state at power-on and when maptool or the keypad is
lost.
* *The LED colour on the screen*: a thin line in the key's LED colour
under the tile or screen key it drives — dim off, full on, blinking red
on a fault — so it's clear which key controls what.
* *Fail-safe*: a Hold output goes off when the keypad or the controller
goes silent; a relay node consumes the controller's heartbeat and has
its own safe state.
* *Encoders*: a value (dimmer, volume), a changer (profiles, wrap) or a
parameter controller. The interim (Blink Marine style) keypad has 8
keys and 8 encoders: two move the map, one zooms, the rest are bound
per profile. *Moving with a knob* instead of dragging: press to grab
the selected row (a stop, a point, a layer), turn to move it up or
down the list or into a folder, press again to drop it — no dragging
on a bumpy road. Ours have one LED each, no ring: the value could
show for a moment on the keypad's other LEDs while the knob turns (a
bar across the keys, then back to their own colours) — to be worked
out.
Mockups: the Design canvas, artboards GridSwitches (tiles: icon, name,
state, mode, the key, the LED line) and GridBinding (the keypad, a key's
target, mode, options, LED colours).
Sources: Garmin PowerSwitch manual, "Adding a Button to a Custom Layout"
(www8.garmin.com/manuals/webhelp, Tread Overland Edition); Garmin OnDeck
manual, "Configuring the Switches with a Mobile Device" and "…with a
Chartplotter"; MaxxECU help, CAN keypad settings
(maxxecu.com/webhelp/settings-can_keypad-keypad_settings.html);
ECUMaster, "How-to Set Up Keyboards with Encoders in PMU" (v1.0,
2026-01-09); ECUMaster USA, CAN keypads with the PMU16; HP Academy, PDM
control pad setup.
=== What the military vehicles do (MilCAN, NGVA; notes, 2026-12-05)
From a chat with Gemini, checked only partly — treat the details as
leads, not facts.
* *MilCAN* (the MilCAN working group, UK): *MilCAN A* on 29-bit
identifiers, J1939-like; *MilCAN B* on CANopen (11-bit). Used for the
vehicle electronics (vetronics: power, lights, panels, keypads), the
engine stays on its own J1939. *NGVA* (NATO Generic Vehicle
Architecture, STANAG 4754) puts Ethernet on top for data and video,
CAN/J1939 stays for the automotive side — close to our maptool + CANopen
split.
* *Connectors*: MIL-DTL-38999, 150–400 € a pair — not for us. Gemini's
"7-pin vetronics pinout" (V+, GND, CAN_H, CAN_L, wake, interlock,
shield) is not a standard we could find; the two extra signals are
still worth having: *a wake line* and *a hardware interlock*.
Dual CAN (A/B on both sides of the hull) is beyond what a car needs.
What we can borrow:
* *Silent Watch* — parked for days on battery: every node asleep at
microamps, woken by a key, the ignition / wake line or a CAN wake-up.
Node side: a transceiver with a wake input and INH (TCAN1043 wakes on
any bus activity, WUP; TJA1145 / TCAN1145 also by a selected frame —
partial networking); STM32 in Stop. For later: whether ESPHome and
our CANopen can sleep and wake that way is unknown, and the node PCBs
have to be designed around the chosen transceiver (its wake pin, INH
switching the regulator). maptool's side: a *Sleep* action
(all outputs to their safe state, nodes to NMT stopped / sleep, the
screen off) and what wakes what.
* *Blackout / camp mode* — only our own devices, one key: keypad LEDs to ~2 % in a dim red,
the screen to Night at its lowest, the auxiliary outside lights
(awning, work lights) off and *inhibited* (the door no longer turns the
awning light on) until it's left. A screen profile + a condition on
the outputs, not a new mechanism. The road lights are the car's own
and stay untouched (the military's blackout keeps dim blackout stop
lights too; on a public road it's not ours to switch).
* *Smart fuses (SSPC)*: nothing new — that's the PDM node (dingoPDM and
the like: high-side switches with current sense, trip on a short, reset
over CAN); its current and faults on the switch tiles and load shedding
by battery voltage are already in the virtual switch panel's TODO.
* *Hardware interlock*: a wire that drops the power outputs (winch,
inverter, heater) even with a hung MCU or a dead bus — a node's own
safe state, maptool only shows it.
*Powering the Pi and the ignition* — two ways:
. *The Pi on the bus*: a 6-pin Deutsch DT — 12 V, GND, CAN H, CAN L, IGN
and one spare (seen like that on another project); the Pi watches IGN
and shuts itself down cleanly a while after the ignition goes off.
. *The Pi on 12 V only* (the usual way, preferred): the car's CAN is
read by *our gateway node*, which tells "the car is running" from the
car's CAN data or from its own IGN input. The Pi then needs only power
(12 V, GND, possibly IGN — a separate connector, like
https://www.reddit.com/r/raspberry_pi/comments/1codbfw/raspberry_pi_for_automotive_applications_update/[r/raspberry_pi,
"Raspberry Pi for automotive applications"]) and can sit anywhere in
the car. A *HAT with an STM32C5* is its power supervisor: it turns the
Pi on when the car runs or when something on the network needs it
(a node, the tablet), asks it to shut down and cuts its power after,
and measures the power (voltage, current, the battery) — later more.
The HAT also carries the Pi's own CAN (a controller on SPI such as the
MCP2518FD + a transceiver, so maptool keeps its `can0`); the STM32C5
sits on the same bus as a node of its own and is the Pi's *watchdog*:
it consumes maptool's heartbeat and power-cycles a Pi that hung.
IGN (or the gateway's "running") is also the simplest wake signal for
the nodes.
The nodes' side (transceiver, wake pin, PROFET board) belongs in
home-gitops `docs/canopen-nodes.adoc`.
=== The controller on the Pi's HAT (decided 2026-12-05)
The outputs' logic leaves maptool for the *STM32C5 on the Pi's HAT*, the
way PDMs (ECUMaster PMU, MaxxECU) keep the keypad and output logic in
themselves rather than on the display.
* *One owner of every output.* The keypads, the `mcu-lvgl` panel and
maptool only send *requests* (toggle, on, off, a level); the controller
decides, drives the output nodes and sends the outputs' state in a TPDO
that everyone draws from. No two devices write to the same relay.
* *It works with the Pi off.* The HAT's STM32C5 runs whenever there are
12 V (it's the Pi's power supervisor and watchdog anyway), so the lights
and the pump work while the Pi boots (20–30 s), hangs or is off at camp.
* *The chip*: the same STM32C5A3CGT6 as the nodes (Cortex-M33, 144 MHz,
1 MB internal flash, two FDCANs, LQFP48) plus the board's 16 MB
external flash. An STM32H was considered and dropped: the controller is
a state machine for a few dozen outputs, an H7 draws far more while the
car stands (the HAT never sleeps fully, Silent Watch), needs a bigger
package and power design, and would be a second MCU family to keep. An
H5 only if the controller ever needs Ethernet.
* *Firmware*: plain Zephyr, not ESPHome (which can't use the external
flash yet). The external flash holds MCUboot's second slot (OTA over CAN
without squeezing the 1 MB), a *black box* — who switched what, faults,
heartbeats lost, the battery voltage — that maptool fetches when it
comes up, so the night at camp can be seen afterwards, the bindings and
scenes with their earlier versions (back to the last good one), and
per-circuit current and on-time statistics.
* *Conditions* come off the bus: speed from the GNSS node, the ignition
from the gateway, the sun computed on the chip; a geofence (the trip's
camp) is a point and a radius sent by maptool.
* *maptool stays* the UI (the switch tiles, `/keypad.html`,
`/sim.html`), the bindings' editor — `bindings.json` written to the
controller (SDO) and kept in its flash — and the screen's own keypad
actions (zoom, pan, menus), which it keeps reading off the bus. Today's
`outputs.rb` stays as the simulator and the reference the firmware is
checked against.
* *A single point of failure*, softened: every relay node has its own safe
state when the controller's heartbeat is lost, and a few key outputs
(the interior light) can have an input of their own on their node.
Order: maptool stays the controller until the firmware is done. First
the messages are fixed — requests, state, configuration as CANopen
objects — so that maptool uses them now and the STM32 later, with no
change to the other nodes.
== Typography
* Planning UI: the system sans; *National Park* (the router-carved
signage face) only for the wordmark and, later, headings in the black
band — the brochure's title.
* Instruments: the system sans with tabular figures
(`font-variant-numeric: tabular-nums`), bold values, small uppercase
labels with letter-spacing — numbers that don't jitter as they change.
== Which surface is which
[cols="1,1"]
|===
|NPS (planning) |Cockpit (driving)
|the map and its layers, the library, the trip / itinerary, search, the
route panel, NPS maps, the offline data panel
|the dashboard (inclinometer, speed, limit, ahead), the navigation strip
(next maneuver, lanes), the switch panel (PDM), warnings, `/can.html`
|===
The route line is the bridge: blue (`--route-planned`) while planning,
magenta (`--route-active`) once it's being navigated.
On a trip with its log recording, two lines, never mixed up: *planned*
(the route — blue while planning, magenta ahead while navigated, the
planned part behind thin and dashed so a detour shows) and *really driven*
(the recorded track, `--route-driven`, solid, on top). Shape tells them
apart as well as color (S-52's second cue): dashed planned, solid driven.
Sources: IHO S-52 Edition 6.1.1 (2015), sections 2.2.6, 4.2; the avionics
color meanings are the common glass-cockpit convention (FAA AC 25-11B has
the color coding guidance, §5.3 — not checked here, its PDF refused the
fetch).