Fun with (Laser) Printers

Conversing with your Laser Printer:(See disclaimer below)

To extract information from your printer in PJL telnet to its IP address, port 9100 (or by serial, see below), and send it these commands:

<Control+[>%-12345X@PJL <Enter>

Then copy and paste the following commands:

@PJL INFO ID
@PJL INFO CONFIG
@PJL INFO FILESYS
@PJL INFO MEMORY
@PJL INFO PAGECOUNT
@PJL INFO STATUS
@PJL INFO VARIABLES
@PJL INFO USTATUS

Or even try some newer, more detailed but undocumented ones:

@PJL INFO LOG
@PJL INFO PRODINFO
@PJL INFO SUPPLIES

Save your responses, and then type (note: NO <Enter> afterwards):
<Control+[>
%-12345X

Then you can disconnect and/or close your Telnet program

Alternately, here is a small BASH script to return all of the information in a dated text file. To use, simply give the script the IP address of the printer as an argument.

#!/bin/bash
#v1.0 - M Lange, 4-Jan-2014
echo -e "Scan of $1 9100 run on `date`:\n-------------------------------\n" > PJLScan-`date -I`.$1.txt

{ echo -e "\033%-12345X@PJL";
echo @PJL INFO ID;
echo @PJL INFO CONFIG;
echo @PJL INFO FILESYS;
echo @PJL INFO LOG;
echo @PJL INFO MEMORY;
echo @PJL INFO PRODINFO;
echo @PJL INFO STATUS;
echo @PJL INFO SUPPLIES;
echo @PJL INFO VARIABLES;
echo -e "\033%-12345X";
sleep 5; } | telnet $1 9100 | sed -e 's/\r$//' >> PJLScan-`date -I`.$1.txt

If you could post your results in the comments, or Pastebin them and post the link, I'd be happy to share them. (Feel free to remove serial numbers if you wish; simply replace them with 'x's or '-'s.) I'm trying to get a feel for what the most common options and languages are, as an upcoming open-source project has me parsing raw data and sending it to network printers.

The usual disclaimers apply: I'm not responsible for damages caused to your stuff or expenses incurred (i.e ink/toner/paper). Luckily, the worst case scenario is either A) Print out a page with those commands on it, or B) Hog the printer's I/O until it times out (or you turn it off and then back on). For this reason, I recommend only trying this on a printer to which you *own* and to which you have physical access.

PJL Commands:

Tip: To run a PJL command,
you need to be in PJL mode. If you're not in PJL mode (ie you typed something that doesn't begin with an @, you get bumped into raw text mode), you need to send a <Control+[>%-12345X@PJL <Enter>, then you can type your PJL command, beginning with "@". To end your PJL session, send <Control+[>%-12345X (with no <Enter> after it)

"@PJL" can be used as a command on its own, or rather, a lack of command (or NOOP). It is used after the Escape Code (...%-12345X) to tell the printer you will be typing some PJL. This is necessary because printers sample the code after the Escape Code (...%-12345X) to try to determine what type of data they are receiving (PJL, PCL, PCLXL, PostScript, etc., depending on the model)

HP LaserJet 4M Plus

  • Network printer, port 9100
  • Personalities: (Auto), PCL, PostScript [optional SIMM installed]

HP Color LaserJet CP1518ni:

  • Network printer, port 9100
  • Personalities: PCL, PCLXL, PostScript

HP Color Laserjet MFP M275nw:

  • Connected by 'Wireless Direct Connect' and used telnet to port 9100
  • Personalities: (Auto), URP, PCL, PDF, PostScript

HP LaserJet 1012:

  • Plugs in by USB only
  • Can interact with it at /dev/usblp0 at 115200,8,n,1 using gtkTerm as root: sudo gtkterm --port /dev/usblp0 --speed 115200 --echo and set "CR LF auto" under the configuration menu
  • Interesting: @PJL SET TESTPAGE=DATASTORE is an interesting (4-page) test page, essentially a printout of the value and meaning of all variables
  • Personalities: PCL, PCLXL

HP LaserJet 9050:

  • Network printer, port 9100
  • Interesting: 2MB Flash ROM and a RAMdisk for storage
  • Personalities: PCL, PCLXL, PDF, PostScript, MIME, XHTML

HP Color LaserJet 9500:

  • Network printer, port 9100
  • Personalities: (Auto), PCL, PDF, PostScript

HP Officejet Pro X476dw MFP:

  • Network printer, port 9100
  • Filesystem with Read/Write NAND
  • Personalities: PCL, PCLXL, PostScript, PDF

Brother HL-3040cn:

  • Network printer, port 9100
  • Personalities: XL2HB

Brother MFC-7440n:

  • Network printer, port 9100
  • Personalities: PCL

See also:

Please note:

  • I would imagine a number of inkjets use PJL, though honestly I have no inkjet printers on-hand to test on. I posit that a number of inkjets will work, including ones with built-in Ethernet. It may be possible to execute commands over USB as with the LaserJet 1012 (See above for serial terminal settings). If anyone has inkjet dumps, they're just as welcome as Laser ones.
AttachmentSize
HP CP1518ni Info Dump.doc22 KB
HP LaserJet 4M Plus Info Dump.doc22.5 KB
HP LaserJet 1012 Info Dump.doc18.5 KB
Brother MFC-7440N Info Dump.doc17 KB
HP LaserJet 9050 Info Dump_redacted.doc21.5 KB
HP Color LaserJet 9500 Info Dump_redacted.doc19.5 KB
HP Color LaserJet MFP M275nw Info Dump.doc24.5 KB
Brother HL-3040CN Info Dump.doc18.5 KB

Trackback URL for this post:

http://erroraccessdenied.com/trackback/1693

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

HP LaserJet 9500

[Ed: *snip*, .doc'ified]

HP LaserJet 9050

@PJL INFO ID
"hp LaserJet 9050"

[Ed: *snip* This post has been .DOC'ified.]

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <b> <i> <u> <cite> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <br> <p> <img> <pre>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.

More information about formatting options