captdriver
captdriver copied to clipboard
Information in response to 0xA1A1 command
I believe that we are closing in on the exact use of the 0xA1A1 command (dubbed CAPT_IDENT
) but your help is needed to solve this mystery completely. :detective:
If anyone has a CAPT printer and a few minutes to an hour to spare, maybe post your printer's 0xA1A1
response, along with the printer model name (and add-ons where applicable)?
I am especially looking for 0xA1A1
responses from CAPT printers with A3-size printing, colour printing, optional trays, network cards and also printers made 2003 and earlier.
Getting the 0xA1A1 response
The 0xA1A1
response may be obtained from several sources:
- CUPS logs, if you are using captdriver (even if unsuccessfully):
- Ensure that CUPS debug logging was turned on with
cupsctl --debug-logging
before the last print job. Debug logging may be switched off by runningcupsctl --no-debug-logging
. If you get a connection reset by peer error, try running the command again. - After attempting to print, successful or not, run
grep -i -n6 "A1 A1" /var/log/cups/error_log
to show only lines near the A1 A1 responses. - Try
zcat /var/log/cups/error_log.2.gz | grep -i -n6 "A1 A1" -
on older logs (error_log.2.gz
and older) that have been automatically compressed.
- Ensure that CUPS debug logging was turned on with
- Wireshark logs. If you haven't tried the CAPT dissector, maybe give it a go?
- Your own program, e.g. use libusb to do a single bulk transfer of
{0xA1, 0xA1, 0x04, 0x00}
to the printer, read the printer andprintf()
the response and so on...
Thanks in advance for your help!
Details
This command appears to return some kind of autoconfiguration constant to set up printers without description files. @agalakhov has suggested in the SPECS
file that it contains info about "printer capabilities". This information would have been useful to network printing managers, like Canon's NetSpot.
I think this string remains the same per model, but I am speculating that it may change if optional hardware is installed or removed. This may be a viable method of generating PPD files.
Response Format as Currently Known
The table below shows what I think the response contains. With your help, we can verify this information and find out the missing bits.
All 16-bit values are shown in big endian.
Offset | Variable | LBP1120 | LBP2900 | LBP3000 | LBP3010 | LBP5200[^5200] | LBP6000 | LBP6020 | LBP7200 |
---|---|---|---|---|---|---|---|---|---|
0, 1 | Opcode | 41377 (0xA1A1) | 41377 (0xA1A1) | 41377 (0xA1A1) | 41377 (0xA1A1) | 41377 (0xA1A1) | 41377 (0xA1A1) | 41377 (0xA1A1) | 41377 (0xA1A1) |
2, 3 | Reply Size | 20 (0x0014) | 56 (0x0038) | 56 (0x0038) | 64 (0x0040) | 20 (0x0014) | 64 (0x0040) | 64 (0x0040) | 64 (0x0040) |
4, 5 | CAPT Version ID A (0x0300 for 1.x/2.0, 0x0B00 for >=2.1?) | 768 (0x0300) | 2816 (0x0B00) | 2816 (0x0B00) | 2816 (0x0B00) | 768 (0x0300) | 2816 (0x0B00) | 2816 (0x0B00) | 2816 (0x0B00) |
6, 7 | Product ID(?) | 221 (0x00DD) | 10801 (0x2A31) | 10800 (0x2A30) | 2490 (0x09BA) | 845 (0x034D) | 2492 (0x09BC) | 2493 (0x09BD) | 3530 (0x0DCA) |
8, 9 | Firmware Version(?) | 1 (0x0001) | 257 (0x0101) | 2 (0x0002) | 1 (0x0001) | 1 (0x0001) | 1 (0x0001) | 257 (0x0101) | 257 (0x0101) |
10, 11 | Buffer Size | 32767 (0x7FFF) | 65520 (0xFFF0) | 65520 (0xFFF0) | 65520 (0xFFF0) | 65520 (0xFFF0) | 65520 (0xFFF0) | 65520 (0xFFF0) | 65520 (0xFFF0) |
12, 13 | Buffers[^buf] | 16 (0x0010) | 64 (0x0040) | 64 (0x0040) | 64 (0x0040) | 256 (0x0100) | 64 (0x0040) | 256 (0x0100) | 512 (0x0200) |
14, 15 | Unknown B | 0 (0x0000) | 4 (0x0004) | 4 (0x0004) | 4 (0x0004) | 144 (0x0090) | 4 (0x0004) | 4 (0x0004) | 422 (0x01A6) |
16, 17 | Unknown C | 65535 (0xFFFF) | 65 (0x0041) | 64 (0x0040) | 82 (0x0052) | 59 (0x003B) | 92 (0x005C) | 103 (0x0067) | 83 (0x0053) |
18, 19 | Unknown D | 1 (0x0001) | 1 (0x0001) | 1 (0x0001) | 769 (0x0301) | 1 (0x0001) | 769 (0x0301) | 769 (0x0301) | 62209 (0xF301) |
20, 21 | Max. Speed (pages/hour) | -- | 720 (0x02D0) | 840 (0x0348) | 840 (0x0348) | -- | 1080 (0x0438) | 1080 (0x0438) | 1200 (0x04B0) |
22, 23 | Unknown E | -- | 0 (0x0000) | 0 (0x0000) | 0 (0x0000) | -- | 0 (0x0000) | 0 (0x0000) | 600 (0x0258) |
24, 25 | MP Tray Max. Width (x0.1 mm) | -- | 2159 (0x086F) | 2159 (0x086F) | 2159 (0x086F) | -- | 2159 (0x086F) | 2159 (0x086F) | 2159 (0x086F) |
26, 27 | Duplex Max. Width (x0.1 mm)[^2splim] | -- | 0 (0x0000) | 0 (0x0000) | 0 (0x0000) | -- | 0 (0x0000) | 0 (0x0000) | 2159 (0x086F) |
28, 29 | MP Tray Max. Length (x0.1 mm) | -- | 3556 (0x0DE4) | 3556 (0x0DE4) | 3556 (0x0DE4) | -- | 3556 (0x0DE4) | 3556 (0x0DE4) | 3556 (0x0DE4) |
30, 31 | Unknown F | -- | 0 (0x0000) | 0 (0x0000) | 0 (0x0000) | -- | 0 (0x0000) | 0 (0x0000) | 0 (0x0000) |
32, 33 | Duplex Max. Length (x0.1 mm) | -- | 0 (0x0000) | 0 (0x0000) | 0 (0x0000) | -- | 0 (0x0000) | 0 (0x0000) | 3556 (0x0DE4) |
34, 35 | Unknown G | -- | 0 (0x0000) | 0 (0x0000) | 0 (0x0000) | -- | 0 (0x0000) | 0 (0x0000) | 0 (0x0000) |
36, 37 | MPT Min. Width (x0.1 mm) | -- | 762 (0x02FA) | 762 (0x02FA) | 762 (0x02FA) | -- | 762 (0x02FA) | 762 (0x02FA) | 762 (0x02FA) |
38, 39 | Duplex Min. Width (x0.1 mm) | -- | 0 (0x0000) | 0 (0x0000) | 0 (0x0000) | -- | 0 (0x0000) | 0 (0x0000) | 1820 (0x071C) |
40, 41 | MPT Min. Length (x0.1mm) | -- | 1270 (0x04F6) | 1270 (0x04F6) | 1270 (0x04F6) | -- | 1880 (0x0758) | 1880 (0x0758) | 1270 (0x04F6) |
42, 43 | Duplex Min. Length (x0.1mm) | -- | 0 (0x0000) | 0 (0x0000) | 0 (0x0000) | -- | 0 (0x0000) | 0 (0x0000) | 2570 (0x0A0A) |
44 | Top Non-printable Margin Thickness (x0.1mm) | -- | 40 (0x28) | 40 (0x28) | 50 (0x32) | -- | 50 (0x32) | 50 (0x32) | 50 (0x32) |
45 | Bottom Non-printable Margin Thickness (x0.1mm) | -- | 60 (0x3C) | 60 (0x3C) | 50 (0x32) | -- | 50 (0x32) | 50 (0x32) | 50 (0x32) |
46 | Left Non-printable Margin Thickness (x0.1mm) | -- | 50 (0x32) | 50 (0x32) | 50 (0x32) | -- | 50 (0x32) | 50 (0x32) | 50 (0x32) |
47 | Right Non-Printable Margin Thickness (x0.1mm) | -- | 50 (0x32) | 50 (0x32) | 50 (0x32) | -- | 50 (0x32) | 50 (0x32) | 50 (0x32) |
48, 49 | Horizontal Resolution (dpi) | -- | 600 (0x0258) | 600 (0x0258) | 600 (0x0258) | -- | 600 (0x0258) | 600 (0x0258) | 600 (0x0258) |
50, 51 | Vertical Resolution (dpi)[^resxy] | -- | 600 (0x0258) | 600 (0x0258) | 600 (0x0258) | -- | 600 (0x0258) | 600 (0x0258) | 600 (0x0258) |
52 | CAPT Protocol Version ID B | -- | 21 (0x15) | 21 (0x15) | 30 (0x1E) | -- | 30 (0x1E) | 31 (0x1F) | 30 (0x1E) |
53, 54 | Print Engine Family(?)[^sm] | -- | 515 (0x0203) | 515 (0x0203) | 1027 (0x0403) | -- | 1027 (0x0403) | 1028 (0x0404) | 1285 (0x0505) |
55 | Unknown I | -- | 2 (0x02) | 0 (0x00) | 0 (0x00) | -- | 0 (0x00) | 0 (0x00) | 0 (0x00) |
56, 57 | Unknown J | -- | -- | -- | 4182 (0x1056) | -- | 4096 (0x1000) | 5120 (0x1400) | 61440 (0xF000) |
58, 59 | Unknown K | -- | -- | -- | 0 (0x0000) | -- | 0 (0x0000) | 2 (0x0002) | 0 (0x0000) |
60, 61 | Max Color Speed(?) (pages/hour)[^cmykspd] | -- | -- | -- | 0 (0x0000) | -- | 0 (0x0000) | 0 (0x0000) | 1200 (0x04B0) |
62, 63 | Unknown M | -- | -- | -- | 0 (0x0000) | -- | 0 (0x0000) | 0 (0x0000) | 600 (0x0258) |
UPDATE (2022-11-03): I just replaced the table with an autogenerated version with a hopefully more readable and less biased format. As usual, please report all inconsistencies and errors.
Sources: LBP2900: Issue #7 comment LBP6000: mounaiban#11 LBP6020: mounaiban#22
[^5200]: LBP5200 without optional tray and without network card
[^prod]: Related to bytes 2-3 in 0xD0A0
commands. The actual value used in the commands may not be the same as the printer's, but are expected to be from a similar model.
[^buf]: The Canon LBP 1120 has 512KB of RAM and 32767B x 16 == 524272B which rounds up to 512KiB :nerd_face: However, doing the same math the other devices results in a memory size twice as large as specified. LBP3000 is claimed to have 2MB, but 65,520B x 64 == 4,193,280B which rounds up to 4MiB. LBP7200 is claimed to have 16MB; 65,520B x 512 == 33,546,240B which rounds up to 32MiB.
[^resxy]: X/Y resolution may be swapped, but it doesn't matter for now because X and Y-resolution is the same for all known devices
[^2splim]: According to section F-21 of the LBP7200C User's Guide, only a select number of paper sizes are supported by the duplexer for auto 2-sided printing: B5 (182x257mm), Executive, A4, Letter, Foolscap, Legal (215.9x355.6mm). The largest of the select sizes was Legal, and the smallest was B5.
[^sm]: My wild guess: print engine family? Models of the same family are documented by the same service manual. Examples: LBP2900 & 3000, LBP 3100 & 6000...
[^cmykspd]: Some devices have a (much) slower full-colour printing speed: e.g. LBP5200 uses a carousel to swap between four cartridges to dispense toner onto a transfer belt, making the imaging phase a four-pass process. This trades size and complexity for printing speed.
CAPT: recv A1 A1 14 00 00 03 DD 00 01 00 FF 7F 10 00 00 00 FF FF 01 00
LBP1120 at current state
@mounaiban
Thanks @ra1nst0rm3d for the info on the LBP1120. I guess 0xA1A1 can't be used for autoconfiguration on older (CAPT 1.x?) devices :disappointed:
It may still hold vital clues to implementing perfect support though.
@mounaiban
Here is the response of a LBP3010/LBP3018/LBP3050: A1 A1 40 00 00 0B BA 09 01 00 F0 FF 40 00 04 00 52 00 01 03 48 03 00 00 6F 08 00 00 E4 0D 00 00 00 00 00 00 FA 02 00 00 F6 04 00 00 32 32 32 32 58 02 58 02 1E 03 04 00 56 10 00 00 00 00 00 00
Thanks @missla for the info and the updates to the SPECS file. It seems bytes 6-7 from the 0xA1A1 response are meant to be put in bytes 2-3 of a 0xD0A0 command, but this is not the case, as seen with the LBP2900. The '2900 uses the same value as the '3000.
Looks like major parts of commands are just hardcoded. Even the size bytes, there are incorrect size bytes in some commands.