Commit Graph

16 Commits

Author SHA1 Message Date
julian a28cbada59 Engine data screen: live rail, boost, charge-air temp, battery from the DDE
New screen (Engine data button on Driveline) polls the DDE with the
Launch's KWP `2C 10 <id>` reads: 00DF rail (bar = raw x 0.03, verified),
0091 boost (mbar = raw / 8), 16A8 charge-air temp, 0093 battery - the last
three provisional (one engine-off point each), tagged on screen with the
raw value shown for calibration.

DiagProbe live mode: `2C 10 15 E0` once, then the four reads in turn, one
in flight, ~100 ms apart, quiet on the console, paused by the foreign-tester
guard, stops 1.5 s after the screen stops asking. 2C stays forbidden from
the console. CANDriver::transmit gains an echo flag (live frames echoed only
with CANRAW on). Wiki: the three CANNY captures ingested, identifier table
and the no-password decision recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 19:48:00 +02:00
julian 34b3fc7ec0 Decommission SquareLine: delete include/ui, theme set in display_init
Firmware / build (push) Successful in 4m1s
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>
2026-09-27 08:17:01 +02:00
julian e68fad73b6 Hand-coded Settings + tabbed Gauge Tuning; remembered Wi-Fi; on-screen updates
Firmware / build (push) Successful in 3m58s
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>
2026-09-27 07:38:17 +02:00
julian 766019a01e Fix UI freeze/reboots: LVGL pool to PSRAM, dangling SSID buttons, scan policy
Firmware / build (push) Successful in 4m24s
- 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>
2026-09-27 00:32:18 +02:00
julian 842f270398 Wiki sweep for the OTA/display session
Firmware / build (push) Successful in 6s
- 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>
2026-09-27 00:05:13 +02:00
julian 29711fa25e CI: skip main builds for tagged or docs-only commits
Firmware / build (push) Successful in 3m56s
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>
2026-09-26 23:58:32 +02:00
julian eb9cbd985f Display quick fixes: instant screen switches, deferred NVS saves, dark OTA writes, version label
Firmware / build (push) Successful in 4m30s
- 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>
2026-09-26 23:00:28 +02:00
julian bb0895674a OTA bring-up fixes: loop-task jobs + PSRAM TLS, ESP-NOW survives Wi-Fi, wifi console
Firmware / build (push) Successful in 4m24s
- 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>
2026-09-26 22:37:08 +02:00
julian 1ec93dc413 Rename signing secret to BMW_NISSAN_FIRMWARE_SIGNING_KEY
Firmware / build (push) Successful in 4m5s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 22:05:16 +02:00
julian effa949429 OTA updates for Controller A: dual-slot partitions, signed Gitea releases
- 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>
2026-09-26 21:59:46 +02:00
julian 61e190b1b9 Diag scans: 22 D1xx refuted, 21 xx session-locked; add diag raw toggle + scanner
- diag probe: `diag raw on|off` console command (mutes CANRAW during scans)
- tools/diag_scan.py: identifier-space sweeper via `diag bmw`
- findings: whole 22 D1xx block NRCs (clipping identifiers wrong for this
  DDE); 21 xx sparse - 21 20 = O_269962, measurement blocks gated behind
  diagnostic session / security access -> Launch capture is the path to
  live data
- wiki: route-b source page + obd-diagnostic-polling updated, raw scan logs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-23 16:02:18 +02:00
julian 7a7398243b Diag day: Route A+B verified live, DTCs read, donor identified as E60 530d
- diag probe: add mode 03 (diag dtc), BMW KWP on 0x6F1 with extended
  addressing (diag ident, diag bmw), read-only service whitelist
  (1A/18/21/22), MAX_PAYLOAD 64->384, full hex+ascii dump of BMW replies
- tools/diag_session.py: one-session probe runner, logs into wiki/raw/
- wiki: Route A results (11 mode-01 PIDs, rpm/coolant cross-checked, mode
  09 silent), Route B verified (0x6F1 [12] -> 0x612), 1A 86 ident with
  VIN prefix WBANC92090 (E60 530d), DTCs P0101/P0113/P0500/P0545/P0030
  (disconnected-sensor swap leftovers), open-questions #2/#7 updated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-23 12:54:24 +02:00
julian 974082cb3e Add diag console probe (OBD-II mode 01/09 on 0x7DF); wiki: diagnostic polling, two sources
Firmware:
- CANDriver::transmit(): the single sanctioned transmit path (single-shot,
  echoed as CANTX lines, TX_FAILED alert counted); CAN-task warnings now take
  the serial lock
- DiagProbe module: `diag pids` supported-PID bitmap scan, `diag pid <hex>`,
  `diag vin`, `diag ecu`, `diag status`; ISO-TP reassembly with flow control;
  one request in flight, refused for 3 s after any foreign tester frame
- Console dispatch chained via Tunables::setExtraCommandHandler()
- CLAUDE.md and docs/UART_PROTOCOL.md updated

Wiki:
- New page obd-diagnostic-polling (broadcast vs polled, 0x6F1->0x612 addressing,
  Route A generic OBD PID table, Route B, test-day procedure, firmware probe)
- New sources: google-ai-dde7m57-pids (clipping, unverified, 0x612 direction
  contradicted), dwr-335d-torque-pids (thread + raw/BMW 335d.csv decoded)
- Clippings/ folder added to the schema (Obsidian Web Clipper, treated as raw/)
- bmw-m57n-engine, can-bus-integration, open-questions, index, log updated
2026-09-21 19:51:49 +02:00
julian f60bdac268 Link protocol v2, ESP-NOW leg, gauge tunables + tuning screen; remove Home screen
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>
2026-09-21 19:12:31 +02:00
julian 63367f5490 Retire .docs; move UART spec to docs/; correct stale CAN/UART facts in CLAUDE.md
- 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>
2026-09-21 10:56:59 +02:00
julian 37f98a241f Init new era, with wiki integrated. 2026-07-15 12:17:06 +02:00