LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-30-2009, 11:07 AM   #1
mrspaghetti
LQ Newbie
 
Registered: Aug 2009
Posts: 10

Rep: Reputation: 1
Unable to get parallel printing working on Debian 2.6.26


I have now spent days trying to get something working that all the documentation suggests is a breeze, so here I am begging for help.

I am running KDE on Debian with a custom kernel 2.6.26, and I have parallel port support compiled as a module (although I tried it first built-in to the kernel, also with no luck).

I downloaded & installed (via aptitude) printconf, cups, foomatics and all their assorted dependencies, but I could not get the printer to show up on any "add printer" lists either using the kde utilities printer manager or the web interface for CUPS - there is no option for a local printer of any kind (local is grayed out). Printconf -v also found no printers anywhere. There was no /dev/lp0 at all, but after reading a bunch of stuff on the internet I added the following to /etc/rc.local:

Code:
mknod -m 666 /dev/lp0 c 6 0
Now there is a /dev/lp0 and printconf -v seems to find the printer:

Code:
Getting printer information...
Autoconfiguring printers...
Printer database data:
{'autodetect': {u'general': {u'commandset': u'GDI',
                             u'manufacturer': u'Samsung',
                             u'model': u'ML-1430'}},
 'driver': u'gdi',
 u'drivers': [u'gdi'],
 u'functionality': u'A',
 u'id': u'Samsung-ML-1430',
 u'make': u'Samsung',
 u'model': u'ML-1430'}
Configuring Samsung ML-1430 on parallel:/dev/lp0 with gdi driver as queue
"ml1430_1".
Use of uninitialized value $ms in string eq at /usr/share/perl5/Foomatic/DB.pm line 2627.
Use of uninitialized value $ms in regexp compilation at /usr/share/perl5/Foomatic/DB.pm line 2627.

Skipping file:/dev/ttyS0; no autodetection data available.
Skipping file:/dev/ttyS1; no autodetection data available.
Skipping file:/dev/ttyS2; no autodetection data available.
Skipping file:/dev/ttyS3; no autodetection data available.
Reloading Common Unix Printing System: cupsd.
If printconf was unable to install all of your printers, please visit
http://www.linuxprinting.org/ for printer information and support from fellow
users.
I can now also find the printer using foomatic-gui and it seems to configure properly but I cannot print a test page. When I go into the kde control panel -> printers it still doesn't enable the "local/parallel/usb" option when I try to add a printer (it is still grayed out).

I've also tried the CUPS browser interface, but when I try to add a printer I get as far as the screen that asks you to choose a device from a dropdown menu, but I don't see anything on the dropdown that looks right. Here's the complete list of dropdown options:

Code:
AppSocket/HP JetDirect
Backend Error Handler
HP Fax (HPLIP)
HP Printer (HPLIP)
Internet Printing Protocol (http)
Internet Printing Protocol (ipp)
LPD/LPR Host or Printer
SCSI Printer
Windows Printer via SAMBA
Here's the relevant output of dmesg:

Code:
# dmesg | grep parport
[    9.199176] parport_pc 00:08: reported by Plug and Play ACPI
[    9.199260] parport0: PC-style at 0x378 (0x778), irq 7 [PCSPP,TRISTATE]
[    9.234582] parport0: Printer, Samsung ML-1430
In the bios I have the parallel port set for ECP/EPP and I've tried both "Auto" for IRQ and DMA settings with the same results for either. I've also tried ECP and EPP individually and tried assigning irqs and dma addresses in every combination. No luck no matter what I do there.

I have read the CUPS tutorial and documentation (plus a lot of other stuff) and I've tried installing a ppd file manually and a bunch of other stuff with the same results.

I am not new to Linux although I was away from it for several years. Back when I used it a lot I used to recompile kernels and modules and I had no problems getting a variety of weird hardware working the "hard" way (before any automagic installers, etc). It's hard to believe it's this much trouble to get something as simple as parallel port printing working.

Thanks in advance for any help. Please let me know of any other information you need me to post from any logs, etc.

-Lyle
 
Old 08-30-2009, 12:07 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,278

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
It may well be cups is out of step. Try 'gs -h' and have a guess at your printer driver. cd to the /usr/share/ghostscript/ <version>/examples directory. Switch on the printer, & load paper, set it online, etc. Now try

