include/ui (SquareLine export: ui_init, placeholder screen, helpers, theme
manager, project metadata) is no longer used - every screen is hand-coded.
The one live line, the dark default LVGL theme, moves to display_init.cpp.
Build filter and include path drop include/ui. Comments, CLAUDE.md and the
stale README sections (features, layout, partitions) updated.
Verified on the board (USB, dev): Wi-Fi on/forget/scan/join, dark keyboard
and dialogs, update check + install of v0.1.5 from the screen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings (replaces the SquareLine screen, now deleted): sidebar with
Wi-Fi (switch, status card with failure reasons, networks nearby,
full-screen password page), Updates (installed vs latest, Check, Install
behind a confirm dialog) and System (CAN / link / perf overlay switches,
live link, CAN, memory, uptime).
Gauge Tuning: tabs Tachometer / Coolant gauge / Alerts / Simulation,
56 px -/+ rows with hints and real units, accelerating hold-to-repeat,
per-tab Reset with confirm, save indicator, SIMULATION ON chip, swipe
left to go back.
WiFiManager rewritten without LVGL code: one remembered network (NVS
"wifi"), auto-join at boot, scans only on request, no endless reconnect
(keeps the ESP-NOW channel stable), failure reasons from the disconnect
event, password never logged. Ota gains getStatus()/requestCheck()/
requestInstall() for the screen. CAN/UART switches become setEnabled().
Shared ui_kit (header, buttons, switches, confirm dialog); Montserrat
20/24 enabled.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- lv_conf: LVGL widget pool 48 KB internal -> 512 KB PSRAM (LV_MEM_POOL_ALLOC).
It ran out after a few Settings visits (87% used, 31% frag, 4.5 KB biggest
block; lv_mem_buf_get() failed in a label draw - decoded backtrace). Also
frees 48 KB of internal RAM: free 16 -> 69 KB, largest block 7.6 -> 31.7 KB
- lv_conf: LV_ASSERT_HANDLER abort() instead of while(1), which spun inside the
task holding the LVGL lock and froze the UI + console
- wifi_manager: SSID buttons clear their g_ssid_buttons[] slot on
LV_EVENT_DELETE (SquareLine deletes the Settings screen on leave; stale
pointers were lv_obj_del()'d on the next scan). Scan only while the list is
on screen and not connected - 10 s background scans caused the display dots
- main: `mem` console command (internal heap, PSRAM, LVGL pool)
- docs: board page lessons, open-questions #13/#14, ota-updates, CLAUDE.md, log
Verified: 10 Settings visits + 9 list rebuilds, pool peak 4%, 0 crashes; user
confirms no freeze, no reboot, no dots, swipes better.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ota-updates: status table of every OTA cycle (incl. the 570 B abort and the
clean failure path), v0.1.3 published/not installed, 'installs are done by the
running firmware', flicker cause verified, Wi-Fi lost on reboot, console
without reset, B repo now public
- esp32-s3-touch-lcd-5b: drop the unmeasured ~50 FPS claim, USB serial is
native CDC with the DTR/RTS reset gotcha, new lessons (flash-write flicker,
fade stutter, internal RAM, never power the radio off, dual-slot partitions)
- dual-controller-architecture: ESP-NOW/Wi-Fi radio sharing, disconnect(true)
bug, B updates via A over ESP-NOW
- open-questions #14: Wi-Fi UX redesign, remember network, delete v0.1.0
- CLAUDE.md: same FPS / USB-serial corrections; index + log
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A main push now skips itself when its commit already carries a v* tag (the tag
build covers it - release with git push --follow-tags) or when it only changes
wiki/** or *.md. Checked inside the job, so tag builds are never path-filtered.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A forced reinstall aborted at 570 B when the TLS client briefly reported
disconnected between records; the retry went through. A drop now only counts
after 2 s without data.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- screen switches use LV_SCR_LOAD_ANIM_NONE: full-screen fades were re-rendered
and blended in software every frame and stuttered at 1024x600
- Tunables: NVS write 3 s after the last change or on leaving the Tuning screen
(Tunables::flush()), not per tap - each flash write flickers the RGB panel
- OTA: backlight off while the image is written, with full-screen notices
before and after; tunables flushed before any reboot
- firmware version shown bottom-right on every screen (lv_layer_top)
- docs: CLAUDE.md, wiki ota-updates, open-questions #13, log
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ota: internal RAM has 15.9 KB free / 7.6 KB largest block with Wi-Fi up, so
jobs now run in the loop task (8 KB stack; 3.6 KB headroom measured on
`ota check`) with mbedtls allocations routed to PSRAM during the job
- wifi_manager: WiFi.disconnect(true) powered the radio off and killed ESP-NOW
whenever Wi-Fi was used; now disconnect() only. showConnectionResult() waits
for the LVGL lock and null-checks widgets. New `wifi join|status|off` console
- espnow_link: send() re-initialises ESP-NOW if the driver dropped it
- wiki: ota-updates memory + bugs sections, open-questions #13 (internal RAM),
log; CLAUDE.md notes
Verified on the board: `wifi join` connects, ESP-NOW 195 sent / 0 failed while
joined, `ota check` verifies v0.1.0's signature on-device.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SquareLine export has shipped ui_Toggle_Wifi_Switch with LV_STATE_DISABLED
since the first commit, so it ignored every touch. OTA needs Wi-Fi joined, so
clear the state in UIStateManager's sync (survives SquareLine re-exports).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- partition table: two 7.9 MB OTA slots, SPIFFS dropped, nvs/otadata offsets
unchanged (tunables survived the one-time USB flash)
- ota_update.cpp: manual `ota status|check|install|rollback` console; HTTPS
pull from the public repo's latest release, ECDSA P-256 signature over
"patrol-a|version|sha256" checked before download, streamed image must match,
parked gate before download and before the slot switch, 30 s
confirm-or-rollback (verifyRollbackLater override)
- ota_config.h: server/repo, ISRG Root X1 + Root YR, signing public key
- .gitea/workflows/firmware.yml: main -> rolling unsigned pre-release
main-latest; v* tag -> signed release (needs secret FIRMWARE_SIGNING_KEY)
- wiki: pages/ota-updates.md (design, decisions, B-over-ESP-NOW plan);
CLAUDE.md, index, log, open-questions #12 updated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- capture proof: Launch used only 1A/2C/22/23 - no 10/27/3E. Self-polling a
2C live value needs just the define + poll, no session or security seed.
Corrected the earlier "needs session handshake" wording.
- design decision: active polling (if built) lives behind a password-
protected Diagnostics screen - authorized-tech gate, manual, refuses with
a scan tool connected, read-oriented services. open-questions #12.
- wiki: launch-capture + obd-diagnostic-polling tightened; project memory
added so the capability and guard rails are not re-researched later
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- capture-with-Launch session: live data on this DDE comes via KWP service
2C (2C 10 00 DF -> 6C 10 HHLL), not the 22 D1xx identifiers (absent) or
the session-gated 21 blocks
- rail pressure actual VERIFIED two-point vs the Launch display:
bar = HHLL x 0.03 (idle ~305, 2500 rpm ~430)
- recipe now generalises to any Launch-visible value; self-poll needs the
session/define handshake (captured, deferred design decision)
- wiki: sources/launch-capture-2026-09-23.md, obd-diagnostic-polling,
open-questions #7, index; raw serial capture (~13 MB)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wiki: two new pages - canny-5-3-pico-gauge-drive (why the CANNY's 12V
negative output moved the needles and 3.3V push-pull could not; 2SK3069
low-side stage) and patrol-instrument-cluster (tach 2 ppr + trim -13
calibration, NTC temp sender curve, 20 kHz PWM flutter fix, and the
four-layer steppy-needle diagnosis ending at the cluster's ~150 rpm
count quantization, defeated with adaptive dither on B).
Tools: serial_logger.py (multi-port capture to wiki/raw), serial_cmd.py
(one-shot cfg commands to A), dual_serial_capture.py (bench snapshots),
tach_ramp.py / tach_ramp2.py (synthetic rpm sweeps via cfg override).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Protocol v2 (shared header, byte-identical with the 1.3 repo):
- typed DATA/CONFIG frames: 0xAA | ver | type | len | payload | XOR | 0x55
- gear split into lever (P/R/N/D/S/M) + target/engaged nibbles, engine rpm,
alert bitmap decided here from tunable thresholds, link_config_t tunables
- docs/UART_PROTOCOL.md rewritten for v2
Controller A modules:
- tunables: gauge calibration + alert thresholds in NVS, 'cfg' serial console,
bench override (never persisted)
- espnow_link: every frame also broadcast on ESP-NOW ch 1; radio stays in STA
(WiFiManager no longer powers it off)
- uart_manager: DATA at 5 Hz + CONFIG on change/5 s on both transports
- can_driver: publishes gear pieces and rpm, evaluates alerts
- tuning_screen: hand-coded Gauge Tuning page (swipe right from Driveline),
-/+ rows, enable switches, override sliders, Driveline/Defaults buttons
UI: SquareLine Home screen (3 meters + battery) and meters_manager removed;
Driveline is the boot screen; Settings back-gesture calls app_show_driveline().
tools/fix_penv_deps.ps1: repairs the shared PlatformIO penv after a 1.3 build.
Bench-verified with Controller B: both transports alive, dedupe, override
rpm 2000 -> 133.3 Hz tach output.
Co-Authored-By: Claude <noreply@anthropic.com>
- Delete .docs/CAN_BUS_INTEGRATION.md (placeholder CAN IDs, external transceiver
wiring the board does not need); superseded by wiki/pages/can-id-candidates.md
- Move UART_PROTOCOL.md to docs/ as the single copy of the packet spec
- Move the annotated board photo into wiki/raw/ and add a source page for it
- CLAUDE.md: verified 11-bit CAN ID list replaces the placeholders, TWAI_MODE_NORMAL
replaces LISTEN_ONLY, UART TX is GPIO 44, dummy-data references removed
- Wiki index/log updated; note the schematic PDF is missing from disk
Co-Authored-By: Claude <noreply@anthropic.com>
User-verified: 0x3B4's ignition nibble flips the instant the key toggles, even
though the message is nominally 5 s periodic - it transmits on-change too. So
the ignition-off screen reset is effectively immediate, correcting the earlier
assumption that it could lag by a few seconds. Comment/doc only, no logic change.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Gear hero now shows the engaged gear, not just the lever letter. P/R/N stay as
letters; in the Drive detent it composes mode + number - D3 / S3 / M3 - from
0x1D2 byte 1 (engaged gear, populated in plain D too, verified climbing 1..6 in
the drive capture) and byte 4 (mode). Falls back to the bare mode letter before
the box reports a number, and in R (unnumbered here).
The three 0x1D2 pieces (lever, engaged gear, mode) are now carried in
driveline_t so the screen can compose its own label without disturbing the UART
packet's gear_position enum. lever defaults to GEAR_UNKNOWN, not 0 (which is
GEAR_PARK), so it doesn't read "P" before the first frame.
Ignition-off now blanks every readout instead of freezing the last frame, per
request - the screen goes quiet with the car. The ignition chip still shows IGN
OFF; the rest mute, since their values are meaningless with the key out. Driven
by 0x3B4's ignition nibble (5 s message, so the reset lags key-off by up to a
few seconds).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Turbine speed removed from the display - it's an engagement diagnostic, not a
driver number, and the Launch now gives output speed directly so it's no
longer needed for the ratio-calibration method either. Still decoded in the
driver. Its screen slot now shows accelerator pedal %.
Output shaft now displays approximate rpm instead of raw counts, via a
PROVISIONAL factor from the single Launch reference (128 rpm / 1192 raw =
~0.107, through a known zero). The tile is labelled "OUTPUT (~rpm)" - the "~"
keeps an unlocked scaling from reading as exact. Replace the factor once a
multi-point Launch sweep gives a real fit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Boot screen: land on the Driveline data screen instead of the SquareLine
gauges Home screen. Done in display_init after ui_init while the backlight is
still off (no flash of the wrong screen); Home stays reachable by swiping off
Driveline.
Engine torque added to the screen, decoded from 0x0A8 TORQ_AVL (available/
delivered torque), bits 12-23, signed x0.5 Nm. The user identified the ID and
supplied the spreadsheet formula (D2*256+D1)/32, which is algebraically
bits12-23 x0.5; confirmed against the repo's 0x0A8 worked example (24 Nm).
Firmware masks D1's low nibble (that's the alive counter, not torque - the
repo example shows ALIV=8 there) and sign-extends so overrun reads negative.
0x0AA TORQ_DVCH is the same layout but driver demand - identical at idle,
diverges under load - so the delivered value is the right one to show.
Output-shaft scaling revised: a direct Launch reference (output speed 128 rpm
at our raw 1192) implies ~0.107, contradicting the earlier x0.125 (which would
predict 149). One eyeballed cross-tool point, so nothing is adopted - the
field stays raw counts - but 0.125 is downgraded in firmware and wiki, and the
Launch now gives a direct rpm reference so calibration is just a multi-point
sweep and a linear fit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New hand-coded LVGL screen (src/modules/driveline_screen.*) showing only
signals verified on this bus: gear as the hero, coolant and gearbox oil temp
flanking it, an engine RPM bar, and turbine / output-shaft speeds, plus
ignition, engine-run, converter-clutch, gearbox-cooling and gear-mismatch
status. Reached by swiping right from Home.
It lives in src/ and hooks its gesture onto the Home screen at RUNTIME rather
than editing ui_Home_Screen.c, because SquareLine Studio overwrites
include/ui/ on every export - that is how the CAN toggle's event handler went
missing. LVGL dispatches to every registered callback, so the runtime hook
coexists with the generated left-swipe handler instead of replacing it. Same
reasoning the existing meters_manager already follows.
Output shaft is labelled "raw" and shown as counts: the x0.125 scaling is
still a hypothesis, so inventing a unit here would launder it into fact.
Also fixes a defect found while wiring this up: main.cpp updated the Home
screen's meters and battery label unconditionally, but those fields are
pre-seeded with DEFAULT_* constants. With no CAN data the display showed a
confident 92.0degC engine oil temp and 12.45V battery that had never been
measured. Two of them have no source on this bus at all - engine oil temp has
no sensor (0x1D0 byte 1 is permanently 0xFF), and 0x3B4 publishes the
battery's not-available marker on nearly every frame. Now gated on
valid_flags, so an unmeasured value reads "--.--" instead of a plausible lie.
Same class of bug in the driver: 0x3B4's U_BT was accepted even when it read
0xFFF, which would have put a confident 61V on screen. Now rejected, leaving
the valid flag clear.
Decodes ignition state from 0x3B4 byte 2 (user-verified: 0x00 = on, 0x09 =
off, unmoved by the engine starting). Both the E65 repo (ST_ENGINE_RUN) and
the E60 VFL sheet (engine flag, 0x09 = running) are wrong about this field on
our bus - inverted and mislabelled. Noted at the definition so it doesn't get
"corrected" back. It also restores ignition sensing, which we thought was
lost with CAS/0x130 absent from the swap.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
First capture with the vehicle actually moving (raw/log_20260717_145930.txt,
1857 frames, filtered to 0x0BA + 0x1D2).
Verified, closing yesterday's inference: ST_GR_GRB values 6/7/8/9/A observed
directly = 2nd..6th. So 0x0BA byte 0's low nibble is a COMPLETE gear source
on its own - P/R/N plus 1st..6th, reverse included. 0x1D2 is now needed only
for the lever and the D/S/M mode, which 0x0BA does not carry. Value 4 is
still unaccounted for.
Also caught ST_CCLT (torque converter lockup clutch) live - 422 frames
"controlling", clustered in the higher gears. This matters beyond curiosity:
a closed clutch bolts the turbine to the impeller, so turbine == engine
exactly. Any turbine/engine slip ratio read at road speed must check CCLT
first or it will report "not engaged" for a perfectly healthy locked-up box.
Decoded into driveline_t with that warning attached.
Output shaft: identification now verified (rises monotonically 1139->16702
across gears 1->6, zero whenever the output is held). Scaling narrowed to
x0.125 but NOT adopted - it implies a coherent 901->1872 rpm upshift schedule
across five independent 6HP26X ratios, where raw-as-rpm would imply
7,200-15,000 rpm against a ~4,500 redline. Still rests on the unproven
assumption that each gear's max output is its upshift point, so the field
stays in raw counts. One capture including 0x1A2 settles it: turbine/output
gives each ratio directly.
Gearbox confirmed as ZF 6HP26X (user). Same gearset as the 6HP26, so the
ratio table holds; the X is the xDrive output variant, which dates the donor
to E60/E61 rather than E65 - the 7-series never took M57N with xDrive. That
partly answers a standing open question, and raises a new one: the X box
measures its output shaft upstream of the transfer case, so if a Patrol
transfer case sits in the path its ratio enters the km/h conversion and
changes with high/low range.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
'wiki/raw/~$E60 VFL CAN-Bus Codes.xlsx' is a lock file Excel creates while a
spreadsheet is open, not a source document. It rode in on a broad 'git add
wiki/'. Removed from tracking and ignored so it cannot recur.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>