feat(devices): DT-008 reader discovery + auto-configuration over the vendor UDP protocol
Build & push images / images (push) Successful in 3m7s
Build & push images / images (push) Successful in 3m7s
The Dingtian DT-008's Windows-only config tool speaks a small binary UDP protocol (reader :24680 unicast get/set, :24582 broadcast search/set-network), reversed in wiki/raw/dingtian_qr_linux (PROTOCOL.md + dingtian_qr.py, copied to scripts/). Reading park-2's readers with it from the booth found both in WG26 output mode — the "beeps but captures nothing" enrolment failure: they never pushed HTTP at all. The app now speaks the protocol itself (packages/devices dingtian-qr-config.ts, Node dgram, host-network container) and the dingtian-qr-reader driver uses it: - discover(): first driver to implement the wizard's Scan capability; rows show serial, IP, output mode, current server target, card format, firmware. - preconditions: output type must be HTTP (fixable — save switches it); typed serial must equal the reported one and the reader must answer on UDP (both block the save). - configureInputPush(): set-network the reader's server to this booth's IP + listen port, confirmed by polling (the reader applies it without an ack and is silent for seconds). - usesPushAuth=false: the scan GET carries no credentials, so no push secret is stored. - a reader saved without an IP warns instead of failing (legacy vendor-tool setup). Verified on the bench unit: WG26→HTTP, target 8080→8081→8080, struct byte-identical after. 15 protocol tests against a fake reader + 17 adapter tests. Wiki: device-discovery, first-run-setup, dingtian-dt008-reader, site-device-installation §2 (SSH procedure; the "needs a Windows laptop" claim withdrawn), new source page dingtian-qr-linux-tool.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
type: concept
|
||||
tags: [parking, architecture, devices, setup]
|
||||
sources: [parking-system-architecture]
|
||||
updated: 2026-06-15
|
||||
updated: 2026-10-08
|
||||
---
|
||||
|
||||
# Device Discovery
|
||||
@@ -20,10 +20,23 @@ device carries an `id`, a `label`, a `config` blob to **auto-fill** the setup fo
|
||||
(firmware, MAC, …). The [[device-registry]]'s `isDiscoverable()` guard lets the system treat it
|
||||
as optional; the setup catalog returns a `discoverable` list of driver ids.
|
||||
|
||||
> **No current driver implements discovery.** The [[dingtian-relay]] board uses a fixed IP
|
||||
> (entered/known at setup). The capability remains for future UDP-discoverable devices (cameras
|
||||
> via ONVIF, etc.). The worked example below is the (removed) UHPPOTE driver — kept because the
|
||||
> **broadcast gotchas are transferable** to any UDP discovery we add later.
|
||||
> **Implemented by one driver (2026-10-08): the [[dingtian-dt008-reader|Dingtian DT-008 QR/RFID
|
||||
> reader]]** (`dingtian-qr-reader`), via the vendor tool's UDP protocol reversed in
|
||||
> [[dingtian-qr-linux-tool]] (`packages/devices/src/drivers/dingtian-qr-config.ts`). The
|
||||
> [[dingtian-relay]] board still uses a fixed IP. The UHPPOTE example below is historical, kept
|
||||
> because the **broadcast gotchas are transferable** — the DT-008 driver applies all of them.
|
||||
|
||||
## DT-008 reader discovery (current)
|
||||
|
||||
`discover()` sends the search command (2) to the **subnet-directed broadcast of every local
|
||||
IPv4 interface** on UDP 24582 and collects the DeviceInfo replies (3) for 2 s, deduped by serial;
|
||||
then, per reader, a unicast params read (30) so the wizard row shows what matters **before**
|
||||
assigning: `output` mode (HTTP vs WG26/RS232/…), current `server:port` target, push `url`
|
||||
extension, `cardFormat`, `firmware`. "Use" fills `serial` + `host`. Verified on the bench unit
|
||||
(HC002721 @ 10.0.10.12) and, read-only, on park-2's two readers. Needs an L2 segment shared
|
||||
with the readers: works from the booth (host-network server) and the device VLAN; **not** from a
|
||||
bridged dev container (`docker-compose.dev.yml`) nor across Netbird — there, use
|
||||
`scripts/dingtian_qr.py get <ip>` on the booth instead.
|
||||
|
||||
## UHPPOTE discovery (historical example)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
type: concept
|
||||
tags: [parking, architecture, devices, admin]
|
||||
sources: [parking-system-architecture]
|
||||
updated: 2026-06-15
|
||||
updated: 2026-10-08
|
||||
---
|
||||
|
||||
# First-Run Setup (device selection)
|
||||
@@ -30,6 +30,16 @@ lane** — the pool-of-spaces model; see [[entry-exit-points]].
|
||||
authenticated input push ([[device-input-flow]]) — the admin never touches the device's own web
|
||||
UI. **Fails the save** (no DB row) if the device can't be configured, so there are no
|
||||
orphan/half-configured rows. On success persists to `devices`.
|
||||
**DT-008 readers (2026-10-08)** go through the same pipeline when their IP is given: the
|
||||
precondition check reads the reader over the vendor UDP protocol ([[dingtian-qr-linux-tool]])
|
||||
and reports *output type ≠ HTTP* (fixable — the save switches it) and *typed serial ≠ reported
|
||||
serial* (not fixable — the admin must enter the real one); `configureInputPush` then
|
||||
set-networks the reader's push target to this booth's IP + listen port and confirms it by
|
||||
re-reading (the reader is silent for a few seconds after the write, so it polls). The reader's
|
||||
scan GET carries no credentials, so no push user/password is persisted for it
|
||||
(`usesPushAuth = false`). With **no IP** nothing is configured and the save succeeds with a
|
||||
warning — the reader must then be set up with the vendor tool / `scripts/dingtian_qr.py`
|
||||
([[site-device-installation]] §2).
|
||||
4. **Remove** — `DELETE /api/setup/assign/:id` (admin-only) drops one instance's row. Only our
|
||||
row is removed; the device itself is not un-hardened/un-configured (a stale push from an
|
||||
unknown device id is already rejected, and re-assigning reconfigures it).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
type: reference
|
||||
tags: [parking, runbook, installation, devices, network, field]
|
||||
sources: []
|
||||
updated: 2026-09-09
|
||||
updated: 2026-10-08
|
||||
---
|
||||
|
||||
# Site device installation — know it BEFORE you are standing in the booth
|
||||
@@ -26,8 +26,10 @@ plan, and only then does anything else see it.
|
||||
- A laptop with an Ethernet port and the right to add a **second static IPv4 address** to it
|
||||
(Windows: adapter → IPv4 → Advanced → add). Under WSL, remember the source-address bug
|
||||
([[wsl-dev-networking]]): after adding a temporary address, `ping` may work while HTTP times out.
|
||||
- The Dingtian reader tool **`QRCode_v1_6_5.exe`** (Windows) — the only way to set a DT-008's IP,
|
||||
server target, prefixes and symbologies. A browser is enough for everything else.
|
||||
- The Dingtian reader tool **`QRCode_v1_6_5.exe`** (Windows) **or `scripts/dingtian_qr.py`**
|
||||
(Python 3, runs on the booth itself — see [[dingtian-qr-linux-tool]]) for a DT-008's IP, server
|
||||
target, output type, prefixes and card format. Symbologies are set in neither (no known path).
|
||||
A browser is enough for everything else.
|
||||
- Patch cables, a USB A–B cable (printers), the site's **address plan** (below) filled in, the
|
||||
app **admin** password, and a fresh Komodo **onboarding key** if the booth PC is new
|
||||
([[appliance-provisioning]] §7a).
|
||||
@@ -87,16 +89,27 @@ edges reach the booth PC. You enter the relay map (which relay is entry/exit/bot
|
||||
|
||||
## 2. Dingtian DT-008 QR + RFID readers
|
||||
|
||||
**Factory:** IP `192.168.1.99`; no web UI — everything is set with **`QRCode_v1_6_5.exe`** over the
|
||||
network. See [[dingtian-dt008-reader]].
|
||||
**Factory:** IP `192.168.1.99`; no web UI — everything is set over the network with
|
||||
**`QRCode_v1_6_5.exe`** (Windows) or **`scripts/dingtian_qr.py`** (any OS; same UDP protocol,
|
||||
reversed 2026-10 — [[dingtian-qr-linux-tool]]). See [[dingtian-dt008-reader]].
|
||||
|
||||
**By hand, in the tool, per reader:**
|
||||
**From the wizard (app builds after 2026-10-08):** add a reader → **Skano LAN-in / Scan the
|
||||
LAN** lists every DT-008 on the device VLAN with its mode and current server; **Use** fills
|
||||
serial + IP; **Test** says whether it is in HTTP mode and whether the serial matches; **Save**
|
||||
switches it to HTTP and points its server at this booth (items 2 and 6 below, done for you).
|
||||
Items 1, 3, 4, 5 are still manual (IP via `set-network`, prefixes/card format via `set`, both in
|
||||
`scripts/dingtian_qr.py`; symbologies only in the exe). Needs the reader's IP in the form — with
|
||||
it blank the save warns and configures nothing.
|
||||
|
||||
**By hand (vendor tool, or `scripts/dingtian_qr.py` from the booth), per reader:**
|
||||
|
||||
1. **Unique device IP** (`.7` entry, `.8` exit). Two readers on one IP was the 2026-06-18
|
||||
"wrong barrier" incident — scans land on the wrong device row.
|
||||
2. **Server IP** = the booth PC (`10.0.10.203`), **server port** = the booth's HTTP port (80 behind
|
||||
the prod proxy); "server language" can stay whatever it is (php/jsp/asp/aspx/cgi are all
|
||||
served — the reader GETs `/qa/mcardsea.<ext>`).
|
||||
2. **Output type = `HTTP`** (the tool also offers RS232 / WG26 / WG34 / RS485 / USB keyboard /
|
||||
USB serial — in any of those the reader beeps locally and never contacts the booth), **Server
|
||||
IP = THIS site's booth** (park-2 is `10.0.10.101`; `10.0.10.203` is the lab — never copy it),
|
||||
**server port** = the booth's HTTP port (80 behind the prod proxy); "server language" can stay
|
||||
whatever it is (php/jsp/asp/aspx/cgi are all served — the reader GETs `/qa/mcardsea.<ext>`).
|
||||
3. **Output prefixes:** `QRCode Output Prefix` = `Q:`, `Card Output Prefix` = `K:` (channel
|
||||
tagging — a printed clone of a card cannot pass as the card).
|
||||
4. **Card Input format = `6H`** (defines the UID shape enrolled; changing it later orphans every
|
||||
@@ -110,8 +123,32 @@ network. See [[dingtian-dt008-reader]].
|
||||
`READ serial=… → device=… verdict=… dir=…`; the reader beeps **twice** on accept, once on refuse,
|
||||
and only after the server's reply (no reply = no beep, the scan still happened).
|
||||
|
||||
**From the booth, no Windows (2026-10-08):** `get` / `set` are unicast UDP, so they run on the
|
||||
booth host over SSH (Python 3 is on every booth; the server container has none):
|
||||
|
||||
```
|
||||
scp scripts/dingtian_qr.py <booth>:/tmp/ && ssh <booth> python3 -I /tmp/dingtian_qr.py get 10.0.10.7
|
||||
ssh <booth> python3 -I /tmp/dingtian_qr.py set 10.0.10.7 --output-type 3 # item 2: HTTP mode
|
||||
```
|
||||
|
||||
`get` prints every field above by name (`output_type`, `server`, `server_port`, `card_input_format`,
|
||||
`qr_prefix`, `card_prefix`…). `set` changes only the fields given and re-sends the rest as read.
|
||||
Only `discover` / `set-network` need the L2 broadcast (run them on the booth, not across Netbird).
|
||||
|
||||
**Trap:** a factory reset or a swapped unit silently loses items 3–5. Re-apply all of them.
|
||||
|
||||
**Trap (park-2, 2026-10-08): "it beeps, so it works" is false.** Enrolling a card failed on both
|
||||
readers although each beeped. The booth log held **zero** `/qa/mcardsea` requests over 21 h and the
|
||||
capture window saw only the form's own polls: the readers never contact the booth at all. A beep
|
||||
without a `READ` line in the log means the reader is **not in HTTP mode or points at another
|
||||
server** — fix it on the reader (item 2), nothing in the app or the wizard can. Diagnose in one
|
||||
command on the booth: `docker logs <server> --since 1h 2>&1 | grep -c mcardsea` while a card is
|
||||
presented — `0` = reader-side; then **read the reader itself** with `dingtian_qr.py get` (above).
|
||||
park-2's answer: both readers `output_type = WG26` (server `10.0.10.101:3000`, JSP, 6H, no
|
||||
prefixes) — they were left in Wiegand mode at install, so every scan went to a Wiegand line
|
||||
nobody is listening on. (Port 3000 is fine: the host-net server listens there directly; 80 via
|
||||
Caddy works too.) Fix = `set <ip> --output-type 3` per reader, then re-run the enrolment.
|
||||
|
||||
**Trap (2026-09-17): two DT-008 units read disjoint card sets.** park-buzi's units (`H05M…`)
|
||||
read the site's 125 kHz cards and the fresh lab unit (`HC002721`) reads only 13.56 MHz cards,
|
||||
although the box leaflet claims both. Batch variant, a dead 125 kHz front end, or a non-EM 125 kHz
|
||||
|
||||
Reference in New Issue
Block a user