Unable to get parallel printing working on Debian 2.6.26
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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'
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
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'
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:
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)
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.
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?)
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.