Printer parallel port problem
Hello,
I am new to Linux so I have a lot of doubts every time I want to do anything. Linxquestions.org has been of great help to solve many ot these doubts. Therefore I would like to begin my post by writing a big thanks to all the contributors here. Now I am stuck with the following problem. System debian 4.4.5-8. (I know is very old but is used in a industrial pc with an specific program and I cannot update it) I want to print a file by sending it directly to the printer by using the command cat. Printer is connected to the parallel port and is a small lable printer model micra. When I type cat Eti.prn > /dev/lp0 The prompt blinks and nothing happens. I have to type ctrl C to be able to type more commands. If I send the file from the terminal where the industrial program is running the printer prints the label perfectly well therefore I disregard any problem related to cables, printer settings or syntax in the file. I have checked permissions and are as follows: crw-rw---- 1 root lp 6, 0 jan 11 14:03 /dev/lp0 ( /dev/lp0 in yellow ) I log in as root I would like to understand why is not working command cat so any hints to troubleshoot this will be welcome. |
Welcome to LinuxQuestions.org. First question - Are you sure that /dev/lp0 is the correct device node for communicating with the printer?
|
Thank you for answering.
No. I’m not sure. In /dev Only find lp0 and parport0 as possible names for the parallel port. How could I find it for sure? Please note that I am really new to linux so maybe I am missing very elementary things! |
Quote:
When CUPS has been setup correctly you print by using the command lp (or optionally lpr) instead of accessing the printer directly. See the man page, but what does Code:
lp Eti.prn It could also be possible that your industrial program contains its own printing subsystem and has an exclusive lock ON the device file. |
Quote:
-bash: lpr: command not found or -bash: lp: command not found does this means that CUPS is not installed? Quote:
|
Check /var/spool/lpd. Is there a lock file? (eg lpd.lock)
|
Quote:
|
Quote:
ls /var gives: log run |
Then I guess we can exclude the device file lock (unless there's something I'm missing here).
You mentioned Quote:
A long shot, but is the printer enumerated via the following? Code:
cat /proc/sys/dev/parport/parport*/autoprobe* |
I forgot that you had mentioned that when the file is sent via the application, it prints ok. I'm speculating that perhaps it sends a command to actually invoke the printing. You may be able to examine the file (hex editor?), and perhaps check the commands contained in it. Do you have access to a user manual (with label printer commands) for the printer in question?
|
Quote:
Code:
cat /proc/sys/dev/parport/parport*/autoprobe* Quote:
Quote:
I´ve checked the .prn file opening it in notepad ++ and seems to follow all the rules the manual indicates. |
Just to make sure the file Eti.prn is ok, I used al old pc with xp and parallel port and from DOS
Code:
copy eti.prn lpt1: Therefore, I am sure the printer understands Eti.prn |
My parallel port printers died many years ago and I don't remember where I put my parallel port loop back connector so I can't confirm if everything still works anymore. However, just as a frame of reference the same thing happens when I try catting a file to an unconnected printer port i.e the command "hangs" until I cancel via ctrl-c. All my autoprobe are empty too but the irq is 7 which is valid for lp0 and the devices sub directory does contain active.
Do you have more then one printer port on your industrial computer? Are you sure you are using the correct printer device? |
Quote:
The computer has only one physical parallel port. Besides, there are serial ports, usb ports, ... Quote:
By the way, I cat to /dev/lp0 Could it be possible that this parallel connector appears in linux in any other directory ? For me it is important to learn how the printing process works and how to troubleshoot it. |
Quote:
1) Examine kernel outut relating to a parport or similar... Code:
dmesg ¦ grep par Code:
dmesg| egrep "par|lp" Code:
ls -l /proc/sys/dev/parport/parport*/autoprobe* Code:
cat /proc/sys/dev/parport/parport*/autoprobe* Code:
sudo cat /proc/sys/dev/parport/parport*/autoprobe* Code:
lpinfo -v |
All times are GMT -5. The time now is 06:04 PM. |