Troubleshooting printers

From LQWiki
Jump to: navigation, search

Note on basics

Cables, paper and power: I didn't think I needed to say this but after confusing my card reader USB cable with my printer USB cable I decided to put in a note about checking the basics.

testing with cat

If the printer is connected directly to a computer you can test the printer and the cable by sending data directly to device file corresponding to the port.

If this works with a three page document then it's probably safe to assume the hardware is working. If the printer only prints the first page of a multipage document then check driver options, the cable or BIOS settings.

Example using the first parallel port:

root# cat test.txt > /dev/lp0

Example using any port:

root# echo "this is a test" > text.txt
root# lp text.txt

Most printers sold today will not take plain text files and a printer specific file must be created. Read the documentation and manpages for the file or filter you are using. It is helpful to make a one line shell script to contain all the options for your filter. For my printer I have one line (that wraps) in a file. The gs command is used to convert the postscript file to a raw intermediate file that is then interpretted by the min12xxw filter program to create a file in the secret minolta language.

Note it is a single line. Redirecting the postscript file into the pstomin shell script creates file.min which should be renamed to avoid overwriting.

One line shell script for a Minolta Pagepro 1350W:

root# cat pstomin
gs -q -dBATCH -dSAFER -dQUIET  -dNOPAUSE  -sPAPERSIZE=letter  -r1200<br> -sDEVICE=pbmraw -sOutputFile=- -| min12xxw -r 1200 > file.min
root# ./pstomin < threepage.ps
root# mv file.min threepage.min
root# cat threepage.min > /dev/lp0

Make sure you check the options by reading the documentation for the driver, a README file, man page or comments in the source code. In my example I specified the paper size in ghostscript but not for the min12xxw filter which caused my printer to jam.

Options can also change when installing a new version. E.g. the newer version of this driver has an option for specifying the model instead of changing the source code.

Parallel ports

Because most computers have a single parallel port your Linux distribution most likely installed it as the file /dev/lp0. The kernel modules parport, parport-pc and lp (character device) are required.

The original parallel ports were rather simple unidirectional ports. They are fine for dot matrix printers and probably work with PCL and Postscript printers however chances are you don't have one of these on your computer unless your parallel port is from the early 1980's.

The bidirectional ports allow the device to send data back to the printer and our higher speed. Modern computers usually have a setting in the BIOS that allows switching of the port mode.

  • SPP is the older slower style.
  • EPP is intended for non-printing devices like scanners.
  • ECP is intended for printers. Most "Windows" printers use this.

With only a printer connected to your parallel port try ECP first. If you have a printer and scanner connected to the same port you can try ECP/EPP.

If a cable does not say IEEE1284 then you can probably assume it is intended for unidirectional communication and will not work with many printers.

If your cable works with one printer and not another then it could be that the cable is not intended for higher speeds.

If the parport module is installed (use lsmod to check) then software is probably not an issue.

USB ports

The method above for sending a file to a parallel port can be used to send a file to a usb port. If you only have one printer the port is most likely /dev/usb/lp0.

Here is an example. pstomin is a little one line shell script for my printer. Your command line will be different. It is a single line.

Example:

jjm@debian:~$ cat pstomin
gs -q -dBATCH -dSAFER -dQUIET  -dNOPAUSE  -sPAPERSIZE=letter  -r1200 -sDEVICE=pbmraw -sOutputFile=- -| min12xxw -r 1200 > file.min
jjm@debian:~$ ./pstomin < resume3.ps
jjm@debian:~$ mv file.min file3.min
mv: overwrite `file3.min', overriding mode 0644? y
jjm@debian:~$ cat file3.min > /dev/usb/lp0

Try it as root and check permissions on /dev/usb/lp0 if it doesn't work at all.

Make sure you are sending the kind of file you need for your printer. Many of todays printers will not take a plain text file.

USB ports - Alternate Printer Solution

A Parallel to USB converter may be a stop-gap solution for USB printer woes. This would be an adapter, or converter box, that hooks to the parallel port and allows your computer to use the parallel port for printing by converting the output to USB. Thus eliminating device issues, as long as you use the proper printer language/protocols.

(See Also: LPT2USB Converter or RS232/Parallel to USB Converter - Not A Product Endorsement)

Serial ports

You can cat a file to a serial port just like with a parallel or usb port. Printers with a serial connection usually use an add on card. Check to see if it is properly installed. You may have to remove a cover plate or the entire case of the printer to get to the card. Check dip switches. Many serial cables are wired for specific applications and may not be the proper cable for your printer.

Print Servers

The term print server car refer to a regular computer that routes jobs to one or more printers over a network or a little box with connections for the printer, usually a parallel port, and the network. Using the same cable used for the print server connect the printer to a pc to test the cable and printer. A print server may be integrated into a printer permanently or as an add on card. Usually there will be another kind of connector, e.g. parallel or usb, that can be connected directly to a computer for testing. A printer menu setting or dip switch may have to be changed.


See also