Re: Init sequence to disable PW sensor on EPSON

Robert Krawitz <[email protected]> Sun, 3 Apr 2022 20:11:49 -0400
Newsgroups gmane.linux.printing.gimp-print.devel
Message-ID <[email protected]>
On 4/3/22 12:59, Solomon Peachy wrote:
> On Sun, Apr 03, 2022 at 11:30:56AM -0400, Robert Krawitz wrote:
> But starting at #663 things get more interesting, with the REMOTE command:
> 
> 0010                                    40 40 00 49 00   .......I...@@.I.
> 0020   00 1b 28 52 08 00 00 52 45 4d 4f 54 45 31 53 4e   ..(R...REMOTE1SN
> 0030   2e 00 00 13 0b 00 de 0a d8 04 18 01 1b 02 f0 00   ................
> 0040   00 00 00 00 e8 05 00 00 00 00 00 00 01 01 01 01   ................
> 0050   01 01 01 01 01 01 00 02 01 00 00 00 00 02 f1 03   ................
> 0060   1b 00 00 00                                       ....
> 
> 0010                                    40 40 00 0c 00   ...........@@...
> 0020   00 0d 0a 0d 0a 0d 0a                              .......
> 
> 4040004900001b285208000052454d4f544531534e2e0000130b00de0ad80418011b02f00000000000e805000000000000010101010101010101010002010000000002f1031b000000
> 4040000c00000d0a0d0a0d0a
> 
> The rest of the packets are a series of command-responses, presumably querying printer parameters.
> 
> (Now I'm idly wondering if it wouldn't make sense to try and write an 
>  ESC/P dissector for Wireshark..)

Remote mode commands are of the form

XX (2 ASCII bytes)
ll hh (little endian short, how many bytes)
data

So in this case, SN is the command (which is described as "select mechanism sequence").  It's then
followed by 0x2e bytes of data.

For the "SN" command, the first two bytes are the subcommand, which is 00 0x13.  Unfortunately, I
don't know what the subcommand 0x13 means, so the rest of the data doesn't mean too much to me.

One possibility would be to extract that literal command, put it in the print stream at the right
place, and see if it solves the problem.  I believe those would be the bytes from 0x32 to 0x5f; the
sequence starting at 0x60 (ESC 0 0 0) is the exit from remote mode, so that makes sense.