Parallel port printing under 11.3

I have a Panasonic 3123 dot matrix printer which I am trying to get working on my Dell Vostro 420 running 11.3 (x64). Since Dell decided to eliminate on board parallel ports from their systems I’ve added one with a Startech PCI1PECP PCI card (uses a NETMOS NM9805CV chipset). I’ve confirmed that the printer works using an old laptop running Windows 2k with a LPT port running in ECP mode. When attached to my desktop the printer will (usually) shift the pin carriage etc when I perform a cold boot but will not respond when sent a test page in yast or cups (it is detected after a fashion and I have assigned the appropriate ppd from the Omni package). Any help or ideas on how I could get this working would be much appreciated.

The following is the relevant out put from lspci, lsmod and dmesg:

05:00.0 Communication controller: Device 1710:9805 (rev 01)
        Subsystem: LSI Logic / Symbios Logic Device 0010
        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR+ INTx-
        Interrupt: pin A routed to IRQ 14
        Region 0: I/O ports at 4400 [size=8]
        Region 1: I/O ports at 4080 [size=8]
        Region 2: I/O ports at 4000 [size=8]
        Region 3: I/O ports at 4480 [size=8]
        Region 4: I/O ports at d010 [size=8]
        Region 5: I/O ports at d000 [size=16]


~> lsmod | grep parport
parport_pc             37547  0 
parport                40384  2 ppdev,parport_pc
~> dmesg | grep parport
   14.949357] parport 0x4400 (WARNING): CTR: wrote 0x0c, read 0xff
   14.949362] parport 0x4400 (WARNING): DATA: wrote 0xaa, read 0xff
   14.949363] parport 0x4400: You gave this address, but there is probably no parallel port there!
   14.949375] parport0: PC-style at 0x4400 [PCSPP,TRISTATE]
~> dmesg | grep ppdev
   15.072161] ppdev: user-space parallel port driver
~> lsmod | grep ppdev
ppdev                  10072  0 
parport                40384  2 ppdev,parport_pc

And in case it might help, a sample of the entries in /var/logs/cups/error_log


E [28/Oct/2010:11:59:44 -0400] Unable to bind socket for address ::1:631 - Cannot assign requested address.
E [28/Oct/2010:12:05:04 -0400] Unable to bind socket for address ::1:631 - Cannot assign requested address.
E [28/Oct/2010:12:08:52 -0400] [cups-driverd] Skipping "/usr/share/ppd": loop detected!

[/size][/size][/size][/size][/size][/size]

On 2010-10-28 19:06, Nite 0wl wrote:

> Any help or ideas on how I could get this working
> would be much appreciated.

You could try «echo “hello world” > cat /dev/lpt» to see if the problem is the port or cups. Pin
printers should work that way.

If it does not work, look for messages in the boot log and /var/log/messages.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

  1. Does /dev/lp0 exist?
ls -l /dev/lp*
  1. You mentioned CUPS ‘detected after a fashion’ - have you tried redetecting/configuring via the CUPS web interface?

http://localhost:631/printers/

  1. Maybe worthwhile posting /etc/cups/printers.conf here. Specifically, we’re looking for a URI similar to ‘parallel:/dev/lp0’ in your printer config. Have a read of the ‘backends’ section of this guide:

SDB:CUPS in a Nutshell - openSUSE

/var/log/boot.msg contains this:

<6>   14.833697] input: HDA Digital PCBeep as /devices/pci0000:00/0000:00:1b.0/input/input8
<6>   14.949357] parport 0x4400 (WARNING): CTR: wrote 0x0c, read 0xff
<6>   14.949362] parport 0x4400 (WARNING): DATA: wrote 0xaa, read 0xff
<6>   14.949363] parport 0x4400: You gave this address, but there is probably no parallel port there!
<6>   14.949375] parport0: PC-style at 0x4400 [PCSPP,TRISTATE]
<6>   15.072161] ppdev: user-space parallel port driver

/var/log/messages shows

Oct 28 16:55:10 blackbird sudo:    uname : TTY=pts/0 ; PWD=/home/uname ; USER=root ; COMMAND=/bin/echo hello world /dev/lpt

when I try your suggested echo

crw-rw---- 1 root lp 6, 0 2010-10-28 12:08 /dev/lp0
  1. You mentioned CUPS ‘detected after a fashion’ - have you tried redetecting/configuring via the CUPS web interface?

I have tried the CUPS web interface, it gives essentially the same result as using the YaST Printers module. Detection recognises the existance of an lp0 but the model is “unknown” and the description is simply “LPT #1” or, in the web interface it simply prompts me to manually select the printer by manufacturer + model/ppd or directly selecting a ppd.

When trying to print a test page in both the CUPS web interface or through YaST /var/cups/error_log returns this:

