Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 02 Oct 2014, 10:33
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to Use the P910nd Print Server
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Author Message
rcrsn51


Joined: 05 Sep 2006
Posts: 9162
Location: Stratford, Ontario

PostPosted: Sat 02 Oct 2010, 13:22    Post_subject:  How to Use the P910nd Print Server  

P910nd is a simple network print server. You can use it instead of CUPS or Samba to share printers with both Linux and Windows clients.

Check out the script /usr/local/bin/p910nd-start. It contains the line
Code:
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 printer connected to /dev/usb/lp0. No queuing is done and the daemon does not filter the job through a printer driver. The job has already been formatted by the client using its own CUPS setup.

If you have a parallel printer, the script would be
Code:
p910nd -f /dev/lp0 0

You can also have multiple printers running off the same server by using different port numbers. For example:
Code:
p910nd -f /dev/usb/lp0 0
p910nd -f /dev/lp0 1

So the server listens on Port 9100 for jobs to the USB printer and on Port 9101 for jobs to the parallel printer.

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

Setting up a Client Printer under Linux

1. Open the CUPS web interface
2. Select Add Printer (P910nd printers cannot be auto-detected)
3. Under Device, select AppSocket/JetDirect
4. Under URI, enter
Code:
socket://aaa.bbb.cc.dd:910x

Use the IP address of the server and set x to the port number.
5. Select the printer driver as usual

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

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 correct port number - 9100, 9101, etc.
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, the clients will lose their connection to the network printers. Either give your server a static IP address or always boot it first to ensure that it keeps the same address.

Since the P910nd server doesn't queue its print jobs, there is a possibility of collisions if two users try to print simultaneously. However, I have tested this and it does not appear to be a problem.
p910nd-rcrsn-0.93.pet
Description 
pet

 Download 
Filename  p910nd-rcrsn-0.93.pet 
Filesize  6.31 KB 
Downloaded  795 Time(s) 
Back to top
View user's profile Send_private_message 
DanielV

Joined: 03 Mar 2011
Posts: 17
Location: Czech Republic

PostPosted: Thu 03 Mar 2011, 03:59    Post_subject: Two printers connected to Asus WL 500gP  

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.
Back to top
View user's profile Send_private_message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9162
Location: Stratford, Ontario

PostPosted: Thu 03 Mar 2011, 12:38    Post_subject:  

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.
11-p910nd.rules.gz
Description 
gz

 Download 
Filename  11-p910nd.rules.gz 
Filesize  230 Bytes 
Downloaded  528 Time(s) 
Back to top
View user's profile Send_private_message 
DanielV

Joined: 03 Mar 2011
Posts: 17
Location: Czech Republic

PostPosted: Thu 03 Mar 2011, 12:52    Post_subject: Thank you very much  

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 ...
Back to top
View user's profile Send_private_message 
DanielV

Joined: 03 Mar 2011
Posts: 17
Location: Czech Republic

PostPosted: Fri 04 Mar 2011, 05:46    Post_subject: continued  

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
Back to top
View user's profile Send_private_message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9162
Location: Stratford, Ontario

PostPosted: Fri 04 Mar 2011, 09:08    Post_subject:  

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?
Back to top
View user's profile Send_private_message 
DanielV

Joined: 03 Mar 2011
Posts: 17
Location: Czech Republic

PostPosted: Fri 04 Mar 2011, 11:18    Post_subject: Answers  

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/printer-server-for-dd-wrtthe-simple.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.php/Asus_WL-500g_Premium_En#Printer_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.
Back to top
View user's profile Send_private_message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9162
Location: Stratford, Ontario

PostPosted: Fri 04 Mar 2011, 11:31    Post_subject:  

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.
p910nd-start.gz
Description 
gz

 Download 
Filename  p910nd-start.gz 
Filesize  187 Bytes 
Downloaded  467 Time(s) 
Back to top
View user's profile Send_private_message 
DanielV

Joined: 03 Mar 2011
Posts: 17
Location: Czech Republic

PostPosted: Sat 05 Mar 2011, 04:41    Post_subject: I have tried all  

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.
Back to top
View user's profile Send_private_message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9162
Location: Stratford, Ontario

PostPosted: Sat 05 Mar 2011, 09:10    Post_subject:  

It sounds like the script worked, but only detected the second printer. Run this commnd
Code:
dmesg | grep xxxx

where xxxx is the product ID of the first printer. Is it identified?
Back to top
View user's profile Send_private_message 
DanielV

Joined: 03 Mar 2011
Posts: 17
Location: Czech Republic

PostPosted: Sat 05 Mar 2011, 15:59    Post_subject: Printers and system log  

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!
System Log.zip
Description 
zip

 Download 
Filename  System Log.zip 
Filesize  87.51 KB 
Downloaded  250 Time(s) 
Post-boot_script.PNG
 Description   
 Filesize   21.41 KB
 Viewed   1763 Time(s)

Post-boot_script.PNG

Back to top
View user's profile Send_private_message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9162
Location: Stratford, Ontario

PostPosted: Sat 05 Mar 2011, 17:19    Post_subject:  

OK. I can see the problem. Your dmesg lines are formatted differently than mine. Try this version.
p910nd-start.gz
Description 
gz

 Download 
Filename  p910nd-start.gz 
Filesize  196 Bytes 
Downloaded  430 Time(s) 
Back to top
View user's profile Send_private_message 
DanielV

Joined: 03 Mar 2011
Posts: 17
Location: Czech Republic

PostPosted: Sat 05 Mar 2011, 17:55    Post_subject: Tomorrow definitely  

Thanks for your interest.

You are real enthusiast. Greetings from Czech Republic. I will try tomorrow.
Back to top
View user's profile Send_private_message 
DanielV

Joined: 03 Mar 2011
Posts: 17
Location: Czech Republic

PostPosted: Sun 06 Mar 2011, 14:02    Post_subject: Tried today  

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?
Script_post-boot.PNG
 Description   
 Filesize   19.97 KB
 Viewed   1711 Time(s)

Script_post-boot.PNG

System Log_2.zip
Description 
zip

 Download 
Filename  System Log_2.zip 
Filesize  88.17 KB 
Downloaded  251 Time(s) 
Back to top
View user's profile Send_private_message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9162
Location: Stratford, Ontario

PostPosted: Sun 06 Mar 2011, 14:21    Post_subject:  

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:
killall p910nd
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0884s ][ Queries: 13 (0.0045s) ][ GZIP on ]