Measured: the 10 fps cap cut the 12.5 fps entry camera to ~7 fps and added ~40 ms; the server
otherwise adds no measurable delay. CAMERA_LIVE_MAX_FPS still sets a cap when wanted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oMncSaVmKRKk1UvN4
Clicking a tile's picture opens a large view that streams live on demand (vehicle event
or not), with a Live / Snapshot switch — a camera-started stream can be stopped to see the
last snapshot, and a snapshot can be switched to live. Closing the view returns the tile to
automatic: a user-started stream stops, a camera-started one carries on in the tile. The
tile and the large view share one live socket. Live is marked by a pulsing green badge.
Verified in headless Firefox against the park-lab cameras.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oMncSaVmKRKk1UvN4
Footer camera chips open/close a tile per camera (bottom right, ~15% wide, stacking
leftwards); the open set is a per-user preference (users.open_cameras). A tile shows the
camera's newest entry/exit snapshot and switches to live video while that camera pushes
vehicle events (per-camera activity, same 30 s TTL as lane status).
- devices: RTSP MJPEG client + RFC 2435 RTP/JPEG reassembly; Hikvision openLiveStream()
on the sub-stream (x02, must be MJPEG — H.264 is refused with that reason)
- server: CameraLiveHub (one shared upstream per camera, latest-frame delivery, fps cap,
linger, backoff), CameraActivity, /api/cameras/:id/latest-snapshot, WS
/api/cameras/:id/live (shared handshake auth with /api/ws + device:read),
PUT /api/auth/open-cameras, migration 0033 (open_cameras + snapshot device/time index)
- web: CameraDock, footer toggles, binary frames in the platform socket (Tauri too)
- .gitattributes: *.jpg / *.bin binary (byte-exact test fixtures)
Verified on park-lab cameras end to end and in headless Firefox.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- lpr-camera: DS-2CD1043G2-LIU (4MP) and DS-2CD1083G2-LIU (8MP) both serve
main-stream ISAPI snapshots; only concurrent pulls 503
- passage-confirmation: park-lab rig (entry .6, exit .7, one shared lane),
camera capabilities, shared-lane open question
- dingtian-relay: 'config api timeout' = HTTP session check on; works with the
session cookie on this firmware; resolution and triage
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- entities/zkteco-cmp200-barrier: terminal map from the CMP200 manuals, board
photo findings (v1.2 layout, RS485 socket empty), relay-contact drive from
the Dingtian, interlocked close relay, limit outputs as status inputs
- concepts/passage-confirmation: barrier model open question answered for the
unit on hand
- decisions/appliance-provisioning: Komodo gotchas 14-16 from the park-lab
reinstall (2026-11-13)
- index and log entries
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5ofaSqgLGHMGSL3xYN
Text files normalised to LF; images, icons, fonts and PDFs marked binary;
wiki/raw/ left byte-for-byte (one legacy SQL source is committed with CRLF).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Wiki pages written on 2026-10-24 but left uncommitted before the Windows to
Linux migration: passage-confirmation concept, open question 20, deploy and
query log entries, index line, incident and barrier page updates. Drops the
stray tracked __pycache__ file. Line endings normalised to LF.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
park-2 (2026-10-24): GET /api/sessions/active ran ~2 s synchronously — PayStation.activeSessions
called quote() per open unpaid transient (664 rows), each 3-4 unindexed ledger_events scans by
identity — 2234x/day. The frozen event loop made the Dingtian driver's 2 s timer fire before the
already-received UDP reply (timers run before poll I/O), so healthy pulses logged "timeout"; the
subscription flow then unwound before firing the camera or writing the sessions row, leaving
signed entries with no snapshot. Cost grew ~120 ms/day with the operator's open-ticket count.
- pay-station: price every list row from the one ledger scan (rows grouped per identity ->
#quoteFromRows); tariff resolver built once per request; quote(identity) wraps the same core.
validations: sessionValidationsFromRows / liveValidationsFromRows. Test pins list == quote().
- db 0032_hot_path_indexes: ledger_events(identity,index), device_events(category,kind,
occurred_at), device_events(kind,occurred_at), snapshots(identity), sessions(state),
sessions(subscription_id,state). Additive.
- access-dingtian binaryUdp: defer the timeout rejection with setImmediate so a datagram that
already arrived wins over an expired timer.
- subscription-flow: snapshot fired and session cache written/closed BEFORE the pulse.
wiki/concepts/park-2-event-loop-stall.md has the full analysis.
A NodeMCU v3 (ESP8266) that speaks the Dingtian wire contract (binary UDP 60000 with
relay_pw, string UDP 60001, config CGI incl. the setconfig gotcha, userset.cgi, Digest
input push) so the booth's existing driver needs no change, plus a heartbeat/command/
watchdog path to an ephemeral cloud stand-in (poc/cloud-standin.mjs). Verified at park-lab:
the booth's assign flow configured it like real hardware and a button press reached the
booth (401→Digest→200) and the cloud with the booth's status. Watchdog probes /health and
power-cycles the PC via a spare relay with backoff. IO behind one interface for the ESP32/
Dingtian port.
wiki: relay-proxy-firmware page; esp32-flashability-test runbook (esptool lock test);
dingtian-relay "can we flash our own firmware" (vendor locks the standard SKU);
site-device-installation: booth ufw must allow device-net → 3000 (push targets PORT, not
Caddy's 80); open-questions: cloud takeover vs signed ledger (parked).
.gitignore: firmware venv/.pio/secrets.h.
- resources.toml: repoint the park-lab stack from art-docker-station to the
dedicated park-lab Periphery; drop the shared-host port remaps
(HTTP_PORT/SERVER_PORT/VISION_HOST_PORT); entitle every registered module
(parking,validation,carwash); pin TAG=stage-9659373 (park-2's image).
- appliance-provisioning §5: both CLASS= lines in /etc/grub.d/10_linux work
for --unrestricted (the else-branch interpolates the first); submenu stays
restricted; conffile note.
- appliance-provisioning §1: authentication/Admin/is_enabled=1 means a BIOS
admin password IS set; writes without it fail "Operation not supported",
wrong ones "Permission denied"; feed it via read -rs.
- fleet-deployment-komodo: park-lab back on a dedicated box (2026-10-20),
preflight list (docker group, periphery enable + linger, reboot so the user
manager picks up the group), destroy the old stack on the previous host.
Follow-up to ec01591. A first decision that threw was cached and replayed
to repeats inside the window, and the telemetry hook on it had no rejection
handler, so one throwing flow became an unhandled rejection per repeat. A
failed decision is now forgotten (the next read decides afresh) and the
hook handles rejection. The recent-reads map prunes above 512 entries and
never exceeds 4096, whatever a misbehaving reader sends.
park-2, 2026-10-11: the DT-008 entry reader reported one card twice 560 ms
apart; the permit flow opened two sessions on the same permit and pulsed the
barrier twice (caught by the new relay-pulse log). The 24h before showed
2 entry + 2 exit opens within 2 s of the previous one.
ReadDispatcher now treats the same value from the same reader inside the
reader's debounceMs window as ONE presentation: the first verdict is replayed
(same beep, no second decision, nothing signed twice) and the repeat lands in
device_events as unsigned telemetry. Every lane and every credential kind,
so a ticket re-scanned at exit inside its grace period no longer signs a
noSession refusal for a car that just left. The window slides with repeats;
a repeat arriving while the first read is still deciding gets that decision.
The window is a Setup field on all three reader drivers ("Same-code
debounce (ms)", default 5000, 0 = off); readers configured before the field
existed get the default.
Measured on park-2 (i5-9500): a main-stream pull is ~0.1s and /analyze
~0.25s while the host sat under 3% CPU; the loop's fixed 1s sleep was the
limit (one frame per ~1.35s). The camera's picture endpoint is single-
threaded (4 parallel GETs -> two 503s) and the vision service serialises
inference, so no threads: pulls are back-to-back and serial per camera,
~3 fps. ANPR_POLL_MS is now a floor (default 0).
The loop no longer breaks on the first confident plate, and the 12s
camera-level debounce is gone: 40 of 57 plate-driven opens at park-2 had a
push dropped in that blind window, so a tailgating car was never looked at.
Each confident plate is settled once per loop (emit / anpr-skip / decline)
and the loop runs on while the camera keeps pushing, so a second car is
read by the same loop. Debounce is keyed deviceId:plate only; the card/QR
mid-poll guard is per subscriber instead of aborting the loop; the pass
sample is one per plated car. ANPR_POLL_WINDOW_MS=0 is honoured (it used to
fall back to 8s silently).
The camera event model was re-confirmed from 2780 pushes: every push is an
independent VMD/active with activePostCount=1, ~1.2s apart while a car
moves, never inactive. Nothing is held for 30s on the camera side.
park-2's cameras burned Beijing time into every frame: factory zone CST-8,
and the sync compared instants only, so zero drift meant the zone was never
touched. The G3H firmware also accepts a POSIX zone with a DST rule, echoes
it back, and ignores the rule.
syncClock now derives the site's current UTC offset as a fixed Hikvision
zone (hikvisionFixedZone) and rewrites it when it differs, sending the clock
with it. The device monitor adds a third trigger beside offline->ready and
the 24h backstop: the moment the site's UTC offset changes, so a DST switch
is handled within one poll. ClockSyncResult reports zoneChanged/timeZone.
Both park-2 cameras were set to CST-2:00:00 by hand on 2026-10-09; this
must be deployed there before 2026-10-25 or the OSD reads 1h ahead from
that day until it is.
One pulse path, pulseBarrier (relay-pulse.ts), for all six callers: entry
button/operator mint, reader and booth exits, subscription opens, manual
(forgiven) exits and the setup relay test. Each pulse writes an info line
naming relay, controller, direction, identity and operator, and inserts a
device_events row of kind "relay" for success and failure alike; failures
are still re-thrown so each flow keeps its own anomaly handling.
Prompted by the 2026-10-09 park-2 "barrier opened by itself" claim: the
ledger showed the why, but nothing recorded the moment a relay was actually
driven. The signed ledger stays the authority; this is unsigned telemetry.
Also git-ignores tmp/ (site snapshots pulled for incident review).
BarrierLight gains onOpen/opening (not presence-gated). For an operator with
barrier:create + own shift the exit tile is labelled 'manual exit', clickable and
opens the manual-exit dialog while still showing the lane state; for everyone else it
stays the plain 'Dalje' light. The separate ghost button is removed. Wiki as-built note.
- BoothScreen: the no-ticket open uses the app's Modal (explainer, optional reason,
red confirm; Enter confirms, Escape/Cancel abort) instead of a browser prompt.
- en/sq: forgive/forgiven/forgone wording dropped from every user-facing string
(buttons, dialog, results, live-feed reasons, shift figures); Albanian edited by the
user, English aligned. Printed Z line is 'Dalje manuale (N)'. The signed English
fallback sentences follow. Identifiers (exit.forgiven, forgoneMinor, barrier:create)
unchanged.
- wiki: forgiven-exit §Wording, shift, log.
The owner (or any role the owner grants barrier:create) lets a car out for free.
Exit side only. Every use is signed, attributed, photographed and on the operator's
Z-report; the shift's cash/card/drawer are untouched by construction.
- shared: resource 'barrier' + permission 'barrier:create'; reason codes
exit.forgiven / exit.forgiven.noSession; LedgerPayload.forgoneMinor.
- pay-station: forgive() signs a $0 payment carrying the quoted fee as forgoneMinor
(no tender), refuses a ticket with module charge lines (a wash is not forgiven).
- exit-flow: reopenBarrier(..., { forgiven }) bypasses the walk-back check and stamps
the forgiven reason on the anomaly + vehicle_exit; forgiveExitNoSession() for a car
with no ticket (anomaly under forgiven:<id> + exit snapshot + pulse). Relay driving
shared in #pulseExit.
- route POST /api/barrier/forgive { identity?, note? }: barrier:create + open shift;
the reason is optional (an empty note is signed as '(no reason given)').
- shift-service: forgoneTotalMinor + forgoneCount on the report/summary/signed
shift_z_report (only when > 0), print line 'Dalje të falura (N)'.
- web: 'Forgive & open' in the pay/exit modal for an open transient that owes money;
'Forgive & open exit' on the booth header for the no-ticket case; forgone line on
the X-report, close confirm and history; en/sq. Prints nothing.
- tests: exit-flow, pay-station, shift-service, HTTP route (403 without the
permission, 409 no shift, empty note accepted, ledger sequence, report figures).
- wiki: decisions/forgiven-exit.md (decision + as-built), booth-exit-flow, shift,
index, log.
The entry stream for the reviewer was fed from the session-tied read only (ticket
printed / exit signed). park-2 ran an afternoon with its barriers up: hundreds of
camera vehicle pushes, zero tickets, zero samples.
- anpr-entry: keep the best-framed vehicle of each poll loop (highest body-type
confidence with a box), store that frame as a snapshot (identity pass:<id>, no
session) and emit a vehicle read with the camera id — plate or no plate. One
sample per detection, fire-and-forget, never on the ANPR path.
- snapshot.ts: normalizedBoxes() shared by the session-tied read and the bridge;
vehicle reads now carry deviceId.
- review-outbox: sampleEntry(deviceId) dedups per camera for 30 s so the pass
sample and a ticket entry's read (same car, seconds apart) go once.
- wiki: outbox page (entry stream, troubleshooting checklist for 'nothing arrives':
the month-long silence was a missing Netbird policy, not code), park-2 camera
port-forward procedure (site-device-installation §7), log.
Measured on park-2 minutes after a redeploy: 128 server lines / 15 min, 60 of them the Docker
HEALTHCHECK's /health logged as "incoming request" + "request completed"; 160 vision lines,
143 of them uvicorn access lines for GET /health (Docker's probe + the booth server's footer
chip polling every 8 s). Levels were never the problem — all of it was info.
- server: /health route logLevel "silent"; disableRequestLogging + an onResponse hook that
logs one line "METHOD url → status Nms". That flag also stops Fastify's default error
handler from logging handler errors, so an onError hook logs 5xx with the stack
(fastify 5.8.5 lib/error-handler.js checks the same flag). Pinned by request-logging.test.ts.
- vision: a logging.Filter on uvicorn.access drops /health access lines (tested).
- devices: stubLog gains a level; the per-snapshot "captureSnapshot (N bytes)" line is
debug; the hik-alarm HIT line is debug (ACCEPTED/REJECTED carry everything).
LOG_LEVEL=debug restores all of it. Wiki: app-logs §Noise cut.