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)
- Open Terminal
- Type vi filename.pjl
- Press Return
- Press the letter “i” once (the word INSERT will show up on the bottom, meaning you can type text in)
- 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) - Type this in exactly after the colored carat/bracket:
%-12345X@PJL SET SERVICEMODE=HPBOISEID
- Press Return (to go to the next line)
- Type
@PJL SET SERIALNUMBER=ABDC123456
(modify the serial number) - Press Return (to go to the next line)
- Type
@PJL SET SERVICEMODE=EXIT
- Press Return (to go to the next line)
- Hold Control and press “v”—let go of both keys—press Control once—press Escape
- Type this in exactly after the colored carat/bracket:
%-12345X
- Press the escape key once (the word INSERT will disappear)
- Hold Shift and press colon (a colon will appear on the bottom left, which allows you to enter commands)
- 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
- Type
ile 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)
- Type
at 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)
- Type
ftp 10.10.10.10
(substitute the IP address of your printer) - Press Enter twice (leaving username and password fields blank)
- Type
put filename.jpl
(this uploads the file to the printer) - Type
bye
Congratulations, your serial number has been changed.