E [28/Oct/2010:17:12:03 -0400] [cups-driverd] Skipping "/usr/share/ppd": loop detected!
E [28/Oct/2010:17:18:41 -0400] [cups-driverd] Skipping "/usr/share/ppd": loop detected!
E [28/Oct/2010:17:18:56 -0400] [cups-driverd] Skipping "/usr/share/ppd": loop detected!

  1. Maybe worthwhile posting /etc/cups/printers.conf here. Specifically, we’re looking for a URI similar to ‘parallel:/dev/lp0’ in your printer config.
# Printer configuration file for CUPS v1.4.4
# Written by cupsd on 2010-10-28 17:19
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<Printer kxp3123>
Info Panasonic KX-P3123 dot matrix, B&W, tractor feed
Location rm 3A desk
MakeModel Panasonic KX-P3123, CUPS + omni
DeviceURI parallel:/dev/lp0
State Idle
StateTime 1288284487
Type 12300
Filter application/vnd.cups-raw 0 -
Filter application/vnd.cups-raster 100 CUPSToOmni
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy abort-job
</Printer>
<DefaultPrinter Officejet_6300>
Info Officejet_6300
MakeModel HP Officejet 6300 Series, hpcups 3.10.2rc1.9
DeviceURI hp:/net/Officejet_6300_series?ip=10.1.15.10
State Idle
StateTime 1288225922
Type 36876
Filter application/vnd.cups-raw 0 -
Filter application/vnd.cups-raster 0 hpcups
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy abort-job                                                                                          
</Printer>    

I’ve included the full printers.conf even though I doubt that the entry for the OfficeJet 6310 is relevant.

It should be:


su -c 'echo "Hello" > /dev/lpt'

Doesn’t look like the hardware was detected. Do you know that this controller is supported?

On 2010-10-28 23:06, Nite 0wl wrote:
>
> robin_listas;2245357 Wrote:
>>
>> You could try «echo “hello world” > cat /dev/lpt» to see if the problem
>> is the port or cups. Pin printers should work that way.
>>
>> If it does not work, look for messages in the boot log and
>> /var/log/messages.
>>
>

You don’t say if the line was printed or not.

> /var/log/boot.msg contains this:
>
> Code:
> --------------------
> <6> 14.833697] input: HDA Digital PCBeep as /devices/pci0000:00/0000:00:1b.0/input/input8
> <6> 14.949357] parport 0x4400 (WARNING): CTR: wrote 0x0c, read 0xff
> <6> 14.949362] parport 0x4400 (WARNING): DATA: wrote 0xaa, read 0xff
> <6> 14.949363] parport 0x4400: You gave this address, but there is probably no parallel port there!

That’s the crux of the matter.

> <6> 14.949375] parport0: PC-style at 0x4400 [PCSPP,TRISTATE]
> <6> 15.072161] ppdev: user-space parallel port driver
> --------------------
>
>
> /var/log/messages shows
> Code:
> --------------------
> Oct 28 16:55:10 blackbird sudo: uname : TTY=pts/0 ; PWD=/home/uname ; USER=root ; COMMAND=/bin/echo hello world /dev/lpt
> --------------------
> when I try your suggested echo

Irrelevant.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

In case it helps, here is the output from the various backends:


# /usr/lib/cups/backend/parallel 
direct parallel:/dev/lp0 "unknown" "LPT #1" "" ""
# /usr/lib/cups/backend/lpd 
network lpd "Unknown" "LPD/LPR Host or Printer"
# /usr/lib/cups/backend/serial 
serial serial:/dev/ttyS0?baud=115200 "Unknown" "Serial Port #1"
# /usr/lib/cups/backend/scsi 
direct scsi "Unknown" "SCSI Printer"

As ken_yap and Carlos have already hinted, the issue may be whether your parallel card is supported by the drivers.

As a matter of interest, what is reported by

/sbin/lspci -nnk

(Just the section corresponding to the parallel card)

FWIW, reminds me of this old thread:

Parallel port on PCI card does not work

Since you asked: the relevant output of ‘lspci -nnk’


05:00.0 Communication controller [0780]: Device [1710:9805] (rev 01)
        Subsystem: LSI Logic / Symbios Logic Device [1000:0010]
        Flags: medium devsel, IRQ 14
        I/O ports at 4400 [size=8]
        I/O ports at 4080 [size=8]
        I/O ports at 4000 [size=8]
        I/O ports at 4480 [size=8]
        I/O ports at d010 [size=8]
        I/O ports at d000 [size=16]

[/size][/size][/size][/size][/size][/size]

I’m out of my depth here, but the parallel port addressing seems odd to me. It might be worth trying to reload the parport_pc driver and force the base io address:

modprobe -r parport_pc
modprobe parport_pc io=0x378

Then check the output of

dmeg|tail

While searching for possibly related threads, I dug up this old thread

