Change The Serial Number On HP Printers Using Printer Job Language And netcat (or ftp)

Serial numbers sometimes default to XXXXXXXXXX after having a component replaced or the firmware being updated.  The Web interface does not offer a way to set the serial number, but this can be accomplished with some Terminal commands.

For the sake of this walkthrough, it is recommend to use vim to edit the file.  However, since it is difficult to learn (but not really), I will do a very detailed step-by-step so there are no issues.  If you are already familiar with vim, then you will probably cruise through this.

Create A Printer Job Language File With Commands To Change The Serial Number (Or Download A Pre-made File)

  1. Open Terminal
  2. Type vi filename.pjl
  3. Press Return
  4. Press the letter “i” once (the word INSERT will show up on the bottom, meaning you can type text in)
  5. Hold Control and press “v”—let go of both keys—press Control once—press Escape
    (if done correctly, you should see a carat and a left-bracket, but it should be in color)
  6. Type this in exactly after the colored carat/bracket: %-12345X@PJL SET SERVICEMODE=HPBOISEID
  7. Press Return (to go to the next line)
  8. Type @PJL SET SERIALNUMBER=ABDC123456  (modify the serial number)
  9. Press Return (to go to the next line)
  10. Type @PJL SET SERVICEMODE=EXIT
  11. Press Return (to go to the next line)
  12. Hold Control and press “v”—let go of both keys—press Control once—press Escape
  13. Type this in exactly after the colored carat/bracket: %-12345X
  14. Press the escape key once (the word INSERT will disappear)
  15. Hold Shift and press colon (a colon will appear on the bottom left, which allows you to enter commands)
  16. Type wq! (this means write (save) the file, then quit)

The Completed File

Note: it will not work to copy and paste the text below because of the escape character at the beginning of the file (shown below as ^[ )

^[%-12345X@PJL SET SERVICEMODE=HPBOISEID
@PJL SET SERIALNUMBER=ABCD123456
@PJL SET SERVICEMODE=EXIT
^[%-12345X

Verify That Your File Is Recognized As A .pjl File

  1. Type file filename.pjl

If you did it correctly, it should show up as filename.pjl: HP Printer Job Language data.  

If you did it wrong, it will say filename.pjl: ASCII text or ASCII text with escape sequences)

Send The File To The Printer To Change The Serial Number

There are a number of ways to do this, but below are two of the most effective ways.

Via netcat (easier and faster)

  1. Type cat filename.pjl | nc 10.10.10.10 9100  (substitute the IP address of your printer)

Congratulations, your serial number has been changed.

Via ftp (slower, but effective)

  1. Type ftp 10.10.10.10 (substitute the IP address of your printer)
  2. Press Enter twice (leaving username and password fields blank)
  3. Type put filename.jpl  (this uploads the file to the printer)
  4. Type bye

Congratulations, your serial number has been changed.

 

Leave a Reply