gs -dBATCH -dNOPAUSE -dSAFER -sDEVICE=ml600 -sOutputFile=/dev/lp0 chess.ps

Copy and paste that line exactly. (as you see, I guessed ml600 is close). If you get chess.ps which you can see by typing gs /usr/share/ghostscript/<version>/examples/chess.ps into an X terminal, well at least we have it down to cups. If it gives a couple of characters and spits the page out, stop it and switch off the printer. The driver is not compatible. You can of course try any of the other drivers that appear in 'gs -h'

I had _horrible_ problems with non postscript printers, and was the first maintainer of this thing
http://www.linuxfromscratch.org/hint.../files/pfs.txt

To sort cups - you are on your own. But you should check /etc/cups/cupsd.conf for these lines
Listen localhost:631
Listen /var/run/cups/cups.sock

Also see if you can make any sense of /var/log/cups/*. There is a debug option also which makes it more verbose.

Last edited by business_kid; 08-30-2009 at 12:09 PM. Reason: People might want to UNDERSTAND me!
 
Old 08-30-2009, 12:58 PM   #3
mrspaghetti
LQ Newbie
 
Registered: Aug 2009
Posts: 10

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by business_kid View Post
It may well be cups is out of step. Try 'gs -h' and have a guess at your printer driver. cd to the /usr/share/ghostscript/ <version>/examples directory. Switch on the printer, & load paper, set it online, etc. Now try

gs -dBATCH -dNOPAUSE -dSAFER -sDEVICE=ml600 -sOutputFile=/dev/lp0 chess.ps

Copy and paste that line exactly. (as you see, I guessed ml600 is close). If you get chess.ps which you can see by typing gs /usr/share/ghostscript/<version>/examples/chess.ps into an X terminal, well at least we have it down to cups. If it gives a couple of characters and spits the page out, stop it and switch off the printer. The driver is not compatible. You can of course try any of the other drivers that appear in 'gs -h'

I had _horrible_ problems with non postscript printers, and was the first maintainer of this thing
http://www.linuxfromscratch.org/hint.../files/pfs.txt

To sort cups - you are on your own. But you should check /etc/cups/cupsd.conf for these lines
Listen localhost:631
Listen /var/run/cups/cups.sock

Also see if you can make any sense of /var/log/cups/*. There is a debug option also which makes it more verbose.
Thanks for responding. Here's what I got with the exact line you have above:

Code:
# gs -dBATCH -dNOPAUSE -dSAFER -sDEVICE=ml600 -sOutputFile=/dev/lp0 chess.ps
GPL Ghostscript 8.62 (2008-02-29)
Copyright (C) 2008 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GPL Ghostscript 8.62: **** Could not open the file /dev/lp0 .
**** Unable to open the initial device, quitting.
Then just for grins I used gdi and got the following:

Code:
# gs -dBATCH -dNOPAUSE -dSAFER -sDEVICE=gdi -sOutputFile=/dev/lp0 chess.ps
GPL Ghostscript 8.62 (2008-02-29)
Copyright (C) 2008 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusRomNo9L-Regu font from /var/lib/defoma/gs.d/dirs/fonts/n021003l.pfb... 3149000 1425765 6516444 5221944 3 done.
GPL Ghostscript 8.62: **** Could not open the file /dev/lp0 .
Error: /invalidfileaccess in --showpage--
Operand stack:
   1   true
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1905   1   3   %oparray_pop   1904   1   3   %oparray_pop   1888   1   3   %oparray_pop   1771   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1777   0   4   %oparray_pop   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1153/1684(ro)(G)--   --dict:0/20(G)--   --dict:97/200(L)--   --dict:30/70(L)--
Current allocation mode is local
Last OS error: 6
Current file position is 61565
GPL Ghostscript 8.62: Unrecoverable error, exit code 1
Then I tried samsunggdi and got:

Code:
# gs -dBATCH -dNOPAUSE -dSAFER -sDEVICE=samsunggdi -sOutputFile=/dev/lp0 chess.ps
GPL Ghostscript 8.62 (2008-02-29)
Copyright (C) 2008 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusRomNo9L-Regu font from /var/lib/defoma/gs.d/dirs/fonts/n021003l.pfb... 3149000 1425765 6516444 5221944 3 done.
GPL Ghostscript 8.62: **** Could not open the file /dev/lp0 .
Error: /invalidfileaccess in --showpage--
Operand stack:
   1   true
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1905   1   3   %oparray_pop   1904   1   3   %oparray_pop   1888   1   3   %oparray_pop   1771   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1777   0   4   %oparray_pop   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1153/1684(ro)(G)--   --dict:0/20(G)--   --dict:97/200(L)--   --dict:30/70(L)--
Current allocation mode is local
Last OS error: 6
Current file position is 61565
GPL Ghostscript 8.62: Unrecoverable error, exit code 1
So it seems it cannot open /dev/lp0. But just to review, if I do ls /dev I see:

Code:
# ls /dev
adsp             hda2     mixer               shm       tty2   tty38  tty56           usbdev2.1_ep81  vcs4
agpgart          hdc      net                 snapshot  tty20  tty39  tty57           usbdev2.3_ep00  vcs5
audio            hdd      network_latency     snd       tty21  tty4   tty58           usbdev2.3_ep02  vcs6
bus              hpet     network_throughput  sndstat   tty22  tty40  tty59           usbdev2.3_ep81  vcs7
cdrom            initctl  null                stderr    tty23  tty41  tty6            usbdev3.1_ep00  vcsa
cdrw             input    parport0            stdin     tty24  tty42  tty60           usbdev3.1_ep81  vcsa1
console          kmem     pktcdvd             stdout    tty25  tty43  tty61           usbdev4.1_ep00  vcsa2
core             kmsg     port                tty       tty26  tty44  tty62           usbdev4.1_ep81  vcsa3
cpu              log      ppp                 tty0      tty27  tty45  tty63           usbdev5.1_ep00  vcsa4
cpu_dma_latency  loop0    psaux               tty1      tty28  tty46  tty7            usbdev5.1_ep81  vcsa5
disk             loop1    ptmx                tty10     tty29  tty47  tty8            usbdev6.1_ep00  vcsa6
dsp              loop2    pts                 tty11     tty3   tty48  tty9            usbdev6.1_ep81  vcsa7
dvd              loop3    random              tty12     tty30  tty49  ttyS0           usbdev7.1_ep00  xconsole
dvdrw            loop4    root                tty13     tty31  tty5   ttyS1           usbdev7.1_ep81  zero
fb0              loop5    rtc                 tty14     tty32  tty50  ttyS2           usbdev8.1_ep00
fd               loop6    rtc0                tty15     tty33  tty51  ttyS3           usbdev8.1_ep81
fd0              loop7    sda                 tty16     tty34  tty52  urandom         vcs
full             lp0      sda1                tty17     tty35  tty53  usbdev1.1_ep00  vcs1
hda              MAKEDEV  sequencer           tty18     tty36  tty54  usbdev1.1_ep81  vcs2
hda1             mem      sequencer2          tty19     tty37  tty55  usbdev2.1_ep00  vcs3
Although lp0 and parport0 only appear because I added the following in my /etc/rc.local file:

Code:
mknod -m 666 /dev/lp0 c 6 0
mknod -m 666 /dev/parport0 c 6 0
Any other ideas?

Thanks again for responding
-Lyle
 
Old 08-31-2009, 02:45 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,278

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
OK. Did you do that as root?
As for the Operand Stack and all the glorious nonsense gs fills your screen with, ignore every bit of it except the first line, in your case Error: /invalidfileaccess in --showpage--

Meaning it had a file access error where it was shoving the page.
To save you putting all that crap into a terminal, you can simply change the -sOutputFile argument to /tmp/printout. It should write a file. Then you can repeatedly send that

cat /tmp/printout > /dev/lp0

Also, from the stuff below (from /lib/udev/rules.d/50-udev.rules)

# printer
KERNEL=="parport[0-9]*", GROUP="lp"
SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp"
SUBSYSTEM=="usb", KERNEL=="lp*", NAME="usb/%k", SYMLINK+="usb%k", GROUP="lp"
KERNEL=="lp[0-9]*", GROUP="lp", SYMLINK+="par%n"
KERNEL=="irlpt[0-9]*", GROUP="lp"

It would appear that everything writing to the printer should be in group lp, or root. lusers were not able to use lp0 without that, IIRC.
 
Old 08-31-2009, 09:44 AM   #5
mrspaghetti
LQ Newbie
 
Registered: Aug 2009
Posts: 10

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by business_kid View Post
OK. Did you do that as root?
Yes.

Quote:
Originally Posted by business_kid View Post
Also, from the stuff below (from /lib/udev/rules.d/50-udev.rules)

# printer
KERNEL=="parport[0-9]*", GROUP="lp"
SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp"
SUBSYSTEM=="usb", KERNEL=="lp*", NAME="usb/%k", SYMLINK+="usb%k", GROUP="lp"
KERNEL=="lp[0-9]*", GROUP="lp", SYMLINK+="par%n"
KERNEL=="irlpt[0-9]*", GROUP="lp"

It would appear that everything writing to the printer should be in group lp, or root. lusers were not able to use lp0 without that, IIRC.
I actually don't have a 50-udev.rules file in /lib/udev/rules.d, but I went ahead and added myself to the lp group anyway and tried again with the same results.

Code:
$ gs -dBATCH -dNOPAUSE -dSAFER -sDEVICE=gdi -sOutputFile=/dev/lp0 chess.ps
GPL Ghostscript 8.62 (2008-02-29)
Copyright (C) 2008 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusRomNo9L-Regu font from /var/lib/defoma/gs.d/dirs/fonts/n021003l.pfb... 3149000 1425765 6516444 5221944 3 done.
GPL Ghostscript 8.62: **** Could not open the file /dev/lp0 .
Error: /invalidfileaccess in --showpage--
I have a feeling that somehow the printer really isn't "connected" to /dev/lp0. It troubles me that there's nothing in dmesg about lp0 anywhere, only parport0. In all the posts I've read about printing troubles, that doesn't seem to be the case, so it's got me scratching my head.
 
Old 08-31-2009, 10:37 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I have a feeling that somehow the printer really isn't "connected" to /dev/lp0
Do you have the parport module loaded?
Code:
lsmod | grep par
If nothing is listed modprobe parport then try again.
 
Old 08-31-2009, 11:41 AM   #7
mrspaghetti
LQ Newbie
 
Registered: Aug 2009
Posts: 10

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by tredegar View Post
Do you have the parport module loaded?
Code:
lsmod | grep par
If nothing is listed modprobe parport then try again.
Yes

Code:
# lsmod | grep par
parport_pc             23588  0
parport                33608  1 parport_pc
 
Old 08-31-2009, 11:53 AM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
My output is slightly different:
Code:
tred@vaio:~$ lsmod | grep par
parport_pc             36260  0
parport                37832  3 ppdev,parport_pc,lp
tred@vaio:~$
looks like you'll need lp as well and I don't know what ppdev is for.
You shouldn't have to go around creating device nodes in rc.local - I'd remove that bit of code you added, reboot, make sure the correct modules are loaded, then try plugging in your printer (You did check the cable?)
 
Old 08-31-2009, 06:49 PM   #9
mrspaghetti
LQ Newbie
 
Registered: Aug 2009
Posts: 10

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by tredegar View Post
My output is slightly different:
Code:
tred@vaio:~$ lsmod | grep par
parport_pc             36260  0
parport                37832  3 ppdev,parport_pc,lp
tred@vaio:~$
looks like you'll need lp as well and I don't know what ppdev is for.
You shouldn't have to go around creating device nodes in rc.local - I'd remove that bit of code you added, reboot, make sure the correct modules are loaded, then try plugging in your printer (You did check the cable?)
Eureka! I didn't realize there was, in addition to a parallel port support option, also a separate parallel printing option that had to be turned on when compiling the kernel. I did that and managed to get it working. For some reason it doesn't automatically load lp and ppdev, but I added them to /etc/modules, then just used the cups browser interface to delete the printer(s) I'd added before that weren't working, and let it "Find New Printers". Bingo!

Thanks so much for the help, I was really frustrated by this for the past few days.

-Lyle
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing in Slack 10.2 over parallel port rodm13 Linux - Hardware 5 11-16-2005 03:46 PM
help! printing - parallel port busy Steve Riley Ubuntu 1 08-17-2005 01:15 PM
straight-foward answer: printing through parallel port mrchaos Linux - Hardware 7 06-27-2005 04:38 PM
HP Laserjet Parallel printing, Fedora Core 2 LinuxFox Linux - Hardware 2 04-25-2005 12:23 PM
Parallel port printing in RH 8 Nerd2 Linux - Hardware 2 10-19-2003 07:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration