How to Use the P910nd Print Server

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

How to Use the P910nd Print Server

#1 Post by rcrsn51 »

P910nd is a simple network print server. You can use it instead of CUPS or Samba to share an attached printer with both Linux and Windows clients. Install the PET attached below. There are 32bit and 64bit versions. The PETs include a control panel applet for managing the P910nd print server. Find it in the System menu.

Check out the auto-start script /root/Startup/910nd-start. It contains the line

Code: Select all

p910nd -f /dev/usb/lp0 0
This starts the print server daemon. It listens on Port 9100 for incoming print jobs and sends them directly to the USB printer connected at /dev/usb/lp0.

Initially, the startup script is disabled. To start the print server, run the P910nd Control Panel from the System menu.

As usual, the Puppy firewall may interfere with the operation of P910nd. Read here.

--------------------------------------------

Setting up a Client Printer under Linux

Hint: On a client machine, run PeasyPort and check that Port 9100 is open on the server.

1. Open the CUPS web interface.
2. Select Add Printer.
3. Under Device, select AppSocket/JetDirect (P910nd printers are NOT auto-detected by CUPS)
4. Under Connection, enter the following URI, using the IP address of the server:

Code: Select all

socket://aaa.bbb.cc.dd:9100
5. Select the printer Make and Model as usual. If a driver package like hplip_print is needed, you must first install it on the client machine.

---------------------------------------------

Setting up a Client Printer under Windows XP

