Difference between revisions of "Bering-uClibc 4.x - User Guide - Advanced Topics - Setting Up a Print Server"

From bering-uClibc
Jump to: navigation, search
(Created from http://leaf.sourceforge.net/doc/bup9100.html)
 
(Some corrections for 4.x)
 
Line 9: Line 9:
  
  
'''This material copied from http://leaf.sourceforge.net/doc/bup9100.html - needs to be checked/updated for Bering-uClibc 4.x!'''<br>I have made some cosmetic changes but not validated all the content.<br>[[User:Davidmbrooke|Davidmbrooke]] 11:43, 23 April 2011 (UTC)
+
'''This material copied from http://leaf.sourceforge.net/doc/bup9100.html with some amendments for Bering-uClibc 4.x'''<br>Please report any problems with the content. [[User:Davidmbrooke|Davidmbrooke]] 11:43, 23 April 2011 (UTC)
  
 
==Objectives==
 
==Objectives==
This chapter explains how to turn a Bering LEAF router into a print server using Nicholas Fong's p9100.lrp package. The p9100.lrp package provides raw socket printing on port 9100. HP has set port 9100 raw socket printing as a network de facto standard with its JetDirect printers. On Microsoft OS's - from Windows 2000 onwards - this appears as "Standard TCP/IP Port" printing.
+
This page explains how to turn a Bering LEAF router into a print server using the <code class="filename">p9100.lrp</code> Package. This package provides raw socket printing on TCP port 9100. HP has set port 9100 raw socket printing as a network de facto standard with its JetDirect printers. On Microsoft OS's - from Windows 2000 onwards - this appears as "Standard TCP/IP Port" printing.
  
 
You don't need me to tell you that shouldn't run a print server on a router.
 
You don't need me to tell you that shouldn't run a print server on a router.
Line 18: Line 18:
 
==Prerequisites==
 
==Prerequisites==
 
What you need:
 
What you need:
* A working [[Bering-uClibc 4.x]] router. It should be configured to a known working state before you go messing with print server configuration. Note that the [[Bering-uClibc 4.x]] kernel has printer and parallel port support compiled in already.
+
* A working [[Bering-uClibc 4.x]] router. It should be configured to a known working state before you go messing with print server configuration.
* Modules for printing and for driving the parallel port(s): <code class="filename">lp.ko</code>, <code class="filename">parport_pc.ko</code>, <code class="filename">parport.ko</code>
+
* Modules for printing and for driving the parallel port(s): <code class="filename">lp.ko</code>, <code class="filename">parport_pc.ko</code>, <code class="filename">parport.ko</code>. These are included in <code class="filename">modules.tgz</code>.
* A monitor and keyboard (attempting to do this headless can cause some problems on some motherboards)
+
* A monitor and keyboard (attempting to do this headless can cause some problems on some motherboards).
* A client machine that you can use to test printing across the network
+
* A client machine that you can use to test printing across the network.
  
 
Ensure hardware resources are available.
 
Ensure hardware resources are available.
Line 31: Line 31:
 
  cat /proc/interrupts
 
  cat /proc/interrupts
 
and make sure that the IRQs your ports will use are not already in use.
 
and make sure that the IRQs your ports will use are not already in use.
 
'''ToDo:''' does IRQ availability matter where extra ports are running on PCI cards? Also, does it matter in Bering p9100.lrp configurations, given that p9100.lrp seems to use polling instead of interrupt requests? See [http://sdb.suse.de/en/sdb/html/jsmeix_print-device-parallel.html here] for more on polling v interrupts). I have had success with both a motherboard parallel port and an add-on ISA parallel port both using IRQ 7. "Success" in this case means the system handled two print jobs simultaneously.
 
  
 
As a guide: within the BIOS, choose Normal or SPP if possible but EPP is known to work. DMA modes should not be chosen.
 
As a guide: within the BIOS, choose Normal or SPP if possible but EPP is known to work. DMA modes should not be chosen.
  
 
Resources available in the BIOS and Bering OS:
 
Resources available in the BIOS and Bering OS:
* lp0 (LPT1) is usually set to use IO address 0x378 and IRQ 7. OEM and older motherboards may use 0x3BC
+
* lp0 (LPT1) is usually set to use IO address 0x378 and IRQ 7. OEM and older motherboards may use 0x3BC.
* lp1 (LPT2) is usually set to use IO address 0x278 and IRQ 5
+
** This will be presented on TCP port 9100.
* lp2 (LPT3) setting recommendations seem to vary with your hardware
+
* lp1 (LPT2) is usually set to use IO address 0x278 and IRQ 5.
 +
** This will be presented on TCP port 9101.
 +
* lp2 (LPT3) setting recommendations seem to vary with your hardware.
 +
** This will be presented on TCP port 9102.
  
 
Clearly, lp1 - a likely second parallel port - is where IRQ conflicts are likely to occur with routers that have network cards using IRQ5
 
Clearly, lp1 - a likely second parallel port - is where IRQ conflicts are likely to occur with routers that have network cards using IRQ5
Line 48: Line 49:
  
 
==Configure the system to print==
 
==Configure the system to print==
Load the <code class="filename">p9100.lrp</code> Package by adding <tt>p9100</tt> to the list of packages called in the <code class="filename">leaf.cfg</code> file on the boot media.
+
===Packages===
 +
Load the <code class="filename">p9100.lrp</code> Package by adding <tt>p9100</tt> to the list of Packages specified in the <code class="filename">leaf.cfg</code> file on the boot media. There are no special dependencies for this Package.
  
 
Save the file and, if you had mounted the media, unmount it.
 
Save the file and, if you had mounted the media, unmount it.
  
Copy the three Modules <code class="filename">lp.ko</code>, <code class="filename">parport_pc.ko</code>, <code class="filename">parport.ko</code> to the <code class="filename">/lib/modules/</code> directory
+
===Modules===
 +
Copy the three Modules <code class="filename">lp.ko</code>, <code class="filename">parport_pc.ko</code>, <code class="filename">parport.ko</code> to the <code class="filename">/lib/modules/</code> directory.
  
To make sure the system calls them, add the following entries in <code class="filename">/etc/modules</code>
+
The "hardware" Modules <code class="filename">parport_pc.ko</code> and <code class="filename">parport.ko</code> should be loaded automatically at boot time provided they are present in the <code class="filename">/lib/modules/</code> directory, and they can therefore be installed by the "<tt>Find & load modules for hardware</tt>" option in the LEAF configuration menu.
parport
+
 
parport_pc
+
The remaining Module <code class="filename">lp.ko</code> is not a hardware device driver and so needs to be loaded with an explicit entry in <code class="filename">/etc/modules</code>. Simply add a line which says:
 
  lp
 
  lp
'''TODO:''' dMb to check whether this is still necessary with 4.x auto-loading
+
If this is done before running "<tt>Find & load modules for hardware</tt>" then file <code class="filename">lp.ko</code> will be automatically extracted from <code class="filename">modules.tgz</code> and copied to <code class="filename">/lib/modules/</code>.
 
+
You can get to <code class="filename">/etc/modules</code> via the Bering menu by choosing:
+
 
+
Packages Configuration | Modules | Modules
+
 
+
Save the changed file and quit out of the Bering menu. We also need to ensure there are sufficient printer and parallel interfaces for the system to use. From the command line, change directory to:
+
cd /var/lib/lrpkg
+
 
+
Edit the file root.dev.mk by issuing
+
edit root.dev.mk
+
'''TODO:''' This file does not even exist on 4.x
+
 
+
Check the file for the following lines:
+
(...)
+
mknod lp0 c 6 0 >null  2>&1
+
(...)
+
mknod par0 c 6 0 >null 2>&1
+
 
+
In the stock [[Bering-uClibc 4.x]] distro, you are likely to find lines setting up two lp nodes. Make sure you add the lines required to set up the "par" nodes.
+
 
+
If you need nodes for more than one printer and parallel port, add more nodes, incrementing the nodes as show below:
+
 
+
mknod lp1 c 6 1 >null  2>&1
+
mknod lp2 c 6 2 >null  2>&1
+
+
mknod par1  c 6 1 >null 2>&1
+
mknod par2  c 6 2 >null 2>&1
+
 
+
Save and quit the <code class="filename">root.dev.mk</code> file.
+
 
+
Set the appropriate permissions on these nodes by editing the <code class="filename">root.dev.mod</code> file, which is in the same <code class="filename">/var/lib/lrpkg/</code> directory.
+
  
To this file, add the following:
+
===Device files===
chmod 666  lp*  >null  2>&1
+
On [[Bering-uClibc 3.x]] and earlier device files like <code class="filename">/dev/lp0</code> were created by scripts such as <code class="filename">/var/lib/lrpkg/root/dev.mk</code>. This is no longer the case with [[Bering-uClibc 4.x]]; the device files are created automatically when Module "<tt>lp</tt>" is loaded.
chmod 640 par* >null  2>&1
+
  
Save and quit the <code class="filename">root.dev.mod</code> file.
+
===Firewall rules===
Set security to allow printing from remote machines you need to configure the Shorewall rules file to allow incoming print requests on ports 9100 through to 9102
+
If Shorewall is running you need to configure the Shorewall <code class="filename">rules</code> file to allow incoming print requests on TCP ports 9100 through to 9102 (depending on the number of printers connected).
  
From the Bering menu, select Packages Configuration, Shorewall, Rules
+
From the Bering menu, select Packages Configuration, Shorewall, Rules.
  
 
Assuming that you have one local interface in a zone called "loc" representing the internal network, add the following rule:
 
Assuming that you have one local interface in a zone called "loc" representing the internal network, add the following rule:
  ACCEPT loc     fw      tcp    9100:9102
+
  ACCEPT loc   fw      tcp    9100:9102
 +
If you only have one printer connected, and therefore only need port 9100, an alternative syntax using Shorewall's "<tt>Jetdirect</tt>" macro is:
 +
Jetdirect(ACCEPT)      loc    fw
  
 
Save and quit the file.
 
Save and quit the file.
  
You should not need to allow access to ports 9100 to 9102 in <code class="filename">/etc/hosts.allow</code> because the version of p9100 compiled in the <code class="filename">p9100.lrp</code> Package is not under TCPWrapper control. That is to say, p9100 runs in daemon mode, not from <code class="filename">inetd/inetd.conf</code>.
+
You should not need to allow access to ports 9100 to 9102 in <code class="filename">/etc/hosts.allow</code> because the version of p9100 compiled in the <code class="filename">p9100.lrp</code> Package is not under TCPWrapper control. That is to say, p9100 runs in daemon mode, not from <code class="filename">inetd/inetd.conf</code> and it is not separately configured to use the TCPWrapper library.
  
 
Having made all these changes, you need to back up the configuration and restart the system. In the Bering menu, save the configuration.
 
Having made all these changes, you need to back up the configuration and restart the system. In the Bering menu, save the configuration.
Line 115: Line 88:
  
 
Evidence that the system loaded the modules correctly includes lines similar to:
 
Evidence that the system loaded the modules correctly includes lines similar to:
  parport0 PC-style at 0x378
+
parport_pc 00:07: activated
parport0 irq7 detected
+
parport_pc 00:07: reported by Plug and Play ACPI
  lp0 using parport0 (polling)
+
  parport0: PC-style at 0x378 (0x778), irq 10 [PCSPP(,...)]
lp0 compatibility mode
+
  lp0: using parport0 (interrupt-driven).
  
 
These do vary a little from system to system so panic only if you see either nothing resembling parallel port messages or if you see distinct failure messages.
 
These do vary a little from system to system so panic only if you see either nothing resembling parallel port messages or if you see distinct failure messages.
  
 
The <code class="filename">p9100.lrp</code> Package runs a script on boot that prints details of the printers it thinks it can print to. You should see these messages in the boot output if <code class="filename">p9100.lrp</code> was loaded - though they are no guarantee that the system is working. They look like:
 
The <code class="filename">p9100.lrp</code> Package runs a script on boot that prints details of the printers it thinks it can print to. You should see these messages in the boot output if <code class="filename">p9100.lrp</code> was loaded - though they are no guarantee that the system is working. They look like:
  Starting print server LPT1 ready LPT2 ready LPT3 ready
+
  Starting print server lp0 ready
  
 
If the boot messages scroll up too quickly to read, you can use SHIFT+PAGE UP before you log in to the system to review it. Or you can log in, quit out of the Bering lrcfg menu and, at the command line, issue:
 
If the boot messages scroll up too quickly to read, you can use SHIFT+PAGE UP before you log in to the system to review it. Or you can log in, quit out of the Bering lrcfg menu and, at the command line, issue:
Line 196: Line 169:
 
   svi p910nd start
 
   svi p910nd start
  
Next, check to see if you have parport entries in the /proc filesystem (in other words, the system correctly created the nodes you configured in root.dev.mk and root.dev.mod). Issue:
+
Next, check to see if you have parport entries in the <code class="filename">/proc/</code> filesystem. Issue:
 
  find /proc/ -name 'parport*'
 
  find /proc/ -name 'parport*'
  
Line 226: Line 199:
 
  ps -ef | grep p910
 
  ps -ef | grep p910
  
Verify the daemon is bound to port 9100 (0x238C in hex - not to be confused with the io ports used by the parallel port)
+
Verify the daemon is bound to port 9100:
  cat /proc/net/tcp | grep -i 238C
+
  netstat -lt
  
The response on a working server looks something like this:
+
Look for a line like:
    0: 00000000:238C 00000000:0000 0A 00000000:00000000 00:00000000 00000000    0
+
tcp        0      0 :::9100                :::*                    LISTEN
0 5791 1 c3d8aa60 300 0 0 2 -1
+
  
 
Verify you can connect to that port from a remote client by issuing:
 
Verify you can connect to that port from a remote client by issuing:
Line 239: Line 211:
 
  nc 192.168.1.254 9100  < pcl.prn  (if you have a PCL language printer)
 
  nc 192.168.1.254 9100  < pcl.prn  (if you have a PCL language printer)
 
  nc 192.168.1.254 9100  < epson.prn  (if you have an Epson printer that uses the ESC/P2 language)
 
  nc 192.168.1.254 9100  < epson.prn  (if you have an Epson printer that uses the ESC/P2 language)
  nc 192.168.1.254 9100 < testing.ps  (if you have a postscript printer)
+
  nc 192.168.1.254 9100 < testing.ps  (if you have a postscript printer)
  
 
The Windows version of "nc" requires the user to type Ctrl-C when the file is "sent".
 
The Windows version of "nc" requires the user to type Ctrl-C when the file is "sent".
Line 267: Line 239:
  
 
Check that your client Standard TCP/IP printing port is connecting to the correct IP address and port number.
 
Check that your client Standard TCP/IP printing port is connecting to the correct IP address and port number.
9100 prints to /dev/lp0
+
* 9100 prints to <code class="filename">/dev/lp0</code>
9101 prints to /dev/lp1
+
* 9101 prints to <code class="filename">/dev/lp1</code>
9102 prints to /dev/lp2
+
* 9102 prints to <code class="filename">/dev/lp2</code>
  
Troubleshooting tips that don't seem work
+
===Troubleshooting tips that don't seem to work===
  
 
Although it would be handy to test the print server by printing from its own command line, this will likely not work:
 
Although it would be handy to test the print server by printing from its own command line, this will likely not work:

Latest revision as of 10:29, 24 April 2011

Advanced Topics - Setting Up a Print Server
Prev Bering-uClibc 4.x - User Guide Next


This material copied from http://leaf.sourceforge.net/doc/bup9100.html with some amendments for Bering-uClibc 4.x
Please report any problems with the content. Davidmbrooke 11:43, 23 April 2011 (UTC)

Objectives

This page explains how to turn a Bering LEAF router into a print server using the p9100.lrp Package. This package provides raw socket printing on TCP port 9100. HP has set port 9100 raw socket printing as a network de facto standard with its JetDirect printers. On Microsoft OS's - from Windows 2000 onwards - this appears as "Standard TCP/IP Port" printing.

You don't need me to tell you that shouldn't run a print server on a router.

Prerequisites

What you need:

  • A working Bering-uClibc 4.x router. It should be configured to a known working state before you go messing with print server configuration.
  • Modules for printing and for driving the parallel port(s): lp.ko, parport_pc.ko, parport.ko. These are included in modules.tgz.
  • A monitor and keyboard (attempting to do this headless can cause some problems on some motherboards).
  • A client machine that you can use to test printing across the network.

Ensure hardware resources are available.

Ensure you can answer the following questions:

  • Which printer port(s) do you plan to use?
  • Are their IRQs available in the system BIOS?
  • Are their IRQs available in Bering? To find out, run the command:
cat /proc/interrupts

and make sure that the IRQs your ports will use are not already in use.

As a guide: within the BIOS, choose Normal or SPP if possible but EPP is known to work. DMA modes should not be chosen.

Resources available in the BIOS and Bering OS:

  • lp0 (LPT1) is usually set to use IO address 0x378 and IRQ 7. OEM and older motherboards may use 0x3BC.
    • This will be presented on TCP port 9100.
  • lp1 (LPT2) is usually set to use IO address 0x278 and IRQ 5.
    • This will be presented on TCP port 9101.
  • lp2 (LPT3) setting recommendations seem to vary with your hardware.
    • This will be presented on TCP port 9102.

Clearly, lp1 - a likely second parallel port - is where IRQ conflicts are likely to occur with routers that have network cards using IRQ5

Also, you may find that add-on parallel port cards force changes to the priority of your printer ports. For example my BIOS puts LPT1 on IO address 0x378 and IRQ 7. The addon 508GE ISA parallel port card I put in itself becomes LPT1 but on IO address 0x3bc. I run both cards on the same IRQ of 7. The add-on card then becomes LPT1 (/dev/lp0) and is printed to via port 9100. The original motherboard parallel port becomes LPT2 (/dev/lp1) and is printed to via port 9101. Your mileage may vary so be prepared to experiment.

Make any changes to hardware that are necessary to avoid IRQ conflicts. Start the Bering system and check that everything is working as it should. If it is, you can move on to configuring printing.

Configure the system to print

Packages

Load the p9100.lrp Package by adding p9100 to the list of Packages specified in the leaf.cfg file on the boot media. There are no special dependencies for this Package.

Save the file and, if you had mounted the media, unmount it.

Modules

Copy the three Modules lp.ko, parport_pc.ko, parport.ko to the /lib/modules/ directory.

The "hardware" Modules parport_pc.ko and parport.ko should be loaded automatically at boot time provided they are present in the /lib/modules/ directory, and they can therefore be installed by the "Find & load modules for hardware" option in the LEAF configuration menu.

The remaining Module lp.ko is not a hardware device driver and so needs to be loaded with an explicit entry in /etc/modules. Simply add a line which says:

lp

If this is done before running "Find & load modules for hardware" then file lp.ko will be automatically extracted from modules.tgz and copied to /lib/modules/.

Device files

On Bering-uClibc 3.x and earlier device files like /dev/lp0 were created by scripts such as /var/lib/lrpkg/root/dev.mk. This is no longer the case with Bering-uClibc 4.x; the device files are created automatically when Module "lp" is loaded.

Firewall rules

If Shorewall is running you need to configure the Shorewall rules file to allow incoming print requests on TCP ports 9100 through to 9102 (depending on the number of printers connected).

From the Bering menu, select Packages Configuration, Shorewall, Rules.

Assuming that you have one local interface in a zone called "loc" representing the internal network, add the following rule:

ACCEPT  loc    fw      tcp     9100:9102

If you only have one printer connected, and therefore only need port 9100, an alternative syntax using Shorewall's "Jetdirect" macro is:

Jetdirect(ACCEPT)      loc     fw

Save and quit the file.

You should not need to allow access to ports 9100 to 9102 in /etc/hosts.allow because the version of p9100 compiled in the p9100.lrp Package is not under TCPWrapper control. That is to say, p9100 runs in daemon mode, not from inetd/inetd.conf and it is not separately configured to use the TCPWrapper library.

Having made all these changes, you need to back up the configuration and restart the system. In the Bering menu, save the configuration.

Test your setup

You can start initial testing when you reboot the machine after making the above changes.

As the system boots, you should look to see that it has loaded the two parport modules and the lp module and that the parport modules successfully bound to the parallel ports.

Evidence that the system loaded the modules correctly includes lines similar to:

parport_pc 00:07: activated
parport_pc 00:07: reported by Plug and Play ACPI
parport0: PC-style at 0x378 (0x778), irq 10 [PCSPP(,...)]
lp0: using parport0 (interrupt-driven).

These do vary a little from system to system so panic only if you see either nothing resembling parallel port messages or if you see distinct failure messages.

The p9100.lrp Package runs a script on boot that prints details of the printers it thinks it can print to. You should see these messages in the boot output if p9100.lrp was loaded - though they are no guarantee that the system is working. They look like:

Starting print server lp0 ready

If the boot messages scroll up too quickly to read, you can use SHIFT+PAGE UP before you log in to the system to review it. Or you can log in, quit out of the Bering lrcfg menu and, at the command line, issue:

dmesg | less

to scroll through the boot messages.

Assuming that all looks well after boot, and that you have logged in, and check that the printer service is running by quitting lrcfg to get to the command line and issuing:

ps -ef | grep p910

Check that you can stop it and start it by issuing

svi p910nd stop
svi p910nd start

Both commands should complete successfully. If not, move to the Troubleshooting section below.

There is no way to test if the machine can print from itself. You may see suggestions that it can using the command:

echo "test print" >/dev/lp0

But this command is likely to return the message

cannot create /dev/lp0: error 16

even on a machine that is known to be printing successfully when the print request is made from a remote client. To properly test the machine you need to print to it from a networked client.

Configuring clients to print

Nicholas Fong maintains an excellent Linux print server how-to that includes detailed instructions on configuring different client operating systems to print to raw socket printers.

Having set up the client, try to print to the server. If you get no print out, it's time to start troubleshooting.

Note that the second Standard TCP/IP printer you configure on a Microsoft 2000/XP may refuse to accept the printer port name and IP address that you specify (because they duplicate the first printer). Just give it a dummy name and continue. Go back after you are finished and change the IP address and port name to whatever values you want to give them. Make sure that you set the correct port number for the device you want to print to on the server.

Setting up Red Hat Linux 8 and 9 clients is easy. Presumably other Linux distros are as easy too, though these instructions have only been tested on Red Hat Linux 8 and 9.

Both Red Hat 8 and 9 have printing configuration applications in Gnome's Systems Settings menu. This tool makes printer set-up pretty much the same between the two versions even though Red Hat 8 used lpd as its default printing system while Red Hat 9 uses CUPS.

From the printing configuration tool, use the "Add" button to start the wizard that guides you through the rest of the setup. From there the steps are quite obvious but make sure you have selected JetDirect as the printing type, set the IP address of the Bering server as the printer "Name", and that you have selected the correct printer driver. You may need to experiment with printer drivers before you have success. This is because there may be several drivers available for each printer and because - in Red Hat's case at least - the printing configuration tool seems to need to have changes saved, be closed and reopened and the configuration checked before it truly saves the chosen driver.

Troubleshooting

(Mostly taken from Brad Fritz's tips to the LEAF mailing list)

First, work your way up the stack, starting with the hardware. Did boot complete successfully with no error messages and with the required hardware and modules being found? If not, the missing or failed element is likely to give you your strongest lead to the problem. A typical example might be signs of an IRQ conflict or that the parport modules report a different IRQ to the one you had previously configured hardware to use.

Nicholas Fong reports that some motherboards will prevent LPT1 from working if there is no monitor attached. He recommends:

Boot up with a monitor attached, after boot up, type ps ax and you should see:

/usr/sbin/p9100d

Boot up again without attaching the monitor, after boot up, attach a monitor and type ps ax if the /usr/sbin/p9100d disappears, if it does, you have one of those strange motherboards.

There is no cure. You need to change motherboard or add an ISA add-on multi-function IO card with a parallel port.

If you don't see any hardware or boot errors, continue to work up through the stack. Get to the command line and check that the modules are properly loaded by issuing:

lsmod | grep parport
lsmod | grep lp

You should see that the two parallel port modules and the lp module have been loaded.

If they don't, try manually loading them and examining the resources available with and without the modules loaded. Eg:

  # stop printing, remove drivers, and show irq/io state
  svi p910nd stop
  rmmod lp parport_pc parport
  cat /proc/interrupts
  cat /proc/ioports

  # insert drivers specifying irq/io, show irq/io state, start
  # print service, and test printing
  insmod parport
  insmod parport_pc io=0x378 irq=7
  insmod lp
  cat /proc/interrupts
  cat /proc/ioports
  svi p910nd start

Next, check to see if you have parport entries in the /proc/ filesystem. Issue:

find /proc/ -name 'parport*'

Verify you have a /dev/lp0 device by issuing:

ls -l /dev/lp*

On a single printer system, the output should look something like:

crw-rw----    1 root     lp         6,   0 Jun 13  2001 /dev/lp0

On a two-printer system, the output should look something like:

crw-rw----    1 root     lp         6,   0 Jun 13  2001 /dev/lp0
crw-rw----    1 root     lp         6,   1 Jun 13  2001 /dev/lp1

Check that the p9100 package did load. The messages you see from issuing:

svi p910nd stop

and

svi p910nd start

should confirm that the package did load.

Check that the p9100.lrp package found all the devices that you expect by issuing:

cat /var/log/syslog | less

and look for signs that the p9100 package found printer devices that you expected and - more likely - failed to find devices that it expected but which are not present. Eg, LPT3 is unlikely On a single printer server you will typically see a message here showing that /dev/lp1 was not configured.

Verify that the daemon is started by issuing:

svi p910nd stop; svi p910nd start

and

ps -ef | grep p910

Verify the daemon is bound to port 9100:

netstat -lt

Look for a line like:

tcp        0      0 :::9100                 :::*                    LISTEN

Verify you can connect to that port from a remote client by issuing:

nc 192.168.1.254 9100

or use the printer test files from Nicholas Fong's p9100test.zip file as shown below:

nc 192.168.1.254 9100  < pcl.prn  (if you have a PCL language printer)
nc 192.168.1.254 9100  < epson.prn  (if you have an Epson printer that uses the ESC/P2 language)
nc 192.168.1.254 9100  < testing.ps  (if you have a postscript printer)

The Windows version of "nc" requires the user to type Ctrl-C when the file is "sent".

If you have a full version of nc (e.g. Linux), replace above by:

nc -q2 192.168.1.254 9100 < pcl.prn  (if you have a PCL language printer)
nc -q2 192.168.1.254 9100 < epson.prn  (if you have an Epson printer that uses the ESC/P2 language)
nc -q2 192.168.1.254 9100 < testing.ps  (if you have a postscript printer)

ToDo: find out how to interpret the result of this command.

I get no response on my working server - does this mean that no response should mean that everything is OK. What would a "connection refused" message mean?

Run "tail -f /var/log/syslog" on the print server and then verify you can connect to port 9100 from the printing client with:

telnet 192.168.1.254 9100

If there is a problem, expect to see a "connection refused" message. If so, check that the port exists, that Shorewall's rules are letting it through and that the appropriate parallel port exists.

You should see syslog show a message like:

Apr 12 01:50:53 firewall p9100d: Connection from 192.168.2.1 port 1067

This is the p9100 package reporting a connection on its port 9100.

If you see this message, then while you are running tail on /var/log/syslog, try to print to the device from the remote client as you normally would. You should see the same message appear again.

Client-side

Check that your client Standard TCP/IP printing port is connecting to the correct IP address and port number.

  • 9100 prints to /dev/lp0
  • 9101 prints to /dev/lp1
  • 9102 prints to /dev/lp2

Troubleshooting tips that don't seem to work

Although it would be handy to test the print server by printing from its own command line, this will likely not work:

Try this from the print server:

echo -en "Hello\f" >/dev/lp0

If you see activity on the printer then that's good. But if you don't seen any activity then that is not necessarily bad. The only effective way to test the print server is to print to it from a remote client.

Further Information

For more on BIOS parallel port settings:



Prev Up Next