Apple Airport Printing from UNIX
I managed to get a HP LaserJet 5MP on loan from work for use when telecommuting. We have recently been upgraded from Dell Latitudes to IBM/Lenovo laptops but as these have no parallel port we were given Belkin USB to Centronics adapters.
Rather that just connecting it directly to the work laptop I thought I would try and get it working with the USB port of my Airport Extreme wireless router so I can print from all the machines at home.
This actually works fine when printing from a Mac as the printer is discovered immeadatly via Apples Bonjour protocol. I then wanted to be able to print from my Ultra 5 and SGI Indy. After searching around it seems the Airport Extreme is able to receive raw print commands via a socket a la HP JetDirect.
I found the following procedure which works great, but be aware that for some reason the latest firmware update for the Airport Extreme changes the raw port from 9100 to 9101 (this was very frustrating!) :-
http://weblogs.java.net/blog/mhadley/archive/2006/01/printing_to_an.html
Printing to an Apple Airport Connected USB Printer from Solaris
Posted by mhadley on January 30, 2006 at 09:39 AM | Comments (0)The first thing to do is work out the IP address of the Airport base station to which you’ve hooked up the printer. The Airport Admin utility on a Mac can help out here if you have multiple base stations but if you have only one then its likely to the same IP address that is your default gateway. To find the default gateway type (the # represents the shell prompt, don’t type it):
# netstat -rn
and look for the ‘default’ entry.To make sure you’ve got the right IP address try:
# telnet ipaddr 9100
where ipaddr is the IP address of the base station. If telnet connects then you’re probably on the right track.Next you need to configure a Solaris printer queue that points to the networked printer. It turns out that the Airport base station works pretty much the same as a HP JetDirect print server and the following commands get the job done:
# lpadmin -p hp -v /dev/null -m netstandard -o dest=airport:9100 -o protocol=tcp -o banner=never -T PS -I postscript
# enable hp
printer “hp” now enabled
# accept hp
destination “hp” now accepting requests
# lpadmin -d hpwhere hp is the name of the printer queue and airport is the IP address or DNS name of the base station. The first line creates the queue, the second and third enable the queue and set it to accept requests and the final line sets this new queue to be the default printer queue. The first line will need adjusting if you are using anything other than a PostScript printer, the key parts of the command are use of tcp for protocol rather than bsd and using TCP port 9100 on the base station.
I’ve secretly always wanted to have console output being printed to a tractor feed printer using that cool fan fold paper with green stripes. Oh well this will have to do I guess. I think I was born twenty years too late to be a real system operator.
UPDATE 04/07 : I’ve been experimenting with UNIX printing to an Airport Express. It looks like the port should be 9600 for the Apple Airport Express
ben@ultra5 /export/home/ben $ telnet 10.0.1.232 9100
Trying 10.0.1.232…
Connected to 10.0.1.232.
Escape character is ‘^]’.
@PJL USTATUS TIMED
CODE=10001
DISPLAY=”00 READY”
ONLINE=TRUE@PJL USTATUS TIMED
CODE=10001
DISPLAY=”00 READY”
ONLINE=TRUE@PJL USTATUS TIMED
CODE=10001
DISPLAY=”00 READY”
ONLINE=TRUE@PJL USTATUS TIMED
CODE=10001
DISPLAY=”00 READY”
ONLINE=TRUE@PJL USTATUS TIMED
CODE=10001
DISPLAY=”00 READY”
ONLINE=TRUE@PJL USTATUS TIMED
CODE=10001
DISPLAY=”00 READY”
ONLINE=TRUEConnection to 10.0.1.232 closed by foreign host.
I found your website after I have been surfing the internet to be useful
Comment by tips — December 19, 2007 @ 4:57 am
Great Design and useful information. I will be back soon!
Comment by bono de depsito — December 29, 2007 @ 4:39 pm