1. Start the Add Printer Wizard
2. Select Local Printer (even though it's not)
3 Select New Port > standard TCP/IP
4. Enter the IP address of the server and change the port name to something descriptive.
5. There will now be a pause while Windows tries to find the printer, but cannot.
6. Select Custom > Settings
7. Select Raw and enter the port number 9100.
8. Install the printer driver
9. Check the printer's properties and verify the port configuration.

---------------------------------------------

Be aware that if the server's IP address changes, clients will lose their connection to the shared printer. There are two solutions:

1. Assign the server a fixed IP address. (If you have Windows clients, this may be your best choice.)

2. Add an entry to the client's /etc/hosts file containing the server's current IP address and a descriptive name, like

Code: Select all

192.168.2.15 Deskjet-F4280-Bedroom
Then create the printer in CUPS as

Code: Select all

socket://Deskjet-F4280-Bedroom:9100
If the server's IP address changes, you need only update the client's host file.

--------------------

The Control Panel has two sections. Use the Server section on the computer that has the attached printer and is running the P910nd server.

You can optionally install the P910nd package on other computers. Use the Client section to manage a computer's own CUPS printers, either attached or remote.

-------------------------------------------
Attachments
screenie.png
(24.58 KiB) Downloaded 1447 times
p910nd_print_server-0.97.3.pet
Updated 2017-04-06
(12.33 KiB) Downloaded 582 times
p910nd_print_server_64bit-0.97.3.pet
Updated 2017-04-06
(13.73 KiB) Downloaded 537 times
Last edited by rcrsn51 on Mon 09 Mar 2020, 19:05, edited 40 times in total.
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

Two printers connected to Asus WL 500gP

#2 Post by DanielV »

I found this forum. I hope that anyone can help me.

I want to the ability to print on two printers. I searched web for help and at the end I added to usr/local/sbin/post-boot two lines for start p910nd:

p910nd -f /usb/dev/lp0 0
p910nd -f /usb/dev/lp1 1

and now two printers are recognized and works (on ports 9100, 9101). But sometimes a problem appears - when one of the printers is not powered on, etc.

I know that the reason is that missing script that recognized printer #1 and #2 and then restart the daemon. But I can´t to write this.

Can anyone help me, advice me, or something like that?

Thanks in advance.
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#3 Post by rcrsn51 »

You haven't stated what Linux you are using, but here is how to do it in Puppy.

1. Delete the lines you added to usr/local/sbin/post-boot. We will start the p910nd server automatically when the printer is turned on by using udev.

2. Unpack the file attached below and copy it to /etc/udev/rules.d.

3. It contains two rules - one for each printer. You just need to modify the vendor and product ID codes to match your printers.

4. Turn on the first printer and run the command lsusb. The vendor:product ID code will look like 03f0:2504. Repeat with the second printer.

5. Open the p910nd.rules file in a text editor and insert your own vendor and product codes.

6. Reboot your computer and turn on the printers in any order. Your first printer should always be on port 9100 and the second on port 9101.

FYI. This is my first attempt at udev. If anyone with more experience wants to make suggestions, feel free.
Attachments
11-p910nd.rules.gz
(230 Bytes) Downloaded 1385 times
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

Thank you very much

#4 Post by DanielV »

At first, I am so surprising that you answer me so quickly and so good!!
I will do it once I will return to work.

I don´t use computer powered by some Linux distribution, all this concerning router Asus WL 500G Premium (Oleg firmware inside) serving as printserver in our small office. But I think this will work!

I will report once I try it.

Thank you very much!! You are great ...
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

continued

#5 Post by DanielV »

I am new in Linux. There is only file udev.conf , but not directory (if this is a directory) rules.d in /etc/udev.

My question is probably stupid - is it possible to create this directory and copy there text file containing rules (p910nd.rules)? Is it possible in Oleg firmware I am using?

Or I have to flash firmware with OpenWRT, which is real Linux for embedded devices? I am afraid that this step will be difficult for me, since there are required very good knowledges of Linux.

I found this script, see http://wl500g.info/showthread.php?t=14959 - (description is in Cyrillic, best viewed using encoding Cyrillic (Windows-1251)). But I would like use (if possible in Oleg on Asus WL 500G Premium) rules made by member rcrsn51.

Thanks for you help in advance
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#6 Post by rcrsn51 »

I'm a little confused here. According to the specs for the WL-500gP, it already has a print server built-in. So why do you need to run p910nd on it?

In the script you reference above, the udev rules folder is /usr/local/etc/udev/rules.d. Does it exist in your system?
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

Answers

#7 Post by DanielV »

Regarding to first question. Yes, I know WL 500gP has already built-in printserver. I am searching for solving my problem - that is how to operate two printers at the same time (the first one is ancient parallel printer-photocopier Minolta DiAlta Di152 connected using parallel-to-USB adapter, the second one is Samsung SCX 4725 FN with damaged network card) a few months. Almost everywhere is stated usage p910nd:

http://wl500g.info/showthread.php?t=10748
http://wl500g.info/showthread.php?t=687
http://wl500g.info/showthread.php?t=16470
http://wl500g.info/showthread.php?t=11665
http://wl500g.info/archive/index.php/t-4372.htm
http://wl500g.info/archive/index.php/t-4408.html
http://wl500g.info/archive/index.php/t-4927.html
http://wl500g.info/showthread.php?t=771&page=2
http://g300nh.blogspot.com/2010/06/prin ... imple.html
https://forum.openwrt.org/viewtopic.php?id=14887
http://www.dd-wrt.com/wiki/index.php/Printer_Sharing
http://downloads.dd-wrt.com/wiki/index. ... er_Support
http://wiki.openwrt.org/doc/howto/p910nd.server

In the end I added two lines into post-boot directory to start daemon. That worked (not in all circumstances), but I want to solve this without problems with printers ordering etc, etc.

This was the reason for using p910nd, but if this can be solved easily without p910nd, then simply welcome.

Regarding to your second question I will let know within a few hours when I will be back in office.

Thanks for your help.
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#8 Post by rcrsn51 »

If you cannot get it working using udev, there may be another way. By looking at the system logs, you can tell which printer connected first. Then you could launch p910nd in the correct order. I will look at this.

[Edit] Here is a little script you can put in usr/local/sbin/post-boot. It looks at the system messages and determines which device node was assigned to each printer. It then runs the appropriate p910nd command.
Attachments
p910nd-start.gz
(187 Bytes) Downloaded 1271 times
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

I have tried all

#9 Post by DanielV »

I have thoroughly checked system. There is no directory rules.d even in /usr/local/etc/udev/rules.d. And sorry, in /etc/udev is file usb.switchingmode.conf not the udev.conf as I wrote above.

I copied your script with my product IDs to usr/local/sbin/post-boot, saved using flasffs save && flashfs commit && flashfs enable and then reboot. But this resulted in printing only on the second printer on 9101 port. I tried to change everything, in Windows printers settings (all client PCs are powered by Windows XP), also tried make your script in post-boot as executable using chmod +x /usr/local/sbin/post-boot (but I think it´s not good, or yes?).

Now I don´t know what to do. I will copy here WL 500GP System Log.
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#10 Post by rcrsn51 »

It sounds like the script worked, but only detected the second printer. Run this commnd

Code: Select all

dmesg | grep xxxx
where xxxx is the product ID of the first printer. Is it identified?
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

Printers and system log

#11 Post by DanielV »

When I run dmesg | grep 2305 (ID of 1st printer) then result is:

printer.c: usblp1: USB Bidirectional printer dev 2 if 0 alt 1 proto 2 vid 0x067B pid 0x2305

and when dmesg | grep 341F (ID of 2nd printer):

printer.c: usblp0: USB Bidirectional printer dev 2 if 1 alt 0 proto 2 vid 0x04E8 pid 0x341F

Means both printers are detected.

In the attachment System Log of the router. I tried to print on first printer (port 9100, pid 2305), printedout on the second. And now sorry, when tried on the second one (port 9101, pid 341F), no print, no items in the System Log.

There is a mess with lp0 and lp1. I will get you all info about system, if you need.


Thank you for your kindness and your free time!
Attachments
System Log.zip
(87.51 KiB) Downloaded 710 times
Post-boot_script.PNG
(21.41 KiB) Downloaded 5220 times
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#12 Post by rcrsn51 »

OK. I can see the problem. Your dmesg lines are formatted differently than mine. Try this version.
Attachments
p910nd-start.gz
(196 Bytes) Downloaded 1219 times
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

Tomorrow definitely

#13 Post by DanielV »

Thanks for your interest.

You are real enthusiast. Greetings from Czech Republic. I will try tomorrow.
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

Tried today

#14 Post by DanielV »

I have tried this version.

Running dmesg | grep "pid 0x2305" | tr -d " " resulted in:

printer.c:usblp1:USBBidirectionalprinterdev2if0alt1proto2vid0x067Bpid0x2305

and dmesg | grep "pid 0x341F" | tr -d " " has returned:

printer.c:usblp0:USBBidirectionalprinterdev2if1alt0proto2vid0x04E8pid0x341F


In the attachment again Log and post-boot script.

But again prints only the second printer in case I want to print on the first one. If I want to print on the second, no printing, no record in Log.

Maybe the problem is on my side. I have made post-boot script as executable. Is it rigt?
Attachments
Script_post-boot.PNG
(19.97 KiB) Downloaded 5107 times
System Log_2.zip
(88.17 KiB) Downloaded 753 times
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#15 Post by rcrsn51 »

If you don't run your post-boot script and plug in one printer, does the router automatically start it? If so, we are causing a conflict by trying to start it a second time. Maybe you need to stop the first printer before running the script. Add this line at the start

Code: Select all

killall p910nd
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

Tried this

#16 Post by DanielV »

I have added this command to the post-boot (if you thought to add there ("at the start")). I don´t know exactly where, therefore I did it two times. See attachment for script and appropriate log. Again prints only second printer when attemped to print on first one. Nothing new.

If I can answer your question - I have erased post-boot script and connected only first printer. Log in the attachment.
Attachments
Log_only 1st printer without script.zip
(87.36 KiB) Downloaded 420 times
Log_2.zip
(87.98 KiB) Downloaded 406 times
Script_2.PNG
(20.24 KiB) Downloaded 1012 times
Log_1.zip
(87.91 KiB) Downloaded 409 times
Script_1.PNG
(20.15 KiB) Downloaded 1005 times
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#17 Post by rcrsn51 »

Your original post has this code:

Code: Select all

p910nd -f /usb/dev/lp0 0
p910nd -f /usb/dev/lp1 1 
But we have been using:

Code: Select all

p910nd -f /dev/usb/lp0 0
p910nd -f /dev/usb/lp1 1 
Which of these is valid?

A useful command is

Code: Select all

ps | grep p910
This will show what servers are running.

Change the first line of the script from

Code: Select all

#!/bin/sh
to

Code: Select all

#!/bin/bash
Type each of the commands in the script individually. After the line

Code: Select all

D=${L:15:1}
type

Code: Select all

echo $D
This value should be either a zero or a one.
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

Tried all

#18 Post by DanielV »

Valid code was

Code: Select all

 p910nd -f /dev/usb/lp0 0
[code] p910nd -f /dev/usb/lp1 1

It was my mistake. I wrote this from my memory(head). /usb/dev even doesn´t exist in my system.

But this code now also doesn´t work!

Only thing that works now  is to run these code when router and printers are on:

p910nd -f /dev/usb/lp1 1

Then servers running, see attachment (Servers running_no script).

I tried everything you suggested, #!/bin/sh or #!/bin/bash results in the same - prints only second printer when attempting the first one.

When this script is running, command ps | grep p910 resulting in, see attachment, maybe this will be important for you (When script is running).

I couldn´t display the value $D, blank line in Putty, blank in System Command field in router web interface.

Thanks
Attachments
Script_current.PNG
(20.4 KiB) Downloaded 1009 times
When script is running.PNG
(79.17 KiB) Downloaded 688 times
Servers running.PNG
(16.75 KiB) Downloaded 953 times
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#19 Post by rcrsn51 »

The "ps" command shows that both servers are running. However, if the router is servicing one of the printers on its own, I don't know how to turn that off.
DanielV
Posts: 17
Joined: Thu 03 Mar 2011, 07:50
Location: Czech Republic

Never mind

#20 Post by DanielV »

I want to say that you did great work. Thanks again.
I will solve this probably by flashing with OpenWRT firmware.
Post Reply