feat(firmware): relay-proxy PoC — NodeMCU as a Dingtian DT-R004 + cloud proxy/watchdog

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.
This commit is contained in:
2026-10-22 12:08:20 +02:00
parent e842f036e2
commit c08e232339
19 changed files with 1162 additions and 1 deletions
+15
View File
@@ -345,3 +345,18 @@ Related: [[appliance-provisioning]] · [[first-run-setup]] · [[device-registry]
[[network-isolation]] · [[entry-exit-points]] · [[dingtian-relay]] · [[dingtian-dt008-reader]] ·
[[lpr-camera]] · [[hikvision-radar]] · [[k200l-printer]] · [[rongta-printer]] ·
[[printer-usb-transport]] · [[wsl-dev-networking]]
## Booth host firewall: what the device net must reach (2026-10-22)
Found at park-lab (ufw active, rules root-only): the device VLAN could reach ssh but **not** the
app. Devices need, from the device subnet to the booth:
| Port | Who | Why |
| --- | --- | --- |
| **3000/tcp** (`PORT`) | [[dingtian-relay]] input push, any device push | `backendPort()` advertises the server's own port, **not** Caddy's 80 — the push bypasses the proxy. |
| 80/tcp | admins on the LAN | Caddy → operator UI (and `/health`). |
`sudo ufw allow from 10.0.10.0/24 to any port 3000 proto tcp` (and 80). Without 3000 the booth's
assign flow *succeeds* (it configures the device outbound) but every button push then dies with a
timeout — a silent failure. The booth's ufw rule set is not yet captured in
[[appliance-provisioning]]; it should be.