reverse engineer POS895 discovery; add SPRT discovery probe

The POS895 does not answer Epson's ENPC broadcast, so PrintServer never
registers it and every job for it fails with "Printer not found". The
feasibility notes listed the vendor's own discovery protocol as unknown
and expected a packet capture to recover it, which is what this does.

Captured pktmon traffic while running the vendor EasySet tool on the
printer's segment. The protocol is:

  query  UDP broadcast 255.255.255.255:3289, sent FROM source port 9100
         53 50 52 54 2D 49 6E 66 6F 72 00 00 0D   "SPRT-Infor" 00 00 0D

  reply  from <printer>:3289 back to <querier>:9100, 39 ASCII bytes
         "28-0e-8b-3d-ca-f1            2608120478"
          MAC, 17 chars   12 spaces   serial, 10 chars

The printer's address is the reply's source IP. Pos895Test now sends this
probe and parses the replies; run against the real printer it returns the
same MAC and serial the vendor tool got, so the reimplementation matches.

Two useful side effects. Port 3289 is the same UDP port ENPC uses, so a
composite IDiscoveryService can share one socket. And the querying machine
and the printer sat in different /24s of one flat segment, so the /24 TCP
sweep the notes originally preferred would have missed this printer.

The print test is commented out at the bottom of Program.cs rather than
deleted; it confirmed Font A is 48 columns and that GS ! magnification
works at width 1x/2x/3x with height 2x.

Notes updated: the discovery work item is no longer the largest one, the
compatibility table records DLE EOT and GS ! as confirmed and ESC d as
apparently ignored, and the answered questions are separated from the
ones still open.

Claude-Session: https://claude.ai/code/session_01E6N3P4nSZLtp4BC2LXVref
This commit is contained in:
EugeneTes
2026-09-03 10:45:35 +02:00
parent 8ca8370426
commit 17a6eb6b39
6 changed files with 269 additions and 111 deletions

25
docs/captures/README.md Normal file
View File

@@ -0,0 +1,25 @@
# Packet captures
## easyset.pcapng / easyset.etl
`pktmon` capture taken on 2026-09-03 on a machine on the POS895's network
segment, while running the vendor's `EasySet Tool.exe` and clicking its scan.
Taken to reverse engineer the vendor discovery protocol, since the POS895 does
not answer Epson's ENPC broadcast and the EasySet binary yields no readable
strings. The resulting wire format is written up under "SPRT discovery protocol"
in `POS895_POS896_integration_notes.md` and implemented in `Pos895Test`.
`easyset.etl` is the raw pktmon output; `easyset.pcapng` is the converted form
and the one worth opening.
What is in it:
- `10.1.250.71:9100 -> 255.255.255.255:3289` the `SPRT-Infor` discovery query
- `10.1.252.219:3289 -> 10.1.250.71:9100` the printer's MAC + serial reply
- `10.1.252.148:58165 -> 255.255.255.255:3289` an Epson `EPSONQ` broadcast that
the POS895 does not answer, which is the point
- unrelated noise: Ubiquiti AP beacons on UDP 10001, SSDP, mDNS, NetBIOS
Note pktmon records each frame several times, once per stack layer, so every
packet appears about six times.

BIN
docs/captures/easyset.etl Normal file

Binary file not shown.

Binary file not shown.