---

Improving the GNU/Linux print support

[ Thanks to Kurt
Pfeifle
for this announcement: ]

Call For Support:

Collection Of Valid PJL Commands For All Printers By
“Linuxprinting.org”

Every user with a printer can help to achieve a better Linux
print support. Wanna help out?

PJL And The Linuxprinting Database

You are asked to help fill the Linuxprinting.org Database with
valid pieces of info concerning the PJL commands understood by your
printer. Every user with a printer connected to a parallel or USB
port can help to achieve a better Linux support for his printer (if
not working perfectly already).

The Database has been built and accumulated by Grant Taylor, the
well-known author of the Linux Printing
HOWTO
for quite some time. It is a key for the achievement
of one (or some?) hi class Free printing system(s) for Linux. For
quite a few printers the data about working PJL commands are still
very incomplete. The quicker and the more precise this gap is
filled the more profound and rapid the Linux support for modern
printers in a Linux environment (and, in fact, amongst other Free
Unix-like operating systems as well as non-Free ones) will develop
in the months ahead. The database is not just of a huge advantage
for CUPS — other printing and spooling systems will also benefit a
lot, like BSD-LPD, LPRng or PDQ.

On the backgrounds and workings of this database you might want
to read a bit in my (so far German-only) “CUPS-FAQ”. If there is
comcern, I could do a translation of a more detailed explanation of
this action also comprehensible for newbies. (Hello, you editors of
printed magazines: isn’t this a good story for you as well? The
author’s fee I’ll donate to a free software project… 😉

This here is just a short shot.

A Shell Script To Read The PJL Capabilities Off The
Printer

Keying in the PJL info for thousands of printers off the
vendor’s documentation is very tiring and error-prone. Is this docu
available at all? Is it complete? Is it correct? — There’s a
better way to find out, with your help: ask you
printer directly, what it supports… Till
Kamppeter
, architect and maintainer of the new Mandrake
7.2 printing system which chose CUPS to be the premium install
(Till is also author of the free GUI Tool for CUPS, XPP),
has presented a small shell script to help you do the job. Every
Linux (and maybe, BSD) supporter can use it to ask his printer(s)
about their level of PJL support. The results will go into the
database which is designed to become the repository of automatic
driver and printer configuration files for the major spooling
systems CUPS, LPD, LPRng and PDQ.

Just copy the 6 line shell script beneath, save it with an easy
to remember name of your joice and mak it executable:

   #!/bin/sh
   echo "Writing PJL options into opts.txt"
   echo -en "33%-12345X@PJLrn@PJL INFO VARIABLESrn" > /dev/lp0
   sleep 1
   echo "Press Ctrl+C"
   cat < /dev/lp0 > opts.txt

I’ll outline in a minute, how the script works. Before that, here’s
what I did: hopefully usefull for any newbie volunteers wanting to
help collect the data…

  • The script on my box is called get_pjl_info.sh and
    I’ve located it in my home directory.
  • Using chmod a+x get_pjl_info.sh I made it an
    executable.
  • Typing ./get_pjl_info.sh I can launch it from my home
    direcory.

What The Shell Script Needs

To be sucessful, a few preconditions must be met:

  • Connect a printer to a parallel port of your PC.
  • Use a not too ancient cable supporting bi-directional
    communication.
  • Make sure in Bios the bi-di communication isn’t disabled.
  • You nust be root to run the script.
  • Your Kernel needs parallel port support activated.

The last item may be available as a loadable module if it is not
already coming up at boot time. [“What’s the point of telling
this?”, some may ask, “those with no active parallel port, won’t
have a parallel printer anyway and can’t help with the test.” —
Hold on. As neither Till nor myself do know at the moment how to
conduct the sort of needed bi-di communication over the ethernet,
we’ll ask the volunteers with access to networked printers to
connect to the paralell port for a moment. I had to find out things
myself, when I borrowed my bosses’ HP LaserJet 5L from his desk
(it’s Sunday today and he’s not in 😉 to run the test myself…]

So — reload modules if needed:

   root@espprintpro:/home/kurt > modprobe parport_pc
   root@espprintpro:/home/kurt > modprobe printer

Check the results:

   root@espprintpro:/home/kurt > lsmod

Does it show up entries like parport_pc, parport,
printer, und lp ? OK, you’re nearly done…

If you use an USB-connected printer the script needs a slight
modification. Instead of /dev/lp0 insert
/dev/usb/lp0 at two places. And of course your Kernel
needs to support USB. You might need to load the USB module:

   root@espprintpro:/home/kurt > modprobe usbcore

How The Shell Script Works

The script uses a PJL command to ask the printer about further
PJL commands it understands and supports. If there is communication
at all, the script writes every retransmission of the printer into
the file opts.txt. If the script doesn’t stop after the
printer finished responding, just use STRG + C to abort
it. Now have a look into the harvested file: you may have some
readable output in there. If it is empty, there was no answer from
the printer. If additionally the printer prints something, it does
understand ASCII.

Before you test your next printer please re-name the file
opts.txt to some name you can easily associate with your
first printer; that way you avoid it to become overwritten .

   root@espprintpro:/home/kurt > mv opts.txt HP_LaserJet_5L_opts.txt.

Till collects all renamed and non-empty opts.txt-files:

   till.kamppeter@NOSPAM_gmx.net

Please take care to give an exact modell name of the printer. Till
will translate the results of your investigations as soon as
possible into new or updaed database entries. Every additional
entry will advance printing support of free software a little step
(not just CUPS, but also LPD, LPRng and PDQ!)

Till asked to run the script even if an old entry in the
linuxprinting datenbase says the printer in question doesn’t
support PJL; this info could be wrong. Also, existing entries in
the database could be incomplete.

Most existing entries concerning PJL have been typed in from
official vendor manuals. However, Till discovered using his script
about an undocumented, but supported and welcome behaviour of the
HP LaserJet 4050: this one changes its default language at the User
Display through a PJL command. This even dispite the fact, that
there is neither a possibility in one of the front panel menues for
this nor a hint in the Manual. But his script brought it to the
light and let him find out which command to use… Now watch out:
You soon might have even more options at your finger tips than your
colleague still enchained to a Windows box! And once there was a
time, that you was suffering from jealousy when you watched him
running the large office printer from his desktop using all the
printers bells and whistles? Never again.


Written by:
Kurt Pfeifle, author of the CUPS-FAQ
e-mail:
kpfeifle@NOSPAM_danka.de


More Infos:[Long URIs are there to have them on
paper (if you decided to print this page).]


Licensing of this document:
Copyright 2001 Kurt Pfeifle, author of CUPS-FAQ
e-mail:
kpfeifle@NOSPAM_danka.de
.

  • You may freely distribute and use this
    document. Give credit were it is due. Keep the author’s name if you
    don’t change it substantially. If you change something, indicate
    this fact properly.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis