TODO item: Add info on USB printers

Juris Kaminskis juris.kaminskis at
Wed Oct 30 21:11:56 UTC 2013


Some first trial to create better coverage for USB printing support in
FreeBSD documentation. There are some more chapters to revise but this is
definetly one: Checking a Parallel and USB Printer

This section tells you how to check if FreeBSD can communicate with a
printer connected to a parallel or USB port.

To test a printer on a parallel port use /dev/lptN on a USB port use

Become root with su(1).

Send data to the printer.

If the printer can print plain text, then use lptest(1). Type:

# lptest > /dev/lptN

Where N is the number of the parallel port, starting from zero. For USB
port /dev/ulptN, N number identifies how many USB printers are connected,
if zero then one printer connected.

If the printer understands PostScript® or other printer language, then send
a small program to the printer. Type:

# cat > /dev/lptN

Then, line by line, type the program carefully as you cannot edit a line
once you have pressed RETURN or ENTER. When you have finished entering the
program, press CONTROL+D, or whatever your end of file key is.

Alternatively, you can put the program in a file and type:

# cat file > /dev/lptN

Where file is the name of the file containing the program you want to send
to the printer. Testing printers with special wire protocols

Many printers use different wire protocols instead of PostScript®. To test
communication create a file first in a format printer understands. Many
variants exist use Ghostscript and/or foo2zjs to convert PostScript® files.


HP Laserjet M1120 uses XQX protocol

Install foo2zjs port (includes foo2xqx)

Create a test PostScript® file (any decent program will print a PostScript®
file). Foo2xqx converts pbmraw file into xqx format, thus first
convert PostScript®
file to pbmraw format:

gs -sDEVICE=pbmraw -sOutputFile=YourFileName.pbm YourFile

And convert outputfile to xqx wire:

foo2xqx YourFileName.pbm > YourFileName.xqx

Last check if something prints:

cat YourFileName.xqx > /dev/ulptN

You should see something print. Do not worry if the text does not look
right; we will fix such things later.

Is there someone who can help me to review this and put into documentation?
After that I will take a look what else requires update to cover USB



More information about the freebsd-doc mailing list