escpos-php icon indicating copy to clipboard operation
escpos-php copied to clipboard

Need help with ENPC protocol 3289

Open Muraveiko opened this issue 4 years ago • 9 comments

EPSON Printer Owners Can anyone do a packet exchange dump between the printer and the SDK on port 3289?

SDK send UDP broadcast 255.255.255.255:3289 45 50 53 4F 4E 51 03 00 00 00 10 00 00 00 00 00 EPSONQ what does the printer answer?

Also I would appreciate a link to the protocol specification.

Muraveiko avatar May 21 '20 20:05 Muraveiko

I had access to an Epson TM-T88 5BB and tried sending your packet, and saw a reply like EPSONq. . . .dTM-T88V for the first part. Full reply (147 bytes):

{
  0x45, 0x50, 0x53, 0x4f, 0x4e, 0x71, 0x03, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05,
  0x20, 0x02, 0x64, 0x54, 0x4d, 0x2d, 0x54, 0x38,
  0x38, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00
}

pcap file is attached too: epson-tm-t88-5bb.pcap.gz

Hodapp87 avatar Aug 03 '20 20:08 Hodapp87

yhf1U As I understand it 1) EPSON - prefix 2) packet type Q - request and q - responce

Muraveiko avatar Aug 03 '20 20:08 Muraveiko

The only attempt at reverse engineering that I'm aware of is at https://github.com/BlackLotus/epson-stuff

Hodapp87 avatar Aug 03 '20 21:08 Hodapp87

@Muraveiko

Were you able to infer any additional details on the ENPC protocol? I understand what your post was looking for and appreciate seeing the PCAP reply. I am a bit lost with some of the data being ASCII in HEX and other apparently being proprietary to Epson or ESC/P commands. I am not sure what formatting it is expecting.

EpsonNET will send: 45 50 53 4F 4E 50 00 FF 00 00 00 00 00 00 Where the second parameter appears to be a ff (form feed), but then on BlackLotus' GIT it appears he feels the second param should be a device number; however that is comparing a Q (query) with a P (probe) so could be completely differnet spec

["EPSON", "Q", # PacketType (Q for query and C for command) "\x03", # DeviceType(3) (fixed) "\x00", # DeviceNumber(0) (fixed) "\x00\x10", # Function(0010h) "\x00\x00", # Result (fixed?) "\x00\x00", # parameter length Length ""] # command parameter

I do appreciate the explanation that Q is for the request and q is for the response to the request. Have you figured out anymore in your PHP efforts? I am working on a Python project here.

WanderingApps avatar Feb 13 '22 21:02 WanderingApps