docs(wiki): park-2 event-loop stall incident + bounded-request-cost decision; Dingtian firmware retired, dev-board pinout, edge-controller memo

- concepts/park-2-event-loop-stall: /api/sessions/active ~2 s synchronous (quote() per open
  unpaid transient x664, unindexed ledger scans) froze the loop; Node runs expired timers before
  queued UDP replies, so healthy Dingtian pulses reported "timeout" and signed entries lost
  their snapshot/session row. Standing decision: bounded request cost whatever the operator data.
- Dingtian: custom firmware retired (2026-10-23), runbook shelved, vendor pinout in raw/,
  relay-proxy PoC marked retired; edge-controller hardware memo (open).
This commit is contained in:
2026-10-24 11:17:30 +02:00
parent c08e232339
commit 6eb65361a8
14 changed files with 447 additions and 31 deletions
+6 -4
View File
@@ -1,13 +1,13 @@
---
type: overview
tags: [parking, index]
updated: 2026-07-02
updated: 2026-10-22
---
# Index
Content catalog for the wiki. Start at [[overview]]. Maintained on every ingest.
Counts: 4 sources · 19 entities · 47 concepts · 8 decision records.
Counts: 4 sources · 19 entities · 47 concepts · 9 decision records.
## Overview & navigation
- [[overview]] — the top-level synthesis and entry point.
@@ -46,7 +46,7 @@ Counts: 4 sources · 19 entities · 47 concepts · 8 decision records.
- [[dingtian-dt008-reader]] — Dingtian DT-008 QR/RFID reader on hand; HTTP-GET push, server replies the verdict; ⚠️ our two units read disjoint card sets (125 kHz vs 13.56 MHz) — unresolved, see open question #18.
- [[zkteco-controller]] — ❌ rejected/historical; aux-input path was a contender, not pursued.
- [[dingtian-relay]] — ✅ CHOSEN access controller; decoupled inputs solve the button blocker (driver verified on hardware); spare relays drive aux outputs (`setAux`).
- [[relay-proxy-firmware]] — PoC (2026-10-22): NodeMCU firmware that IS a DT-R004 to the booth (binary/string UDP, config CGI, userset, Digest push) + cloud heartbeat/command/watchdog (power-cycles the PC). Verified against the emulator; booth integration blocked on park-lab ufw.
- [[relay-proxy-firmware]] — RETIRED 2026-10-23 (mini PCs instead). PoC (2026-10-22): NodeMCU firmware that IS a DT-R004 to the booth (binary/string UDP, config CGI, userset, Digest push) + cloud heartbeat/command/watchdog (power-cycles the PC). Verified against the emulator and end to end at park-lab (2026-10-22, after the ufw rule).
- [[dahua-ipc-hfw2549t]] — first Dahua on the bench (IPC-HFW2549T-AS-IL, fw 2.880, 2026-09-17): the driver's channel decrement gave HTTP 400 (channels are 1-based — fixed + verified live); Dahua clock-sync built (`global.cgi`, naive wall time); events = held `eventManager attach` multipart stream, verbatim `VideoMotion Start/Stop` + `TimeChange` parts captured, subscriber not built; `RealUTC` is the camera's belief of UTC; 5-strike login lockout.
- [[hikvision-radar]] — vehicle-presence radar on a Dingtian input; the entry presence gate (per-input active-level caveat).
- [[rongta-printer]] — ✅ CHOSEN 80mm thermal printer; ESC/POS over raw TCP 9100 (or local USB, see [[printer-usb-transport]]); driver written, one unit reachable at 10.0.10.6.
@@ -71,7 +71,7 @@ Counts: 4 sources · 19 entities · 47 concepts · 8 decision records.
- [[device-registry]] — catalog of selectable drivers per category (admin-configurable).
- [[first-run-setup]] — admin adds controllers + binds readers/cameras to relays from the catalog at install.
- [[site-device-installation]] — FIELD RUNBOOK (2026-09-09): per device — factory address + credentials, the tool needed, what the wizard configures itself vs what is done by hand on the device, known traps; address plan, order of work on site, gaps to fill. Dingtian relay, DT-008 readers, Hikvision camera, radar, K200L / Rongta / Cashino printers.
- [[esp32-flashability-test]] — BENCH RUNBOOK (2026-10-22): is this ESP32 board locked? `esptool chip_id` + `espefuse summary` on the Dingtian DT-R0xx programming header; read-only; locked = standard SKU, open = Development Board Version.
- [[esp32-flashability-test]] — shelved (Dingtian flashing retired 2026-10-23). BENCH RUNBOOK (2026-10-22): is this ESP32 board locked? `esptool chip_id` + `espefuse summary` on the Dingtian DT-R0xx programming header; read-only; locked = standard SKU, open = Development Board Version.
- [[device-input-flow]] — button → device push → backend decides → relay; backend is source of truth.
- [[device-discovery]] — optional driver capability to scan the LAN; implemented by the DT-008 reader (2026-10-08), UHPPOTE was the historical example.
- [[barrier-not-a-door]] — never timed-close a barrier; safety lives in barrier firmware.
@@ -101,6 +101,7 @@ Counts: 4 sources · 19 entities · 47 concepts · 8 decision records.
- [[tariff-time-tiers]] — BUILT (V2 tariff): happy-hour/off-peak/weekend/seasonal + vehicle category + flat rate via wall-clock windowed cards; tz frozen per version.
- [[tariff-industry-survey]] — 2026-07 web survey of industry tariff structures: coverage map vs our engine; gaps = early bird (pick-table-by-entry-time) + merchant validations; per-minute & dynamic pricing ruled out.
- [[booth-exit-flow]] — manned booth: pay → voucher (self-exit later) or immediate exit; active sessions; audited barrier re-open.
- [[park-2-event-loop-stall]] — INCIDENT 2026-10-24: `/api/sessions/active` ran ~2 s synchronously (per-row unindexed ledger scans × 664 open unpaid tickets), froze the event loop, and made healthy Dingtian pulses report "timeout" (timers run before socket I/O) → signed entries with no snapshot/session row. Fix: fold-once pricing, hot-path indexes (0032), deferred UDP timeout, evidence before pulse. Rule: bounded request cost whatever the operator data.
- [[operator-issued-entry]] — operator mints an entry ticket when the physical button is broken; presence-gated (radar AND camera, both sides), flagged (source=manual + operatorInitiated + anomaly), capacity-override allowed; needs `session:create` (2026-07-01).
- [[plate-reconciliation]] — ANPR plate-as-invariant catches the ticket-swap fraud (paid car let out on a fresh $0 ticket, original lingers "inside"); exact/high-conf match vs open sessions; booth = flag + operator override, reader = log-only fail-open (2026-07-01).
- [[shift]] — manned-only accountability period; explicit Start/End; End → signed + printed Z-report; drawer float carries across shifts. Drawer cash movements (operator records, admin reviews via signed cash_review — a flag, not a reversal) live at the /drawer route (2026-07-01).
@@ -151,3 +152,4 @@ Counts: 4 sources · 19 entities · 47 concepts · 8 decision records.
- [[container-deployment]] — Docker images for the non-desktop apps: parking-server (Fastify API + bundled SPA via @fastify/static) + parking-vision (Python/uv ANPR); branch+SHA tags, per-env compose, Gitea registry, build-images.yml CI; pnpm deploy (not prune) for native better-sqlite3; migrate-at-boot.
- [[fleet-deployment-komodo]] — fleet control plane: Komodo Periphery on each booth, driven by Komodo Core over a NetBird mesh, running the same compose files. Deploys manual + pinned to dev-<sha> (no webhook); secrets Komodo-managed per-booth+unique; booth.sh demoted to break-glass. Threat-model caveats: Periphery is a root agent (mesh-bound only), EVENT_SIGNING_KEY-in-Core is a fraud-root blast radius until ATECC608 signs. komodo/ is infra-as-code.
- [[appliance-provisioning]] — booth-PC provisioning runbook (Dell 7070, i5-8500, discrete Nuvoton TPM): BIOS/Secure-Boot → direct-flash Ubuntu 26.04 USB (not Ventoy) → passphrase-LUKS install → manual PCR-7 TPM seal (workaround for the installer's dbt PCR_UNUSABLE error) → Docker. Verified on hardware 2026-06-23; TPM auto-unlock works.
- [[edge-controller-hardware]] — 🟡 OPEN (2026-10-22): research memo for the resilient core's hardware (the Linux controller that fronts every device, takes over at one missed probe, power-cycles the PC only when it is dead at every layer). Requirements R1–R9; candidates Pi 5 + HAT (lab), CM4/CM5 industrial carriers (Sfera Iono Pi Max v2 / Strato Pi Max, Seeed reComputer, RevPi), Rockchip SBCs (ODROID-M2/M1S, Orange Pi 5 Plus/Zero 3, Radxa, NanoPi R3S-LTS), Olimex, Teltonika as the LTE router, ODROID-H4+ x86. Recommendation: order an Iono Pi Max v2, port the proxy to Node on a Pi 5 now.