Solved

Linux printing

Posted on 1998-02-15
16
276 Views
Last Modified: 2010-04-22
New, question...

I am having trouble 'cat'ing a file to my printer, and hence can't print anything. I believe my trouble is fundamental problems with the port, I am not looking at deamons or anything yet, I shall get on to that when I can cat to the port.

My printer port is parallel.
My printer is on /dev/lp2.

If I use "tunelp /dev/lp2 -s" I get the following message:
"Status is 95, busy, on-line".

The printer is on-line, but I do not believe it is busy. The busy light is certainly not flashing.

There is nothing on lpq, "no entries"

If I "cat testfile > /dev/lp2" the session hangs and I must use control C to get the promt back.

Please help !!!! Have I got a spool file knocking around blocking up the port ? I don't know...
0
Comment
Question by:covellc
  • 7
  • 5
  • 3
  • +1
16 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1636029
Have you enabled a second printer port in the kernel?
Pleas check in /proc/{devices,interrupts}
0
 

Expert Comment

by:spjuver
ID: 1636030
First thing to check when parallel/serial ports don't like you:
Do you have any other hardware which uses IRQ 3,4,5 or 7??

Soundcard and LAN-cards sometimes like to uses one of these IRQ's.

The command tunelp find the printer but it is busy (weird). The 'cat' command hangs. Sounds like IRQ messup for me...
0
 

Author Comment

by:covellc
ID: 1636031
This sounds as though we are heading down the right track !!!

Of course my next question is how can i tell through Linux what irq settings my hardware is using ! I am at work at the moment and shall be looking at this problem at home tonite so a pointer would be great...
0
 

Expert Comment

by:spjuver
ID: 1636032
A general question...
Linux will figure out which IRQ you are using if you have compiled in support for that hardware.
Ther problem is not that linux not find your irq. The problem is the actual overlap of irq's.

You have to write down on a piece of paper which irq which port have and which irq which card have. A printer and a modem don't really like share the irqs. The same with sound cards. If it is possible move around irqs on the cards. If it is not possible to change irq on your card and you really have modems and printers etc on your ports. You have hit a hardware limitation in the PC-world...

The multi-port cards usually just steele one irq  and share it with many ports. Maybe an idea??

Anyway to find the irq-settings your kernel have will you find by surf'n around in /proc jungle. cat the irq files there....
Depening of which kernel version as later as better.
0
 

Author Comment

by:covellc
ID: 1636033
If I cat /proc/interrupts I get the following:

0:       timer
1:       keyboard
2:       cascade
3:      +serial
13:       math error
14:       ide0
15:       ide1

no lp or parrallel......

I have got a sound card, so I have removed it, but to no avail.

Any other ideas ?
0
 

Expert Comment

by:spjuver
ID: 1636034
You are missing something there. Do you have lp as module??

If you have, what happens if you write 'modprobe lp'.
How does the /proc/interrupts looks like when you cat your file to the lp device??
0
 
LVL 2

Expert Comment

by:jeffa072897
ID: 1636035
Have you watched the system boot? If you have printer support
compiled in, not as a module, you should see the kernel recognize all your printer port(s).
You can also pipe dmesg into more (dmesg|more) to review the bootup.
You say the printer is on /dev/lp2, what is on /dev/lp1 and /dev/lp0?.
If you have lp as a module try insmod lp and see if the irq shows up in use and/or the printer starts working. If it does check your kernel config for the auto module load support.
0
 

Author Comment

by:covellc
ID: 1636036
Sorry to be such a pain, but I really do appreciate you time...

I did have lp loaded as a module, but I also believe I have it loaded in the kernle !!! dmesg showed two lots of lp1 and lp2 !!
I have removed the module entry from the rc.modules file. Rebooted and now there is only one entry for lp1 and lp2 in dmesg.

Now if I cat proc/interrupts I have an extra interrupt

4:      +serial

This is in addition to the interrupts mentioned in my last comment.

If I try and tunelp /dev/lp2 -s while catting my file I get the message /dev/lp2 Device or resource busy

If I turn the printer off and tunelp I get:

status 79, busy while it is turning off, and

status is 135, ready, error when it is turned off.

The status of /dev/lp1 is 200.

What next ?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:covellc
ID: 1636037
I am crap ! The 'extra' serial interupt is the modem, I was online while writing the last comment, oops.
0
 

Expert Comment

by:spjuver
ID: 1636038
Don't care about the serial ports lp-ports is parallel.

I think that you have to clean out every possibility for interference.

Remove every possible card wich use irq 5 or 7 (incl PnP).
Make sure that lp is compiled in the kernel and remove all lp modules.
Put an '/bin/sh' entry in the end of your /etc/rc.d/rc.sysinit file.

Reboot and cat your favorite file to the /dev/lpx device.

If it works then you have an interference somewhere.
If it not works, then you have an interface/driver problem.

If you get the file correctly on your printer. You have to put back things and use tunelp to check. Begin with starting of certain daemons.
Still works? put the most suspected card back first then reboot.

This is an efficient way but demands a lot of time....


0
 

Author Comment

by:covellc
ID: 1636039
The latest word...

Right, I have done all you said. I have pulled all the cards. I have changed the device to /dev/lp1 on the card. I have cut loads of stuff out of my rc. files...

I was not sure how to check for lp in the kernel, but what I have found is...

When I boot there is no lp in /proc/devices.

If I do a tunelp then the device lp appears in /proc/devices but it is set to polling.

On boot up there is no entry in /proc/ioports but if I tunelp to use irq 5 it appears. Also it appears in /proc/interrupts on irq 5.

I seem to be winning, BUT cat still hangs when I cat a file to /dev/lp1

So, your last comment says it looks as though I have an interface/driver problem. Any ideas.

PS spjuver reply with a propper answer so I can give you some points (better still, reply to my old outstanding question so I can give you the points !!!!)
0
 
LVL 2

Expert Comment

by:jeffa072897
ID: 1636040
Double check on your system which IO buss the parallel port is  on ISA or PCI.
Then, in your BIOS there should be a place to setup your PCI bus interrupts. Often this is set for automatic. Make it manual and do not give irq's 5 and 7 to the PCI bus. That way the parallel port should be guarenteed of the correct irq so the linux driver should work.
If your parallel port is on an ISA card this is imperative to getting it to work.
0
 

Author Comment

by:covellc
ID: 1636041
Hooray, I have finally got the printer to print.

Yes, it seems as though I had to wade through the bios setup and manually set the printer address. I have also now moved the printer to the on board parallel port instead of the one on the serial card.

Many thanks to jeffa and spjuver. I have learnt loads about the /proc directory in the last week thanks again.

I want to give you both points, so i need you to answer the question instead of just commenting, please can one of you answer this one and the other my other question, so I can assign the points !

Cheers

Chris...
0
 

Expert Comment

by:spjuver
ID: 1636042
I'm not interested in the points just happy that everything is working for you...
jeffa, go ahead.
0
 
LVL 2

Accepted Solution

by:
jeffa072897 earned 150 total points
ID: 1636043
covellc;

If you would please accept this as an answer then the points get distributed.

Thanks, spjuver for your comment.

jeffa
0
 

Author Comment

by:covellc
ID: 1636044
Thanks again for spending so much time on this question, I really appreciate it.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now