2009/11/19

WMU-6500FS - Print server installation



Introduction

Since I have one LPT printer and several computers at home I considered buing a print server for a long time. What reliably discouraged me however was the price - for example HP print server price starts at around 140$.
Unfortunately I haven't bought a router with USB ports like Asus WL-500W, but rather Linksys WRT54GL and so the printer sharing as described at DD-WRT wiki was not applicable in my case.
Then I noticed that there is a p910nd print daemon package available at the JoKer's site.
There was not much information about the installation on the Web and so I was pretty unsure but I decided to give it a try.

Note: Before you follow the steps I describe here, please, make sure your printer is compliant with the JetDirect technology.

Hardware installation

My HP LaserJet 1100 printer is not USB but LPT, so there is some USB to LPT reduction necessary.
I also realized that there is not a standard printer cable but rather a Mini Centronics cable used for the printer connection.

So it seemed that besides something like the USB to Parallel port adapter (14$) also another reduction like Centronics to Mini Centronics adapter (11$) was necessary (there is also a combo for 24$ so you can spare a buck ;).

Since I already had a standard printer cable the best choice for me was the ST Lab U-370 Dongle. For only 11$ does the job very well.
So that's it regarding to hardware installation.

Software installation

We download and install the p910nd print daemon (I use 0.92 version, I had no luck with the latest 0.93 version, I got /var/lock/subsys/p9100d file not found error).
Edit: now the problem with 0.93 is solved, see the discussion below
box# cd /mnt/C
box# wget http://mgb111.pradnik.net/addons/servers-print/p910nd-0.92-081017.tar
box# tar xvf p910nd-0.92-081017.tar
./sys/
./sys/etc/
./sys/man/
./sys/man/man8/
./sys/man/man8/p910nd.8
./sys/sbin/
./sys/sbin/p910nd
Now we are ready to plug the printer to USB port (suppose you use the USB1 port specifically) and run the daemon:
box# /mnt/C/sys/sbin/p910nd -b -f /dev/usblp0
We can see that the process is now up and running. The fact that it is named p9100d (instead of original p910nd) means that it is listening at port 9100.
box# ps | grep p910
  271 root        284 S   /mnt/C/sys/sbin/p9100d -b -f /dev/usblp0
 1863 root        216 S   grep p910
We can make sure it is actually listening at the port; when we run the network statistics to list all the ports all the processes are are listening for, newly we can see the jetdirect port.
box# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
...
tcp        0      0 *:jetdirect             *:*                     LISTEN      
...
We can also look at the system log (with help of the dmesg command). There we can find something similar to the following:
box# dmesg
...
hub.c: new USB device 00:0a.0-2, assigned address 2
printer.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 1 proto 2 vid 0x067B pid 0x2305
...
When we retrieve the description string of the USB device, we get that there is a IEEE-1284 (parallel communication) controller made by the Prolific Technology Inc..
box# cat /proc/printer/usblp0
Prolific Technology Inc. IEEE-1284 Controller
0x18
Note that in case you have a USB printer you should probably expect somewhat more meaningful string like
Hewlett-Packard HP LaserJet 1005 series
Now we are ready to try some printing:
box# echo "printer test" > /dev/usblp0 
...
Initially I got the following error message:
bash: /dev/usblp0: Device or resource busy
... then I realized that there is a mini-lpd process running holding the device. mini-lpd is a small, non-queueing LPD implementation. I do not know why there is mini-lpd active on the box, I have not tried to make it work, I just killed it and used p910nd daemon instead:
box# killall mini-lpd
After that everything started to work.
To make the changes permanent, I have added add the following lines:
### printserv
killall mini-lpd
/mnt/C/sys/sbin/p910nd -b -f /dev/usblp0 &
to the /mnt/C/sys/etc/rc-local file.

Ok, that's it on the server side, let's look at the clients...

Client installation

Now it is time to install the print clients:
Windows XP
I presume you already have the printer installed locally, and so the only thing you need is to create a new port and set it up as a Standard TCP/IP Port: Now you select the box IP or network name: As a device type you choose the Hewlett Pacjkard Jet Direct: Here is a result page(SNMP not supported, RAW protocol, port 9100): Here we see the newly created port: And finally we are ready to print test page:
Ubuntu 9.10
In menu System/Administration/Printing we choose to create a new printer and in device selection choose Network Printer and AppSocket/HP JetDirect.In Host and Port fields we fill the box IP or network name and as port we use 9100: The next step is the Printer model and driver selection: Now we can specify the printer name and description: And finally we are ready to print test page:

Links


8 comments:

Anonymous said...

Thank you. I have the same experience: version 0.92 works, but 0.93 don't. I have no idea about it. Do you?

filodej said...

Hi,
initially I did not dig into it and simply stayed with 0.92, but when you asked, it became a bit of a challenge ;-)

Here I found a discussion about a similar problem some time ago, so I decided to give it a try.

I killed the old daemon, installed and tried to start the new one, but no luck:

box# ps | grep p910
1883 root 288 S /mnt/C/sys/sbin/p9100d -b -f /dev/usblp0
25969 root 216 S grep p910
box# kill 1883
box# tar xvf p910nd-0.93+miniLpd-0.4-090618.tar
...
box# /mnt/C/sys/sbin/p910nd -b -f /dev/usblp0
box# ps | grep p910
25981 root 216 S grep p910


There was the known error in the log:

box# cat /var/log/messages
...
Nov 26 20:26:30 p9100d[25990]: /var/lock/subsys/p9100d: No such file or directory
...

Just to check whether it really causes the daemon to stop, I tried strace. The error message appeared right before the daemon process exited:

box# strace -f /mnt/C/sys/sbin/p910nd -b -f /dev/usblp0
...
open("/var/lock/subsys/p9100d", O_RDWR|O_CREAT, 0666) = -1 ENOENT (No such file or directory)
...

Then I realized that there is not even subsys directory in /var/lock/. When I created it and restarted the daemon again, VoilĂ !:

box# mkdir /var/lock/subsys
box# /mnt/C/sys/sbin/p910nd -b -f /dev/usblp0
box# ps | grep p910
26015 root 268 S /mnt/C/sys/sbin/p9100d -b -f /dev/usblp0
26017 root 216 S grep p910


Since the /var/lock is not persistent, the newly created directory disappears after the reboot, so in order to make the change 'persistent', we have to update the rc-local file:

### printserv
killall mini-lpd
mkdir /var/lock/subsys
/mnt/C/sys/sbin/p910nd -b -f /dev/usblp0 &


Hope it helps.
Regards,
Filodej

Anonymous said...

Thank you very much. It really helps! Now version 0.93 is working.

Anonymous said...

Thank you, good guide. I have a trouble with my Deskjet 5900: when I send a print job (echo "..." etc), the printer starts and then stop the job. After some seconds, the printer prints the text. In "/mnt/C/sys/etc" I haven't the rc-local. Why? Thanks

filodej said...

Hi,
I do not know why, probably you have another fw version?
Did you try to look for the file somewhere else in the /mnt/C/sys?
Did you look at the system log?
Did you try to kill the mini-lpd daemon?
Regards,
Filodej

Emanprinting said...

This information is really good thanks for share it.

Folder Printing

Unknown said...

I followed everything but can't eget anything to print. I have a psc 1410 which is an hp all in one. I am guessing that could be my issue. Any help would be great

JPLB said...

do u know how to run a e2fsck beforme mount the filesystem?
or an alternative, because i believe my fs is down