Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4593a397dd | |||
| 4d1d245680 |
@@ -200,12 +200,97 @@ describe("hikvision syncClock — the 1970 power-cut recovery (ISAPI /System/tim
|
||||
await expect(cam().syncClock(HOST_NOW, 60)).rejects.toThrow("clock set failed: HTTP 403");
|
||||
});
|
||||
|
||||
it("the dahua driver does NOT claim the capability (no ISAPI time endpoint)", async () => {
|
||||
it("both camera drivers claim the capability (Dahua via global.cgi since 2026-09-17)", async () => {
|
||||
const { dahuaDriver, hikvisionDriver } = await import("./camera.js");
|
||||
const { isClockSyncable } = await import("../interfaces.js");
|
||||
const mk = (d: typeof dahuaDriver) =>
|
||||
d.create({ host: "10.0.10.12", port: 80, username: "admin", password: "x", channel: 1 });
|
||||
expect(isClockSyncable(mk(dahuaDriver))).toBe(false);
|
||||
expect(isClockSyncable(mk(dahuaDriver))).toBe(true);
|
||||
expect(isClockSyncable(mk(hikvisionDriver))).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
// Dahua — verified against an IPC-HFW2549T-AS-IL (fw 2.880) on 2026-09-17. The CGI
|
||||
// numbers snapshot channels from 1 (channel=0 → HTTP 400), ignores any stream
|
||||
// selector, and speaks NAIVE local wall time on global.cgi. See camera.ts and
|
||||
// wiki/entities/dahua-ipc-hfw2549t.md.
|
||||
describe("dahua snapshot URL — channel is 1-BASED, no stream selector", () => {
|
||||
async function pathFor(config: Record<string, unknown>): Promise<string> {
|
||||
const { dahuaDriver } = await import("./camera.js");
|
||||
digestGet.mockReset();
|
||||
digestGet.mockResolvedValue(reply(200));
|
||||
dahuaDriver.create(config as never).captureSnapshot({ direction: "entry" });
|
||||
return String((digestGet.mock.calls[0]![0] as { path: string }).path);
|
||||
}
|
||||
|
||||
it("channel 1 as entered → channel=1 (the old `ch - 1` sent 0 → HTTP 400 on hardware)", async () => {
|
||||
expect(await pathFor({ host: "1.2.3.4", channel: 1 })).toBe("/cgi-bin/snapshot.cgi?channel=1");
|
||||
});
|
||||
|
||||
it("defaults to channel 1 when none is configured", async () => {
|
||||
expect(await pathFor({ host: "1.2.3.4" })).toBe("/cgi-bin/snapshot.cgi?channel=1");
|
||||
});
|
||||
|
||||
it("channel 2 passes through; a stream setting is ignored", async () => {
|
||||
expect(await pathFor({ host: "1.2.3.4", channel: 2, stream: 2 })).toBe("/cgi-bin/snapshot.cgi?channel=2");
|
||||
});
|
||||
|
||||
it("a zero/negative channel is clamped to 1 rather than sent as-is", async () => {
|
||||
expect(await pathFor({ host: "1.2.3.4", channel: 0 })).toBe("/cgi-bin/snapshot.cgi?channel=1");
|
||||
});
|
||||
});
|
||||
|
||||
describe("dahua syncClock — global.cgi getCurrentTime/setCurrentTime, naive wall time", () => {
|
||||
const HOST_NOW = "2026-09-17T10:35:49+02:00";
|
||||
const timeReply = (naive: string) => reply(200, `result=${naive}\r\n`);
|
||||
|
||||
async function cam() {
|
||||
const { dahuaDriver } = await import("./camera.js");
|
||||
return dahuaDriver.create({ host: "10.0.10.11", port: 80, username: "admin", password: "x", channel: 1 }) as unknown as {
|
||||
syncClock(localIso: string, maxDriftSec: number): Promise<{ driftSeconds: number | null; synced: boolean }>;
|
||||
};
|
||||
}
|
||||
|
||||
it("in-sync camera: reads, does NOT set", async () => {
|
||||
digestRequest.mockResolvedValueOnce(timeReply("2026-09-17 10:35:40"));
|
||||
const r = await (await cam()).syncClock(HOST_NOW, 60);
|
||||
expect(r).toEqual({ driftSeconds: 9, synced: false });
|
||||
expect(digestRequest).toHaveBeenCalledTimes(1);
|
||||
const get = digestRequest.mock.calls[0]![0] as { method: string; path: string };
|
||||
expect(get.method).toBe("GET");
|
||||
expect(get.path).toBe("/cgi-bin/global.cgi?action=getCurrentTime");
|
||||
});
|
||||
|
||||
it("an hour behind (the bench unit: DST off, NTP off) → sets the HOST wall time, no offset", async () => {
|
||||
digestRequest
|
||||
.mockResolvedValueOnce(timeReply("2026-09-17 09:35:51"))
|
||||
.mockResolvedValueOnce(reply(200, "OK\r\n"));
|
||||
const r = await (await cam()).syncClock(HOST_NOW, 60);
|
||||
expect(r).toEqual({ driftSeconds: 3598, synced: true });
|
||||
const set = digestRequest.mock.calls[1]![0] as { method: string; path: string };
|
||||
expect(set.method).toBe("GET");
|
||||
expect(set.path).toBe("/cgi-bin/global.cgi?action=setCurrentTime&time=2026-09-17%2010%3A35%3A49");
|
||||
});
|
||||
|
||||
it("unparseable camera reply = infinite drift → syncs", async () => {
|
||||
digestRequest
|
||||
.mockResolvedValueOnce(reply(200, "Error\r\nBad Request!"))
|
||||
.mockResolvedValueOnce(reply(200, "OK"));
|
||||
const r = await (await cam()).syncClock(HOST_NOW, 60);
|
||||
expect(r).toEqual({ driftSeconds: null, synced: true });
|
||||
});
|
||||
|
||||
it("a 200 whose body is not OK is still a failed set (Dahua's 'Error' convention)", async () => {
|
||||
digestRequest
|
||||
.mockResolvedValueOnce(timeReply("1970-01-01 01:00:00"))
|
||||
.mockResolvedValueOnce(reply(200, "Error\r\nInvalid Argument!"));
|
||||
await expect((await cam()).syncClock(HOST_NOW, 60)).rejects.toThrow("clock set failed: HTTP 200 Error");
|
||||
});
|
||||
|
||||
it("a non-200 set surfaces as an error", async () => {
|
||||
digestRequest
|
||||
.mockResolvedValueOnce(timeReply("1970-01-01 01:00:00"))
|
||||
.mockResolvedValueOnce(reply(401, "denied"));
|
||||
await expect((await cam()).syncClock(HOST_NOW, 60)).rejects.toThrow("clock set failed: HTTP 401");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,8 +18,12 @@ import { digestGet, digestRequest } from "./http-digest.js";
|
||||
// Camera drivers — entry/exit snapshot-on-event. The host pulls a still over
|
||||
// HTTP when an event fires; the bytes are stored and referenced from the signed
|
||||
// event as an independent fraud-control record (the camera PULLS, it never pushes
|
||||
// to us). Hikvision (ISAPI) and Dahua (CGI) differ only in the snapshot URL and
|
||||
// channel encoding. Both use HTTP Digest auth (see ./http-digest.ts).
|
||||
// to us). Hikvision (ISAPI) and Dahua (CGI) differ in the snapshot URL, the
|
||||
// channel encoding and the clock endpoint. Both use HTTP Digest auth (see ./http-digest.ts).
|
||||
//
|
||||
// VERIFIED on hardware (2026-09-17): a Dahua IPC-HFW2549T-AS-IL (fw 2.880) at
|
||||
// 10.0.10.11 returns a 2880×1620 JPEG from /cgi-bin/snapshot.cgi?channel=1 —
|
||||
// and HTTP 400 for channel=0. See wiki/entities/dahua-ipc-hfw2549t.md.
|
||||
//
|
||||
// VERIFIED on hardware (2026-06-15): a Hikvision unit at 10.0.10.121 returns a
|
||||
// 2688×1520 JPEG from /ISAPI/Streaming/channels/101/picture with Digest auth.
|
||||
@@ -162,8 +166,8 @@ class HttpCamera implements CameraDevice {
|
||||
});
|
||||
}
|
||||
|
||||
/** Digest request against an arbitrary device path (ISAPI config reads/writes). */
|
||||
protected isapi(method: "GET" | "PUT", path: string, body?: string) {
|
||||
/** Digest request against an arbitrary device path (ISAPI / CGI config reads+writes). */
|
||||
protected deviceRequest(method: "GET" | "PUT", path: string, body?: string) {
|
||||
return digestRequest({
|
||||
host: this.#host,
|
||||
port: this.#port,
|
||||
@@ -197,7 +201,7 @@ class HikvisionCamera extends HttpCamera {
|
||||
* explicit offset makes the instant unambiguous regardless of that config.
|
||||
*/
|
||||
async syncClock(localIso: string, maxDriftSec: number): Promise<ClockSyncResult> {
|
||||
const read = await this.isapi("GET", "/ISAPI/System/time");
|
||||
const read = await this.deviceRequest("GET", "/ISAPI/System/time");
|
||||
if (read.status !== 200) {
|
||||
throw new Error(`clock read failed: HTTP ${read.status}`);
|
||||
}
|
||||
@@ -221,7 +225,7 @@ class HikvisionCamera extends HttpCamera {
|
||||
`<Time><timeMode>manual</timeMode><localTime>${localIso}</localTime>` +
|
||||
(timeZone ? `<timeZone>${timeZone}</timeZone>` : "") +
|
||||
`</Time>`;
|
||||
const put = await this.isapi("PUT", "/ISAPI/System/time", body);
|
||||
const put = await this.deviceRequest("PUT", "/ISAPI/System/time", body);
|
||||
if (put.status !== 200) {
|
||||
throw new Error(`clock set failed: HTTP ${put.status}`);
|
||||
}
|
||||
@@ -230,6 +234,67 @@ class HikvisionCamera extends HttpCamera {
|
||||
}
|
||||
}
|
||||
|
||||
// --- Dahua clock sync (CGI global.cgi getCurrentTime / setCurrentTime) --------------
|
||||
// Same problem, different surface. The Dahua CGI reads and writes the clock as a
|
||||
// NAIVE local wall-time string ("2026-09-17 10:35:49", no offset) in whatever time
|
||||
// zone / DST the camera is configured for. We deliberately write the HOST's local
|
||||
// wall time verbatim: what must match the booth is the OSD timestamp burned into
|
||||
// every snapshot and the event times, i.e. the wall clock — not the camera's idea
|
||||
// of UTC. (The bench unit ran a year-round UTC+1 with DST off and NTP off; after
|
||||
// this sync its OSD read the booth's time.) VERIFIED on hardware 2026-09-17:
|
||||
// setCurrentTime answers 200 "OK" and getCurrentTime reads the new value back.
|
||||
// See wiki/entities/dahua-ipc-hfw2549t.md.
|
||||
|
||||
const DAHUA_TIME_PATH = "/cgi-bin/global.cgi?action=getCurrentTime";
|
||||
|
||||
/** "2026-09-17T10:35:49+02:00" (host localIso, WITH offset) → "2026-09-17 10:35:49"
|
||||
* (the naive wall time the Dahua CGI speaks). */
|
||||
function naiveWallTime(localIso: string): string {
|
||||
const m = localIso.match(/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2}:\d{2})/);
|
||||
if (!m) throw new Error(`syncClock: unparseable host time ${localIso}`);
|
||||
return `${m[1]} ${m[2]}`;
|
||||
}
|
||||
|
||||
/** Parse a naive "YYYY-MM-DD HH:MM:SS" as an instant in the HOST's zone — both sides
|
||||
* of the drift comparison go through this, so the zone cancels out. */
|
||||
function naiveMs(naive: string): number {
|
||||
return Date.parse(naive.replace(" ", "T"));
|
||||
}
|
||||
|
||||
class DahuaCamera extends HttpCamera {
|
||||
async syncClock(localIso: string, maxDriftSec: number): Promise<ClockSyncResult> {
|
||||
const read = await this.deviceRequest("GET", DAHUA_TIME_PATH);
|
||||
if (read.status !== 200) {
|
||||
throw new Error(`clock read failed: HTTP ${read.status}`);
|
||||
}
|
||||
// Reply body: "result=2026-09-17 09:35:51"
|
||||
const cameraNaive =
|
||||
read.body.toString("utf8").match(/result=(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})/)?.[1] ?? null;
|
||||
const hostNaive = naiveWallTime(localIso);
|
||||
|
||||
const cameraMs = cameraNaive ? naiveMs(cameraNaive) : NaN;
|
||||
const driftSeconds = Number.isFinite(cameraMs)
|
||||
? Math.round(Math.abs(naiveMs(hostNaive) - cameraMs) / 1000)
|
||||
: null;
|
||||
if (driftSeconds != null && driftSeconds <= maxDriftSec) {
|
||||
return { driftSeconds, synced: false };
|
||||
}
|
||||
|
||||
const set = await this.deviceRequest(
|
||||
"GET",
|
||||
`/cgi-bin/global.cgi?action=setCurrentTime&time=${encodeURIComponent(hostNaive)}`,
|
||||
);
|
||||
// Dahua answers 200 with a body of "OK"; a refused write is a non-200 or "Error".
|
||||
if (set.status !== 200 || !/^OK/.test(set.body.toString("utf8").trim())) {
|
||||
throw new Error(
|
||||
`clock set failed: HTTP ${set.status} ${set.body.toString("utf8").trim().slice(0, 40)}`,
|
||||
);
|
||||
}
|
||||
stubLog(this.driverId, `clock synced (was ${driftSeconds ?? "unparseable"}s off)`);
|
||||
return { driftSeconds, synced: true };
|
||||
}
|
||||
}
|
||||
|
||||
const channelField: ConfigField = {
|
||||
key: "channel",
|
||||
label: "Channel",
|
||||
@@ -329,15 +394,17 @@ export const dahuaDriver: CameraDriver = {
|
||||
id: "dahua",
|
||||
category: "camera",
|
||||
label: "Dahua camera",
|
||||
description: "Dahua snapshot via CGI (HTTP Digest).",
|
||||
description: "Dahua snapshot via CGI (HTTP Digest) + clock sync.",
|
||||
transports: ["tcp-ip"],
|
||||
configFields: cameraConfigFields,
|
||||
// Dahua channels are 0-based on the CGI; the admin enters 1-based. No stream in the
|
||||
// path (the second arg is ignored — Dahua has no main/sub snapshot distinction here).
|
||||
// snapshot.cgi channels are 1-BASED, exactly as the admin enters them (only Dahua's
|
||||
// configManager TABLES are 0-indexed — the earlier `ch - 1` here drew a permanent
|
||||
// HTTP 400 on real hardware, 2026-09-17). No stream in the path: `subtype` is
|
||||
// ignored by snapshot.cgi, the still always comes off the main stream.
|
||||
create: (c) =>
|
||||
new HttpCamera(
|
||||
new DahuaCamera(
|
||||
"dahua",
|
||||
c,
|
||||
(ch) => `/cgi-bin/snapshot.cgi?channel=${Math.max(0, ch - 1)}`,
|
||||
(ch) => `/cgi-bin/snapshot.cgi?channel=${Math.max(1, ch)}`,
|
||||
),
|
||||
};
|
||||
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Bench sink for the Dingtian DT-008 QR/RFID reader.
|
||||
|
||||
Answers the reader's HTTP-GET push on any path (/qa/mcardsea.php|jsp|asp|aspx|cgi) with the
|
||||
vendor-SDK verdict JSON and `Connection: close`, and prints one line per read. Stdlib only.
|
||||
|
||||
python3 scripts/reader-sink.py # port 80 (needs sudo/admin), refuse = 1 beep
|
||||
python3 scripts/reader-sink.py -p 3000 --accept # accept = 2 beeps, output 0
|
||||
|
||||
Point the reader's Server address/port at this machine (QRCode tool → Setting → Network parameter).
|
||||
See wiki/entities/dingtian-dt008-reader.md.
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
import time
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||
from urllib.parse import parse_qs, urlsplit
|
||||
|
||||
ACCEPT = False
|
||||
|
||||
|
||||
class Sink(BaseHTTPRequestHandler):
|
||||
protocol_version = "HTTP/1.0"
|
||||
|
||||
def log_message(self, *_): # silence the default access log; we print our own line
|
||||
pass
|
||||
|
||||
def _handle(self):
|
||||
q = {k: v[0] for k, v in parse_qs(urlsplit(self.path).query).items()}
|
||||
cardid = q.get("cardid", "")
|
||||
status = q.get("status", "")
|
||||
channel = "qr" if cardid.startswith("Q:") else "card" if cardid.startswith("K:") else "?"
|
||||
print(
|
||||
f"{time.strftime('%H:%M:%S')} {self.client_address[0]:15} serial={q.get('cjihao', '?'):10} "
|
||||
f"dev={q.get('mjihao', '?'):3} dir={'in' if status[-1:] == '1' else 'out' if status[-1:] == '0' else '?':3} "
|
||||
f"ch={channel:4} cardid={cardid!r} path={urlsplit(self.path).path}",
|
||||
flush=True,
|
||||
)
|
||||
body = json.dumps(
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"cardid": cardid,
|
||||
"cjihao": q.get("cjihao", ""),
|
||||
"mjihao": q.get("mjihao", ""),
|
||||
"status": 1 if ACCEPT else 0, # 1 = valid (2 beeps), 0 = invalid (1 beep)
|
||||
"time": str(int(time.time())),
|
||||
"output": 0,
|
||||
}
|
||||
],
|
||||
"code": 0,
|
||||
"message": "",
|
||||
}
|
||||
).encode()
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", "application/json")
|
||||
self.send_header("Content-Length", str(len(body)))
|
||||
self.send_header("Connection", "close") # the reader only acts once the socket closes
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
do_GET = _handle
|
||||
do_POST = _handle
|
||||
|
||||
|
||||
def main():
|
||||
global ACCEPT
|
||||
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
ap.add_argument("-p", "--port", type=int, default=80)
|
||||
ap.add_argument("-b", "--bind", default="0.0.0.0")
|
||||
ap.add_argument("--accept", action="store_true", help="reply status=1 (valid, 2 beeps) instead of 0")
|
||||
a = ap.parse_args()
|
||||
ACCEPT = a.accept
|
||||
print(f"reader sink on {a.bind}:{a.port} verdict={'ACCEPT' if ACCEPT else 'REFUSE'} (Ctrl-C to stop)", flush=True)
|
||||
HTTPServer((a.bind, a.port), Sink).serve_forever()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -112,6 +112,49 @@ and only after the server's reply (no reply = no beep, the scan still happened).
|
||||
|
||||
**Trap:** a factory reset or a swapped unit silently loses items 3–5. Re-apply all of them.
|
||||
|
||||
**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
|
||||
card format — unresolved. Rule until it is: **test a replacement reader against the site's actual
|
||||
cards before it ships**, and record the site's card technology. Quick sort of a card: an NFC phone
|
||||
detects 13.56 MHz, cannot see 125 kHz. Details: [[dingtian-dt008-reader]] §"Two units, two card
|
||||
sets".
|
||||
|
||||
**Identify what a reader can read — before it ships (2026-09-17).** Keep a **reference kit** in the
|
||||
lab: one known EM4100 125 kHz fob, one known Mifare Classic (M1) card, and a phone with NFC. Tap all
|
||||
three on the unit with the tool's log pane open (or [[dingtian-dt008-reader]] §Bench sink): a line
|
||||
per tap = that technology decodes. The phone always beeps on a 13.56 MHz unit with a random `08…`
|
||||
id (never a credential, but proves the 13.56 MHz radio). Then tap **the site's own cards**. Write
|
||||
the result on the site record next to the serial (`reads: EM4100 | M1 | both`). Serial families are
|
||||
only a hint (`H05M…` read park-buzi's 125 kHz cards, `HC…` did not); the vendor can confirm from a
|
||||
serial. A unit that fails the site's cards does not leave the lab.
|
||||
|
||||
**Parameters per card technology** — identical except one field:
|
||||
|
||||
| | 125 kHz site (park-buzi today) | 13.56 MHz site |
|
||||
| --- | --- | --- |
|
||||
| Card Input format | **`6H`** (what park-buzi's cards are enrolled with — never change on a live site) | **`8H`** preferred: the native UID is 4 bytes, `6H` drops one and two cards can collide — confirm `8H` on the lab unit before the first enrolment ([[open-questions]] #18) |
|
||||
| Output prefixes | `Q:` / `K:` | `Q:` / `K:` |
|
||||
| Output type / server | HTTP, booth IP, booth HTTP port | same |
|
||||
| Buzzer | On (the operator hears accept/refuse) | On |
|
||||
| Symbologies | QR + Code128 only | same |
|
||||
| Card stock | EM4100 (or whatever the reference test showed) — do not mix | Mifare Classic UID-based; note that a phone is never a card |
|
||||
|
||||
A site is one technology: once cards are enrolled the reader batch, the input format and the
|
||||
card stock are frozen together. Migrating means re-enrolling every credential.
|
||||
|
||||
**The tool's Setting tab (v1.6.5, seen 2026-09-17):** *Search device* lists units by serial; *Get
|
||||
parameter* loads one. *Network parameter*: IP / Netmask / Gateway / DNS1 / DNS2, DHCP (Static IP),
|
||||
**Server address / Server Port / HTTP Server Language**, its own *Set* button. *Format parameter*:
|
||||
Output type `HTTP`, **Card Input format** (`6H`), QRCode Output format/prefix/suffix, **Card Output
|
||||
format/prefix/suffix** (prefix fields are where `Q:` / `K:` go), serial baud/bits greyed out under
|
||||
HTTP, Low/High Pulse, its own *Set*. *External parameter*: Restart interval (12 h), Work mode
|
||||
(Normal), **Buzzer On/Off**, Scan code fill light, its own *Set*. Each group is written by **its own
|
||||
Set button** — setting the network and forgetting the format *Set* is easy. The log pane at the bottom
|
||||
echoes every card read by the tool (`… A238BC`), which is the quickest "did the radio see it" check.
|
||||
The *Test device* tab is the read monitor. Symbology selection was not found on this tab — locate it
|
||||
on the *Test device* tab or in a newer tool before relying on item 5.
|
||||
|
||||
## 3. Hikvision camera (DS-2CD1047G3H-LIU, AcuSense) — ANPR + snapshots
|
||||
|
||||
**Factory:** `192.168.1.64`, **inactive** until a password is set on first boot (browser at that
|
||||
@@ -145,6 +188,18 @@ database → **factory reset**, then redo 1–3 (the Vehicle target filter defau
|
||||
Point the Alarm Server at a dumb HTTP sink on the laptop if you need to see the verbatim body
|
||||
([[lpr-camera]] §"auto-enter but not auto-exit").
|
||||
|
||||
**If the camera is a Dahua** (first unit inspected 2026-09-17, [[dahua-ipc-hfw2549t]]): factory
|
||||
`192.168.1.108`, `admin` + a password set at first boot, web UI on port 80 (HTTPS off by default
|
||||
on the bench unit). In the wizard: driver `dahua`, host, `admin` password, **channel 1 as printed** (the
|
||||
driver sent `channel=0` → HTTP 400 until 2026-09-17; fixed). There is no HTTP Alarm Server to
|
||||
point at the booth: events would be read by the server holding an `eventManager.cgi?action=attach`
|
||||
stream (**not built yet** — a Dahua today gives snapshots + clock sync only, no lane busy/free
|
||||
and no ANPR bridge), so no "assign first, then go back to the camera" step — but SMD must be set
|
||||
to **Vehicle** on the camera. Set the time zone by hand; the app re-syncs the clock from the
|
||||
booth like it does for Hikvision (the bench unit ran 1 h behind with DST off; NTP is useless on
|
||||
the isolated VLAN). Five wrong logins lock `admin` for 5 minutes — check the password with one
|
||||
`curl --digest` before assigning.
|
||||
|
||||
## 4. Radar (vehicle presence at the entry barrier)
|
||||
|
||||
A dry-contact sensor into a Dingtian input, nothing on the network. Check with the board's input
|
||||
@@ -197,7 +252,10 @@ barcode with a real ticket (the KP-300H garbled overflowing barcodes until the g
|
||||
|
||||
- Factory address and configuration tool of the **Cashino KP-300H** and the **Rongta RP** units
|
||||
(both still unknown here).
|
||||
- The exact screens in `QRCode_v1_6_5.exe` for the reader's IP and server target (a screenshot).
|
||||
- Where in `QRCode_v1_6_5.exe` the **symbologies** are selected (the Setting tab has no such field;
|
||||
the IP / server / prefix fields are now described in §2).
|
||||
- The **card technology** each site uses and which reader batch reads it, on the site record next to
|
||||
the serial; and the result of the EM4100 test on the lab unit.
|
||||
- Whether the camera activation was done with SADP or the browser at park-buzi, and the per-site
|
||||
camera password location.
|
||||
- Where the **site record** lives (a page per site under `wiki/entities/`? — park-buzi and park-2
|
||||
|
||||
@@ -156,3 +156,17 @@ procurement. (See [[parking-system-architecture]] §10.)
|
||||
Interacts with #9 (a statement is **not** a fiscal invoice; fiscalisation is off-appliance)
|
||||
and #8 (one currency per party until FX exists). Also reopened on the subscription page: a
|
||||
**renewal is currently off-book** (an edit, no `payment`).
|
||||
|
||||
18. **DT-008 — why two units read disjoint card sets, and `6H` on a 13.56 MHz UID.** _(Raised on
|
||||
the bench, 2026-09-17.)_ park-buzi's readers (`H05M…`) read the site's 125 kHz cards; the fresh
|
||||
lab unit (`HC002721`) reads only 13.56 MHz cards, although the box leaflet claims EM-ID + M1 +
|
||||
14443A/B + 15693 in one unit. Unresolved between a batch variant, a dead/disabled 125 kHz front
|
||||
end, and a non-EM 125 kHz card format at park-buzi. To settle: (a) a known EM4100 fob on the lab
|
||||
unit (reads → card format; not → unit/variant, vendor with the serial); (b) the site record
|
||||
names the card technology and a replacement is tested against real cards before shipping;
|
||||
(c) on a 13.56 MHz read the native UID is 4 or 7 bytes, so
|
||||
**`Card Input format = 6H` truncates it** — a phone tap showed it keeps the first three bytes in
|
||||
reversed order and drops the fourth; confirm on a card with a printed UID, and decide whether
|
||||
`8H` is required for 13.56 MHz sites before any card is enrolled against one. (Phones present a
|
||||
random `08…` UID per tap and can never be credentials.) See
|
||||
[[dingtian-dt008-reader]] §"Two RF variants".
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
---
|
||||
type: entity
|
||||
tags: [parking, hardware, camera, dahua, snapshot, events, bench]
|
||||
sources: []
|
||||
updated: 2026-09-17
|
||||
---
|
||||
|
||||
# Dahua IPC-HFW2549T-AS-IL — the lab bench unit (inspected 2026-09-17)
|
||||
|
||||
A 5 MP Dahua WizSense bullet (`IPC-HFW2549T-AS-IL-0360B`, 3.6 mm, "IL" = smart dual illuminators),
|
||||
firmware **`V2.880.0000000.22.R`, build 2026-05-14**, serial `9J0E4EFPAGECB23`, MAC
|
||||
`fc:5f:49:48:42:ac`, processor SSC378Q. Sits on the bench at `10.0.10.11`, login `admin` / the lab
|
||||
password. **It is not an ANPR camera** — plates come from the host-side [[opencv-anpr-service]]
|
||||
off its snapshot, exactly as with the Hikvision units. Everything below was read off the unit
|
||||
over its CGI with `curl --digest`; nothing was written to it.
|
||||
|
||||
**It is not factory-fresh.** Hostname `DAHUA_PORTA_KRYESORE` ("main gate"), an Alarm Server already
|
||||
pointed at `10.7.8.9:8888`, DNS `8.8.8.8`, SMD tuned to vehicles only — this unit was configured
|
||||
for a gate somewhere before it reached the bench. Treat its settings as inherited, not defaults.
|
||||
|
||||
## What the CGI surface gives us
|
||||
|
||||
| Need | Endpoint (all HTTP Digest, port 80; 443 is **off**) | Result on this unit |
|
||||
| --- | --- | --- |
|
||||
| identity | `magicBox.cgi?action=getSystemInfo` / `getSoftwareVersion` / `getSerialNo` / `getVendor` | model, firmware, serial, `vendor=Dahua` |
|
||||
| snapshot | `snapshot.cgi?channel=1` | 200, `image/jpeg`, **2880×1620**, ~270 KB, ~0.5 s |
|
||||
| snapshot channel `0` / `2` | same | **400** — the channel index is **1-based**; `subtype=1` is ignored (still 2880×1620) |
|
||||
| clock read | `global.cgi?action=getCurrentTime` | `result=2026-09-17 09:03:50` |
|
||||
| clock write | `global.cgi?action=setCurrentTime&time=YYYY-MM-DD%20HH:MM:SS` | 200 `OK`; read-back matches within 1 s (**verified**, now the Dahua clock-sync) |
|
||||
| events | `eventManager.cgi?action=attach&codes=[All]&heartbeat=5` | 200, `multipart/x-mixed-replace`, a `Heartbeat` part every N s, event parts in between |
|
||||
| event caps | `eventManager.cgi?action=getCaps` | snapshot/record/mail/alarm-out linkage; no HTTP push cap |
|
||||
| streams | RTSP 554 `cam/realmonitor?channel=1&subtype=0` / `1` | **H.265** Main 2880×1620 @ 20 fps; sub 704×576 @ 20 fps (probed with ffprobe) |
|
||||
| ports | 80 (HTTP), 554 (RTSP), 37777 (Dahua SDK/DHIP) open; 443, 37778, 5000, 8000 closed | |
|
||||
|
||||
### Snapshot: the driver decremented the channel — this unit said no (fixed 2026-09-17)
|
||||
|
||||
`dahuaDriver` (`packages/devices/src/drivers/camera.ts`) builds
|
||||
`/cgi-bin/snapshot.cgi?channel=${ch-1}` on the note "Dahua channels are 0-based". On this firmware
|
||||
`channel=0` → **HTTP 400**, `channel=1` → the JPEG. Dahua's HTTP API numbers `snapshot.cgi` and
|
||||
`realmonitor` channels from 1 (only the `configManager` *tables* are 0-indexed — the usual source
|
||||
of the confusion). So an admin who enters "channel 1" in the wizard gets a permanent **degraded
|
||||
"HTTP 400"** from `healthCheck()` and no snapshot ever. The Dahua driver was never run against
|
||||
hardware before today ([[lpr-camera]] §Verified only covers Hikvision). **Fixed the same day**: the
|
||||
driver now sends the channel as entered (clamped to ≥1) and `camera.test.ts` pins the URL. The
|
||||
fixed driver was then run against this unit: `healthCheck` → ready (≈256 KB), `captureSnapshot` →
|
||||
`image/jpeg`, 273 KB, JPEG magic.
|
||||
|
||||
The snapshot always comes off the **main** stream at full resolution — there is no per-stream
|
||||
snapshot as on Hikvision, and `subtype` on `snapshot.cgi` is ignored. Fine for us: the app
|
||||
re-encodes to 1280 px on capture ([[snapshot-storage-optimization]]) and the recognizer keeps the
|
||||
full frame.
|
||||
|
||||
### Events: Dahua PULLS-with-a-held-socket, it does not HTTP-POST
|
||||
|
||||
Dahua has an "Alarm Server" too (`configManager.cgi?action=getConfig&name=AlarmServer`), but its
|
||||
protocol is **`DAHUA`** (proprietary, port 8888) — not the Hikvision-style HTTP POST that
|
||||
`routes/hikvision-alarm.ts` consumes. The HTTP way to get events is the **subscription stream**:
|
||||
the host opens `eventManager.cgi?action=attach&codes=[SmartMotionVehicle,CrossLineDetection,…]&heartbeat=5`
|
||||
and keeps it open; the camera writes one multipart part per event (`Code=…;action=Start|Stop;index=…`)
|
||||
and a `Heartbeat` part every 5 s. Verified on the bench: the stream stays up, heartbeats arrive,
|
||||
Digest auth applies to the attach. This inverts the Hikvision model:
|
||||
|
||||
- the camera never needs to know the booth's address — no `pushesToBackend`, no "assign first,
|
||||
then go back to the camera" step, no source-IP guard, and the WSL mirrored-mode source-IP
|
||||
problem does not exist;
|
||||
- the **server** owns the connection: reconnect with backoff, treat a missing heartbeat as
|
||||
camera-offline, one long-lived socket per Dahua camera;
|
||||
- vehicle events come from **SMD** (`SmartMotionDetect`: `Enable=true`, `ObjectTypes.Vehicle=true`,
|
||||
`Human=false` on this unit — inherited, and exactly the "Detection Target = Vehicle" the Hikvision
|
||||
runbook step asks for) → code `SmartMotionVehicle`; tripwire/intrusion (`CrossLineDetection`,
|
||||
`CrossRegionDetection`) with `ObjectTypes=Vehicle` are the IVS equivalents, **none configured**
|
||||
on this unit (only disabled FaceDetection and HeatMap rules exist).
|
||||
|
||||
**Verbatim event parts captured** on a 25-minute `codes=[All]` listen (bench motion + the clock
|
||||
write below). Each part is `Content-Type: text/plain` with a `Code=…;action=…;index=…;data={JSON}`
|
||||
body:
|
||||
|
||||
```
|
||||
Code=VideoMotion;action=Start;index=0;data={
|
||||
"EventID" : 31927,
|
||||
"Id" : [ 0 ],
|
||||
"RealUTC" : 1789634136,
|
||||
"RegionName" : [ "Region1" ],
|
||||
"SmartMotionEnable" : true,
|
||||
"WithSnap" : true
|
||||
}
|
||||
Code=VideoMotion;action=Stop;index=0;data={ …same EventID… }
|
||||
Code=VideoMotionInfo;action=State;index=0;data={ "RealUTC" : 1789634137, "WithSnap" : false }
|
||||
Code=TimeChange;action=Pulse;index=0;data={
|
||||
"BeforeModifyTime" : "17-09-2026 09:35:51",
|
||||
"ModifiedTime" : "17-09-2026 10:35:49",
|
||||
"RealUTC" : 1789637749,
|
||||
"WithSnap" : false
|
||||
}
|
||||
```
|
||||
|
||||
- `action=Start` / `Stop` with a shared `EventID` is the busy/free edge (the Hikvision
|
||||
`active`/`inactive` equivalent); `VideoMotionInfo State` is a per-second chatter part to ignore.
|
||||
- The motion arrived as plain `VideoMotion` with `SmartMotionEnable: true`, **not** as
|
||||
`SmartMotionVehicle` — whether the SMD filter suppresses `VideoMotion` for non-vehicles, or only
|
||||
adds the `SmartMotion*` codes on top, is **unconfirmed** (nobody drove a car past the bench).
|
||||
Subscribe to both and log which fires before gating anything on it.
|
||||
- **`RealUTC` is the camera's *belief* of UTC, i.e. its wall time minus its configured offset.**
|
||||
After the clock write it read 09:35:49 for a real 08:35:49 UTC (UTC+1, DST off). Never use it
|
||||
as an absolute time — stamp events on receipt from the booth clock, as the Hikvision route does.
|
||||
- `TimeChange` is emitted for our own clock sync; harmless, but filter it from any "activity" view.
|
||||
|
||||
### Clock: one hour behind, NTP off — clock-sync built the same day
|
||||
|
||||
`getCurrentTime` returned 09:03 while the bench wall clock read 10:03 CEST: `NTP.Enable=false`
|
||||
(address `time.windows.com`, unreachable on an isolated VLAN anyway), `NTP.TimeZone=1` (Belgrade)
|
||||
and **`Locales.DSTEnable=false`**, so the unit runs at UTC+1 year-round. The Hikvision units get
|
||||
their clock from the booth at every offline→ready edge ([[clock-integrity]]); until today the
|
||||
Dahua driver did not claim `isClockSyncable`. Now `DahuaCamera.syncClock` (camera.ts) reads
|
||||
`global.cgi?action=getCurrentTime` (`result=YYYY-MM-DD HH:MM:SS`) and, past the drift limit, writes
|
||||
`setCurrentTime&time=<host wall time>` — the **host's naive local wall time, no offset**, because
|
||||
what has to match the booth is the OSD burned into every snapshot, not the camera's notion of UTC
|
||||
(its tz/DST config is left alone, as on Hikvision). Verified on the bench with the real driver:
|
||||
a 2 h-off host time set (drift 7200 → synced), set back, then read as 1 s drift → no write. The
|
||||
device monitor picks it up unchanged (it gates on `isClockSyncable`, not on the driver id). A wrong
|
||||
DST setting on the camera therefore no longer matters for the evidence trail — only `RealUTC` in
|
||||
event bodies stays skewed (above).
|
||||
|
||||
### Login lockout — the device monitor must never poll with a wrong password
|
||||
|
||||
`General.LockLoginEnable=true`, `LockLoginTimes=5`, `LoginFailLockTime=300`: five bad Digest
|
||||
logins lock `admin` out for 5 minutes. A wizard assignment with a mistyped password, polled every
|
||||
few seconds by the device monitor, locks the camera and then **every** login (including the
|
||||
browser) fails until the poll stops. Verify the password with one `curl` before assigning; on a
|
||||
mysterious "401 then nothing works" wait five minutes.
|
||||
|
||||
## Bench notes
|
||||
|
||||
- `10.0.10.11` is the runbook's address for the lab [[k200l-printer]] ([[site-device-installation]]
|
||||
§address plan) — the camera has taken it on the bench; keep the two off the wire together or
|
||||
move one.
|
||||
- The other HTTP APIs newer Dahua firmware carries (`RPC2` JSON, `/onvif/device_service`) were not
|
||||
exercised — the CGI above covers everything the app needs.
|
||||
- `devVideoInput.cgi?action=getCaps` and `magicBox.cgi?action=getProductDefinition` answer
|
||||
"Bad Request" / "Not Implemented" on this firmware.
|
||||
|
||||
Related: [[lpr-camera]] · [[opencv-anpr-service]] · [[lane-presence-and-anpr-entry]] ·
|
||||
[[clock-integrity]] · [[site-device-installation]] · [[device-registry]]
|
||||
@@ -2,7 +2,7 @@
|
||||
type: entity
|
||||
tags: [parking, hardware, readers, qr, dingtian]
|
||||
sources: [dingtian-dt008]
|
||||
updated: 2026-07-04
|
||||
updated: 2026-09-17
|
||||
status: open
|
||||
---
|
||||
|
||||
@@ -25,8 +25,9 @@ or RFID [[subscription]]** credentials. Product page: dingtian-tech.com/en_us/qr
|
||||
|
||||
- **QR/barcode + card.** Reads **QR / simple barcode** AND **ID/IC/NFC cards** (~0.2 s, 0–10 cm).
|
||||
(An earlier note guessed "ER80-EM = 125 kHz EM4100 prox" — that was part of the same mis-id.)
|
||||
- **Interfaces: Wiegand 26/34, TCP/IP, USB, RS485.** (NOT RS-232 — that was a fictional-datasheet
|
||||
claim.) For our integration it talks **HTTP over TCP/IP**; Wiegand is the reader's *output line*
|
||||
- **Interfaces: Wiegand 26/34, TCP/IP, USB, RS485** per the product page; the box leaflet
|
||||
([[dingtian-dt008-box-manual]]) also lists **RS232**. (An earlier note dismissed RS-232 as a
|
||||
claim from the mis-identified GEE PDF — withdrawn 2026-09-17.) For our integration it talks **HTTP over TCP/IP**; Wiegand is the reader's *output line*
|
||||
on a valid read, not the host transport.
|
||||
- **Power** 9–16 V DC, 800 mA; **86×86×42 mm**; −30…70 °C. Fits the [[disk-os-hardening|appliance]].
|
||||
|
||||
@@ -182,6 +183,82 @@ symbology except **QR + Code128** (all our credentials); if offered, set **minim
|
||||
re-enables the phantom symbologies — re-apply after any reset/replacement. Physical fallback if any
|
||||
noise survives: hood/visor the window, tilt it down, avoid facing the striped arm.
|
||||
|
||||
## ⚠️ Two units, two card sets, no overlap — 125 kHz vs 13.56 MHz (2026-09-17, unresolved)
|
||||
|
||||
The product page says the DT-008 reads "ID/IC/NFC cards" and the **box leaflet**
|
||||
([[dingtian-dt008-box-manual]]) claims EM-ID, M1, ISO 14443A/B and ISO 15693 in one unit. Yet on
|
||||
the bench 2026-09-17, with two card sets, the two units we own read **disjoint** sets:
|
||||
|
||||
| Unit | Serial family | Reads | Does not read |
|
||||
| --- | --- | --- | --- |
|
||||
| park-buzi entry/exit (bought 2026-06) | `H05M…` (`H05M2AFA`, `H05MA5B0`) | the site's enrolled cards (**125 kHz "ID"**, EM4100-class) | 13.56 MHz cards |
|
||||
| lab unit (fresh, 2026-09) | `HC002721` | **13.56 MHz "IC/NFC"** cards (e.g. UID `A238BC`) | the park-buzi card set |
|
||||
|
||||
**The decisive test needs no hardware:** hold each card on an NFC-capable phone. A 13.56 MHz card
|
||||
is detected; a **125 kHz card is invisible to a phone**. The lab reader and the phone agreed on
|
||||
exactly the same set, and the other set was invisible to both — so the park-buzi set is 125 kHz and
|
||||
the park-buzi readers are the 125 kHz variant. Card bodies help too: EM4100 / TK4100 / T5577 (often
|
||||
a printed 10-digit decimal) = 125 kHz; Mifare / S50 / 1K / NTAG = 13.56 MHz.
|
||||
|
||||
Nothing in `QRCode_v1_6_5.exe` selects the frequency (no card-type field — see the screenshot in
|
||||
[[site-device-installation]] §2).
|
||||
|
||||
**Why the lab unit does not read them is NOT settled** — the phone test only proves the park-buzi
|
||||
cards are *not* 13.56 MHz. Three explanations remain, with different fixes:
|
||||
|
||||
1. **The park-buzi cards are 125 kHz but not EM4100** (HID Prox / Indala / AWID / a T5577 in a
|
||||
non-EM format): invisible to a phone, not decoded by an EM-only front end, but read by the older
|
||||
batch. Card bodies help: EM cards usually print a 10-digit decimal; HID cards carry the HID logo.
|
||||
2. **The lab unit's 125 kHz front end is dead or disabled** — the leaflet says it should be there;
|
||||
a firmware setting the v1.6.5 tool does not expose is possible.
|
||||
3. **The leaflet is generic and units ship per variant** — the vendor can say from the two serials.
|
||||
|
||||
**Decisive test (cheap):** a known **EM4100 125 kHz card/keyfob** on the lab unit, held at 1–10 cm.
|
||||
Reads → its 125 kHz radio works and the park-buzi cards are a different 125 kHz format (→ 1).
|
||||
Does not read → unit defect or variant (→ 2/3, vendor with the serial). A USB keyboard-wedge
|
||||
EM4100 reader (~10 €) additionally says outright whether the park-buzi cards are EM4100.
|
||||
|
||||
**Consequences (hold regardless of which explanation wins)**
|
||||
|
||||
- **A site's card stock and its readers must be proven together.** A card enrolled at park-buzi
|
||||
is not readable by the lab unit today, whatever the reason; a replacement reader must be tested
|
||||
against the site's actual cards **before** it ships, or every enrolled card is orphaned — same
|
||||
class of trap as the `Card Input format`.
|
||||
- **Purchase spec must name the card technology and format** the site uses (the serial family is
|
||||
only a hint: `H05M…` reads park-buzi's cards, `HC…` does not). Ask the vendor (support address in
|
||||
the tool's title bar) which card types a given serial decodes.
|
||||
- **Bench testing park-buzi card problems on the lab unit is meaningless** until the lab unit is
|
||||
shown to read the site's card type.
|
||||
- **Open:** with a 13.56 MHz unit the native UID is 4 or 7 bytes, so `Card Input format = 6H`
|
||||
truncates it — check on the lab unit which bytes survive and whether two cards can collide on the
|
||||
6-hex value before enrolling anything against a 13.56 MHz reader ([[open-questions]]).
|
||||
|
||||
Record the variant on the site record next to the serial ([[site-device-installation]] §"Record").
|
||||
|
||||
**A phone is not a card (2026-09-17).** Tapping a phone on the 13.56 MHz unit beeps and logs a
|
||||
*different* id every time (`18CA08`, `37F108`, `D5A908` three seconds apart). Read backwards
|
||||
those are `08 CA 18`, `08 F1 37`, `08 A9 D5`: a first UID byte of **`08`** is the ISO 14443
|
||||
marker for a **random UID**, which every phone in card-emulation mode generates per tap so that
|
||||
readers cannot track the handset. So a phone can never be enrolled as an RF credential, and a
|
||||
phone tap in the logs is not a clone attempt — just noise with a fresh id each time. Same for
|
||||
cards with a "random ID" feature (DESFire / Mifare Plus in random-UID mode): if a card ever
|
||||
enrolls but "stops matching", check whether its id changes between taps.
|
||||
|
||||
Incidentally this shows what **`6H` does on a 13.56 MHz unit**: the tool prints the **first three
|
||||
bytes of the 4-byte UID, byte order reversed, fourth byte dropped**. Confirm against a card with
|
||||
its UID printed on the body before enrolling; the dropped byte is the collision risk in
|
||||
[[open-questions]] #18.
|
||||
|
||||
## Bench sink — `scripts/reader-sink.py` (2026-09-17)
|
||||
|
||||
A stdlib-only Python HTTP server that answers the push on any `/qa/mcardsea.*` path with the SDK
|
||||
verdict (`--accept` → status 1 / two beeps, default status 0 / one beep), `Connection: close`, and
|
||||
prints one line per read: time, source IP, `serial`, `dev`, `dir` (from the `status` low digit),
|
||||
`ch` (from the `Q:`/`K:` prefix), `cardid`, path. Point the reader's *Server address / Server Port*
|
||||
at the laptop (`python3 scripts/reader-sink.py -p 3000 --accept`, port 80 needs admin rights). Use it
|
||||
to see the raw `cardid` a card yields, to prove a reader pushes at all, and to time the beep against
|
||||
the reply. No app, no DB, no Docker.
|
||||
|
||||
## ⚠️ Reply MUST set `Connection: close` (verified on hardware)
|
||||
|
||||
The reader sends `Connection: keep-alive` but **only acts on the verdict (beep/output) once the TCP
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
type: entity
|
||||
tags: [parking, hardware, readers, offline-first]
|
||||
sources: [parking-system-architecture, DS-2CD1047G3H-LIU]
|
||||
updated: 2026-08-23
|
||||
updated: 2026-09-17
|
||||
---
|
||||
|
||||
# LPR Camera
|
||||
@@ -38,8 +38,12 @@ the "Backend push IP" field for it (gated on the driver's `pushesToBackend` flag
|
||||
- **Hikvision** uses **ISAPI**: `GET /ISAPI/Streaming/channels/<id>/picture` (`101` = ch1 main
|
||||
stream) with **HTTP Digest** auth. The "Enable Hikvision-CGI" toggle (Network → Advanced →
|
||||
Integration Protocol) is a *different* legacy CGI surface — **not** needed for ISAPI.
|
||||
- **Dahua** uses CGI: `GET /cgi-bin/snapshot.cgi?channel=<n>` (0-based channel; the wizard's
|
||||
1-based channel is decremented).
|
||||
- **Dahua** uses CGI: `GET /cgi-bin/snapshot.cgi?channel=<n>`, channel **as entered (1-based)**.
|
||||
Until 2026-09-17 the driver decremented it on the belief the CGI is 0-based — the bench
|
||||
IPC-HFW2549T (fw 2.880) answers `channel=0` with **400** and `channel=1` with the JPEG; fixed and
|
||||
verified with the real driver the same day. Clock sync exists for Dahua too (`global.cgi`,
|
||||
naive wall time). Full inspection: [[dahua-ipc-hfw2549t]] (events = held `eventManager attach`
|
||||
socket, not an HTTP push — the subscriber is not built yet).
|
||||
|
||||
**Driver / storage boundary:** the driver FETCHES the image bytes (client-side HTTP Digest in
|
||||
`drivers/http-digest.ts`) and returns them on `Snapshot.bytes`; **storage is the caller's job**
|
||||
|
||||
+3
-1
@@ -17,6 +17,7 @@ Counts: 4 sources · 19 entities · 47 concepts · 8 decision records.
|
||||
## Sources
|
||||
- [[parking-system-architecture]] — design notes: stack, threat model, devices, UHPPOTE, ESP32, readers, BOM, open decisions.
|
||||
- [[dingtian-dt008]] — Dingtian DT-008 product page: QR/RFID access reader (QR/barcode + ID/IC/NFC; Wiegand/TCP-IP/USB/RS485; HTTP-GET push).
|
||||
- [[dingtian-dt008-box-manual]] — the leaflet from the box: claims EM-ID + M1 + ISO 14443A/B + 15693 in one unit, RS232 listed.
|
||||
- [[qrcode-sdk]] — QRCode SDK v1.6.5: the reader's HTTP-GET-poll protocol + JSON verdict (beep/output).
|
||||
- [[parksql2017-legacy-schema]] — predecessor SQL Server schema (Albanian market): legacy tariff/discount/membership/shift/fiscal model; confirms blocks, adds time-windows + categories, lacks postpaid sponsors.
|
||||
- [[ds-2cd1047g3h-liu]] — HIKVISION DS-2CD1047G3H-LIU-F datasheet: 4MP, main stream has no MJPEG option (sub does) — likely explains the model's persistent ISAPI snapshot 503 on main; confirms ISAPI/RTSP both fully in-spec.
|
||||
@@ -41,9 +42,10 @@ Counts: 4 sources · 19 entities · 47 concepts · 8 decision records.
|
||||
- [[atecc608]] — secure element; non-extractable signing key (host events + controller auth).
|
||||
- [[wiegand]] — reader standard feeding the controller directly (autonomous permit-holder path).
|
||||
- [[lpr-camera]] — edge-AI plate recognition; host-side casual-identity source; DS-2CD1047G3H-LIU main-stream ISAPI snapshot 503 is a firmware bug (only channel 102 ever works, ALL other IDs incl. garbage 503 identically) — firmware update tested, no fix; owner decided to replace the camera line rather than build an RTSP workaround.
|
||||
- [[dingtian-dt008-reader]] — Dingtian DT-008 QR/RFID reader on hand; host-side serial → `read` bus (the QR-ticket scanner).
|
||||
- [[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`).
|
||||
- [[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.
|
||||
- [[k200l-printer]] — the park-buzi printer identified (2026-09-09): Xprinter/ICS K200L, USB id 1fc9:2016 "POS-80", J-Speed LAN board at 192.168.123.100 (DHCP off, web config on :80); status page `/prt_status.htm` (Rongta's rows, headerless HTTP) → own `k200l` driver with raw-socket fetch; over USB reachability only, so cover-open never showed at park-buzi.
|
||||
|
||||
+49
@@ -3322,3 +3322,52 @@ schema: health, ingest, stats, legacy row reads back with defaults); trainer `Ha
|
||||
kind", /health still 200); the collector's training proxy includes the trainer's error text. Pages:
|
||||
[[vision-review-outbox]] (incident + rule), [[bodytype-classifier-training]] (what the message
|
||||
means). Deploy: nothing manual — the new collector migrates on start.
|
||||
|
||||
## 2026-09-17 — DT-008 comes in two RF variants; cards are not portable between them
|
||||
|
||||
Bench finding: the fresh lab DT-008 (`HC002721`) reads a set of cards park-buzi cannot, and cannot
|
||||
read park-buzi's enrolled cards. NFC-phone test settled it: the phone and the lab reader detect
|
||||
exactly the same set (13.56 MHz), the park-buzi set is invisible to both (125 kHz). One radio per
|
||||
unit, no setting selects it, same model name. Rule: a site's readers, its card stock and any
|
||||
replacement unit must be the same variant; name the variant in the purchase spec and on the site
|
||||
record. Also recorded the tool's Setting-tab layout (three groups, each with its own Set button).
|
||||
Pages: [[dingtian-dt008-reader]], [[site-device-installation]] §2, [[index]].
|
||||
|
||||
## 2026-09-17 — phone taps on the DT-008 are random UIDs; what `6H` keeps
|
||||
|
||||
Three phone taps logged three ids ending in `08` — reversed, a first byte `08` = ISO 14443 random
|
||||
UID, so phones cannot be RF credentials. Side effect: `6H` on a 13.56 MHz unit prints the first three
|
||||
UID bytes reversed and drops the fourth. Pages: [[dingtian-dt008-reader]], [[open-questions]] #18.
|
||||
|
||||
## 2026-09-17 — box leaflet says the DT-008 reads every card type; "one radio per unit" downgraded
|
||||
|
||||
The leaflet in the lab unit's box ([[dingtian-dt008-box-manual]]) lists EM-ID, M1, ISO 14443A/B and
|
||||
15693 in one reader, so the earlier "two variants, one radio each" is now one of three explanations
|
||||
(variant / dead 125 kHz front end / non-EM 125 kHz cards at park-buzi). Decisive next test: a known
|
||||
EM4100 fob on the lab unit. Leaflet also lists RS232 — the old "not RS-232" dismissal is withdrawn.
|
||||
Pages: [[dingtian-dt008-reader]], [[site-device-installation]] §2, [[open-questions]] #18, [[index]].
|
||||
|
||||
## 2026-09-17 — `scripts/reader-sink.py`: a bench sink for the DT-008 push
|
||||
|
||||
Stdlib Python HTTP server answering the reader's GET with the SDK verdict + `Connection: close`,
|
||||
one log line per read (serial, dir, channel, cardid). Page: [[dingtian-dt008-reader]] §Bench sink.
|
||||
|
||||
## 2026-09-17 — first Dahua on the bench: IPC-HFW2549T-AS-IL inspected over CGI
|
||||
|
||||
Snapshot, identity, config, RTSP and the `eventManager attach` stream all answered. Two things the
|
||||
app got wrong by assumption: the Dahua driver's channel decrement (`channel=0` → HTTP 400 on this
|
||||
firmware; channels are 1-based), and "Dahua would push like Hikvision" — it holds a multipart
|
||||
subscription socket instead. Clock 1 h off (DST off, NTP off); `global.cgi setCurrentTime` is the
|
||||
unbuilt clock-sync. Unit is not factory-fresh (hostname "main gate", SMD = vehicle). Pages:
|
||||
[[dahua-ipc-hfw2549t]], [[lpr-camera]] §Snapshot driver, [[site-device-installation]] §3, [[index]].
|
||||
|
||||
## 2026-09-17 — Dahua driver: channel fix + clock sync, verified on the bench unit
|
||||
|
||||
`dahuaDriver` now sends the channel as entered (`camera.test.ts` pins the URL) and `DahuaCamera`
|
||||
implements `syncClock` over `global.cgi` get/setCurrentTime with the host's naive wall time. Both
|
||||
run against the real IPC-HFW2549T: snapshot 273 KB, a 2 h-off sync set and read back. A 25-min
|
||||
`eventManager attach` listen captured the verbatim `VideoMotion Start/Stop`, `VideoMotionInfo` and
|
||||
`TimeChange` parts; `RealUTC` proved to be the camera's belief of UTC (1 h skewed), so events get
|
||||
stamped on receipt. Still open: the server-side attach subscriber, and whether SMD emits
|
||||
`SmartMotionVehicle` in addition to / instead of `VideoMotion`. Pages: [[dahua-ipc-hfw2549t]],
|
||||
[[lpr-camera]], [[site-device-installation]] §3, [[index]].
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
type: source
|
||||
tags: [parking, hardware, readers, qr, rfid, dingtian, manual]
|
||||
sources: [dingtian-dt008-box-manual]
|
||||
updated: 2026-09-17
|
||||
---
|
||||
|
||||
# Source: DT-008 paper manual from the box ("QR Code Reader Technical Parameter")
|
||||
|
||||
Phone-scanned (OCR) from the leaflet packed with the fresh lab unit `HC002721`, 2026-09-17. Verbatim
|
||||
as OCR'd (typos are the OCR's):
|
||||
|
||||
```
|
||||
QR Code Reader Technical Parameter
|
||||
Voltage Support: DC 5V-16V
|
||||
Current: ≤0.75W
|
||||
Decoding support: QR code, one dimensional code
|
||||
Reading range: ID 1~10CM, IC 1~5CM
|
||||
Reading card type: EM-ID, M1, 15693, 125KHZ \ ISO14443A \ ISO14443B \ ISO15693
|
||||
Application environment: -10°C ~ 60°C
|
||||
Humidity: 10% ~ 90%
|
||||
Interface: Wiegand26, 34, RS485, RS232, [USB?]
|
||||
```
|
||||
|
||||
## What it claims that matters
|
||||
|
||||
- **All card technologies in one unit:** EM-ID (125 kHz), M1 = Mifare Classic (ISO 14443A),
|
||||
ISO 14443B, ISO 15693. Range differs by technology: **ID 1–10 cm, IC 1–5 cm**.
|
||||
- **RS232 is listed** — the earlier wiki position "NOT RS-232, that was a fictional-datasheet claim"
|
||||
came from the mis-identified GEE PDF; the box leaflet does list it. Irrelevant to us (HTTP push),
|
||||
but do not treat the interface list as evidence of a mis-id any more.
|
||||
- Power 5–16 V here vs 9–16 V / 800 mA on the product page ([[dingtian-dt008]]).
|
||||
|
||||
## What it does NOT settle
|
||||
|
||||
The lab unit does **not** read the park-buzi card set although the leaflet says it reads EM-ID —
|
||||
see [[dingtian-dt008-reader]] §"Two RF variants". Either the leaflet is generic for the line and
|
||||
units ship per variant, or the lab unit's 125 kHz front end is dead/disabled, or the park-buzi
|
||||
cards are a non-EM 125 kHz format (HID Prox / Indala / AWID) that only the older batch decodes.
|
||||
Reference in New Issue
Block a user