Printing with Suse 10.0 on Parallel port

which mentions

Try to add line

options parport_pc io=0x378 io_hi=0x778 irq=7 dma=3

into /etc/modprobe.conf.local file.

to explicitly configure the parallel port at boot. Now, I’m not sure this is the solution to your problem, but it maybe worth a shot (assuming its only a driver config problem rather than with the driver/hardware itself).

If using openSUSE 11.3, there is a directory /etc/modprobe.d/, and one could create a file named ‘/etc/modprobe.d/25-parallel.conf’ for example with something like

options parport_pc io=0x378 io_hi=0x778 irq=7 dma=3

The 11.3 equivalent of /etc/modprobe.conf.local appears to be 00-system.conf which (at least on my x86_64 system) contains the following:

alias parport_lowlevel    parport_pc
# disable DMA for parallel port (bnc#180390)
options parport_pc dma=none
options parport_pc io=0x378,0x4400 irq=none,14
# If you have multiple parallel ports, specify them this way:
# options parport_pc io=0x378,0x278  irq=none,none
# options parport_pc io=0x4400 irq=14

Prior to starting this thread I had attempted variations on this including specifying 0x378 or 0x278 (traditional on system board parallel port addresses) as io, attempting to specify IRQs such as 7 (both of these methods only return errors about invalid addresses and reserved IRQs).

Using the line you suggested in /etc/modprobe.d/00-system.conf results in the following dmesg output:

dmesg | grep parport
   14.974546] parport 0x378 (WARNING): CTR: wrote 0x0c, read 0xff
   14.974550] parport 0x378 (WARNING): DATA: wrote 0xaa, read 0xff
   14.974552] parport 0x378: You gave this address, but there is probably no parallel port there!
   14.974564] parport0: PC-style at 0x378 [PCSPP,TRISTATE]
   15.059117] parport 0x4400 (WARNING): CTR: wrote 0x0c, read 0xff
   15.059127] parport 0x4400 (WARNING): DATA: wrote 0xaa, read 0xff
   15.059128] parport 0x4400: You gave this address, but there is probably no parallel port there!
   15.059141] parport1: PC-style at 0x4400, irq 0 [PCSPP,TRISTATE]
   15.059156] parport1: irq 0 in use, resorting to polled operation
  257.801863] lp0: using parport0 (polling).
  257.801898] lp1: using parport1 (polling).

From your dmesg output, it looks like you had both parport config lines active at the same time. Concentrating on the reported ports,

 Region 0: I/O ports at 4400 [size=8]
        Region 1: I/O ports at 4080 [size=8]
        Region 2: I/O ports at 4000 [size=8]
        Region 3: I/O ports at 4480 [size=8]
        Region 4: I/O ports at d010 [size=8]

maybe you could try configuring with the other addresses to see if you get a parallel port detected. You should be gettting dmesg output like

parport: PnPBIOS parport detected.
parport0: PC-style at 0x378 (0x778), irq 7, dma 3 [PCSPP,TRISTATE,COMPAT,ECP,DMA]

with the appropriate addresses for your card (if supported by parport_pc driver of course).[/size][/size][/size][/size][/size]

Having now tried every combination and variation of the reported io addresses with all possible combinations of irq (explicit from lspci report. none, auto) with no success or appearant change I am giving up on this particular card and will be taking it in for return tomorrow. Can anyone suggest a PCI or PCIe X1 card that they have used successfully in the past? Or perhaps a Centronix-to-USB cable if anyone has used them successfully with an older Panasonic KP-X series printer (ie 3123, 2123).

Finally got it working using the Sabrent USB-to-Centronics cable metioned elsewhere on this forum. The KX-P3123 driver provided by Omni suffers frequent stop errors after the first page and spaces things unevenly. Luckilly the KX-P2123 driver from Foomatic seems to work well for now, although both seem to treat the output as bit images rather than simple character streams.

Thanks for the update Nite_Owl.

Luckilly the KX-P2123 driver from Foomatic seems to work well for now, although both seem to treat the output as bit images rather than simple character streams.

For direct text printing, you might find this page useful:

Printer: Epson Dot Matrix | OpenPrinting - The Linux Foundation

Possibly relevant as well (Mac OSX but still CUPS):

http://www.epson.co.uk/Printers-and-All-In-Ones/Dot-Matrix/Epson-LQ-300+/Drivers-Support?target=article&extn=.html&articleId=1193

On 2010-11-04 22:36, Nite 0wl wrote:

> although both seem to treat the output as bit images rather
> than simple character streams.

Well, that’s typical in Linux. Programs print as postscript and this is
converted to a raster image (or equivalent) in the printer language.
Windows does something equivalent (not with postscript, they us a GDI), but
they send graphics to the printer.

I think it is possible to send text as text with another driver, I read
about it somewhere.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)