Changing the LaserJet Ready Message

Quoting from http://www.ancientpond.com/ljshen.html:

The LJ has a number of legitimate messages built in that pop up in cases of low toner, paper out, paper jam, etc. There is one message that appears while there is no error condition: READY. This "Readymessage" indicates that everything is fine, and no intervention is necessary. Now, what a lot of people don't know is that this message can be programmed, by sending a simple escape string to the printer...

A quick recipe for the *nix users (Macs, you need the OS X Developer Tools) -- certainly not the simplest way, but worked for me. We print directly to networked printers, so the whole Windows print server name/domain stuff is N/A. This assumes you know the IP of the printer.

Copypaste this into a plain text file and save it as ljmsg.c:


/* ljmsg - format a readymessage for a laserjet 4si or later model */
#include <stdio.h>

void
main(int argc, char **argv) {
    char esc = 27;
    int i;
    printf("\33%%-12345X@PJL RDYMSG DISPLAY=\"");
    for (i = 1; i < argc ; i++) printf("%s ",argv[i]);
    printf("\"\n");
}

OR download this to your Desktop: http://www.ancientpond.com/ljmsg.c

In Terminal, type

cd Desktop (hit return)
gcc ljmsg.c (return)

Ignore warning about return type.

3. Still in Terminal, type

mv a.out ljmsg (return)
./ljmsg YOUR FUNNY MESSAGE | nc ipaddress-of-printer 9100 (return)

Wait 5 or 10 seconds in case the printer's asleep, then hit ctrl-c to exit nc.

Brief explanation: nc is NetCat, just opens a raw connection to a port, with none of the overhead of telnet. TCP port 9100 is the HP JetDirect port, which is supported by many other brands including Xerox.