NAME

ppad-interfaces - PPR Printer Interface Programs


DESCRIPTION

PPR uses interface programs to communicate with printers. An interface is selecte with the ppad interface command. Its options are set with the ppad options command. Please see the the ppad.8 manpage manpage for details.

At the end of this document there is a discussion of various printer devices and the recomended interfaces.

These are the interfaces which are distributed with PPR:

simple

The interface simple is a shell script which sends the job to a Unix port. The address is the port name, such as /dev/lp0. It has no provision for setting baud rate or other port options as the serial interface can. By default, this interface uses the jobbreak method control-d, however, the method control-d/pjl is also suitable if the printer understands the HP PJL. See the ppad jobbreak command in the ppad(8) manpage. PostScript errors will not be detected when using this interface. If your printer is connected to the parallel port or the print spooling computer, you should probably use the newer parallel interface instead of the simple one.

serial

The interface serial sends the job to a serial port on the server. The address is the port name, such as /dev/ttyS00.

speed=
The ``speed='' option sets the baud rate. The default is 9600.

xonxoff=
The ``xonxoff='' option enables or disables XON/XOFF flow control. It is enabled by default. You should only disable XON/XOFF flow control if your serial port driver supports some other sort of flow control such as DTR/DSR or RTS/CTS flow control.

rtscts=
The ``rtscts='' option enables or disables RTS/CTS flow control (a form of hardware flow control).

bits=
The ``bits='' option sets the number of data bits. The possible settings are 7 and 8. Given a choice, you should choose eight bits. If you choose 7 bits, you should also use the ppad codes command and choose the 7BitClean option.

parity=
The ``parity='' option sets the parity checking mode. Many serial interfaces do not support parity checking with eight data bits so you will have to choose ``none'' in those cases.

online=
The ``online='' option can be used to tell how the interface program can determine if the printer is on line. The printer's on or off line state is determined by examining certain modem control lines. If this option is used, immediately after opening the serial port the interface will check that the indicated modem controls lines are in a state indicating readiness. If they are not, the interface will exit and PPR will place the printer in the state ``otherwise engaged or off-line'' for 60 seconds before trying again.

The default is ``online=dsr/cts'' which will work in many cases. Other options include ``dsr'', ``cts'', and ``none''.

For this feature to work, your printer must make at least one of its modem control lines go false when it is taken off-line and your null modem cable must feed this signal to one of the receiving modem control lines on the computer and you must indicate the correct receiving line as the value for the ``online='' option. Setting this up correctly may require the use of an RS-232 breakout box to determine if there is a line which goes false when the printer is offline.

detect_hangups=
If the option ``detect_hangups='' is ``true'', then the serial interface program will conclude that a printer fault has occured if the printer drops certain handshaking lines. These lines may include CTS, DSR, and CD, but the exact semantics are appearently operating system dependent. (Put another way, setting this option to true clears the POSIX CLOCAL hardware control flag.) The default for this option is false.

hangup_on_close=
If the option ``hangup_on_close='' is set to ``true'', then the DTR and RTS lines will be de-asserted. (Put another way, setting this option to true sets the POSIX HUPCL hardware control flag.) The default for this option is true.

idle_status_interval=
The option ``idle_status_interval='' will instruct the interface to send a control-T to the printer every so many seconds, though these transmissions will be delayed if there is data available to send. The control-T's will cause some printers to send back status messages which will be displayed by ppop status on an indented line under the queue status). If this option is set to 0, then no control-T's will be sent.

The default for this option is 15 if feedback is true and jobbreak is control-d or pjl, 0 otherwise.

The default options for the serial interface are expressed by the string ``speed=9600 xonxoff=yes rtscts=no bits=8 parity=none online=dsr/cts detect_hangups=false hangup_on_close=true idle_status_interval=0''.

By default, this interface uses the jobbreak method control-d, however, the method pjl is also suitable if the printer understands the HP PJL. See the ppad jobbreak section of this document.

parallel

This interface sends the print job to the parallel port specified in its address.

idle_status_interval=
Please see the description of serial for an explanation of this option.

status_interval=
The option ``status_interval='' sets the interval (in seconds) at which the interface will request the status of the printer as communicated through the parallel port status lines. The there are three status lines which report the conditions off-line, paper-out, and error. By default this option is set to 15.

reset_before=
The option ``reset_before='' controls whether the interface program toggles the parallel port's reset line before sending the job. Hopefully, this will clear any previous, partially sent job out of the printer's buffer. The default for this option is true.

reset_on_cancel=
The option ``reset_on_cancel='' controls what the interface program does if it is terminated before printing is done. This might happen if a user cancels a job while it is printing or if a system operator uses the ppop halt command to stop the printer in the middle of a job. If this option is true, then when the interface program receives the order to shut down, it will attempt to reset the printer before exiting. The default setting for this option is false. You might want to enable this option and disable ``reset_before='' if that option causes problems.

Currently, the ``status_interval='', ``reset_before='', and ``reset_on_cancel='' options only work on Linux systems. On other platforms they do nothing. It should be a simple matter to add support for other operating systems.

If your printer, parallel port hardware, and operating system's parallel port driver support bidirectional communication, then you may use the ppad feedback command to enable PostScript error detection.

usb

This interface sends the print job to a USB printer. There are two acceptable address formats.

The first address format is simply the name of a device node, such as /dev/usb/lp0. An address of this time will not be satisfactory if you have more than one USB printer because the OS kernel will assign device names to them in the order in which it sees them. So unless you are are careful to always turn on all of your printers before turning on your computer and never change their position on the USB bus, their device names will not remain the same.

The second address format is a subset of the information from the desired printer's IEEE 1284 identification string. The first USB printer (going in ascending device-name order) which matches all of the specified identification string items is selected. Identification string items which may be matched are MFG, MDL, and SERN. Item and value should be separated by a colon. Items should be separated by semicolons. For example, if you have an Epson Stylus C62 and an HP DeskJet 880C, you could set their addresses thus:

        $ ppad interface c62 usb "MFG:EPSON;MDL:Stylus C62"
        $ ppad interface 880c usb "MFG:HEWLETT-PACKARD;MDL:DESKJET 880C"

If you use the Add Printer wizard (part of PPR's WWW interface), it will, when possible, allow you to pick addresses of this type from a list. You can run its backend USB browser like this:

        $ ~ppr/browsers/usb "USB LP Ports"
        [USB Printer 0]
        manufacturer=EPSON
        model=Stylus C62
        interface=usb,"MFG=EPSON;MDL=Stylus C62"
         
        [USB Printer 1]
        interface=usb,"/dev/usb/lp1"
        [USB Printer 2]
        manufacturer=HEWLETT-PACKARD
        model=DESKJET 880C
        interface=usb,"MFG=HEWLETT-PACKARD;MDL=DESKJET 880C"

Notice the lines which begin with ``interface=''. The first item of the value is the name of an interface program. The second item is the the address to use with it.

Some printer's do not have an IEEE 1284 identification string. The second printer in the example above does not. Suggestions as to how to deal with such cases are welcome.

idle_status_interval=
Please see the description serial or parallel interface for an explanation of this option.

status_interval=
This option presently does nothing.

init=
This option selects one of several initialization strings. Some USB printers require this string in order for the USB interface got wrest the printer's attention away from the parallel port. Valid values are:
epson
Required by the Epson C62 and possibly others.

dummy

The interface dummy is for testing purposes. It is a shell script which copies the job to a file. The address is the name of the file.

sleep=
This interface has an option ``sleep=''. This tells the interface how many seconds to wait after printing the jobs before exiting. This can be used to simulate the time requirements of printing on an actual printer.

create=
This interface has an option ``create=''. If it is true, then the interface will create the output file if it doesn't exist yet. It is true by default.

atalk

The interface atalk sends the job to an AppleTalk printer using the Printer Access Protocol. The address is the AppleTalk address of the printer in the form ``name:type@zone''. The name is the name that appears in the chooser. The type is usually ``LaserWriter'' but it may be anything including ``LaserJet 4M'' and ``LaserShared''. If the printer is not found using the indicated type, then it is tried again with a type of ``LaserWriter''; if it is found that time, PPR changes the printer's type to the Type originally specified. This ``hides'' or ``captures'' the printer, preventing Macintosh user's from sending jobs to it directly.

This interface has some options which may be set with the ppad options command. (None of these options are implemented yet in the CAP version of the interface.)

lookup_retries= =item lookup_interval=
Two of the options, ``lookup_retries='' and ``lookup_interval='' control how many times the interface will atempt to look up the printer's AppleTalk name and how many seconds it will pause between attempts. The default values are 8 and 1 respectively.

open_retries=
The option ``open_retries='' controls how many times the interface will attempt to open a connexion to the printer when the printer is busy. These attempts are made a two second intervals. The default is 10. If open_retries is set to -1, then the interface will keep trying until it is connected. Setting open_retries for infinite retries will prevent the spooler from correctly reporting that the printer is ``otherwise engaged or off-line''.

idle_status_interval=
The option ``idle_status_interval='' is 0 by default. If it is set to a positive value, expressing a number of seconds, then the interface will attempt to retrieve the most current printer status approximately that often. (The timing is actually rather erratic.)

address_cache=
The option ``address_cache='' controls whether the interface caches the AppleTalk address of the printer. This feature is on by default. The address is cached at the end of each sucessful printing run. At the start of a new run, if the address was cached less than 20 seconds ago it is used without doing another name lookup. If the cached address is older than that then a message is sent to the address to confirm that it is still good and it is used if the response is positive. The address cache is considered invalid if the interface or the address has changed.

tcpip

The interface tcpip opens a connection to a specified TCP socket on a specific host and sends the data. Aliases for this interface automatically select appropriate options to implement the SocketAPI, AppSocket, and JetDirect protocols.

The address format for the tcpip interface is host or host:port. For example: ``bigjohn.prn.trincoll.edu:9100''. If port is omitted, 9100 will be used. Port 9100 is the default port for many devices which use this protocol including those from HP, and Extended Systems.

This interface currently supports all jobbreak methods except signal and signal/pjl. (See the ppad jobbreak section of this man page.)

By default the ppad feedback setting is set to ``true'' for this interface. A setting of ``true'' indicates that the network device supports bidirectional communication with the printer. HP printers with JetDirect cards support bidirectional communication. However, some external Ethernet adapters designed to be connected to the parallel port don't have bidirectional parallel ports themselves. Thus, even if the printer has a bidirectional parallel port, bidirectional communication will be impossible. The manual that comes with the adapter may be able to tell you whether it has a bidirectional parallel port. If not, experiment. If jobs hang in the queue after they have been printed, then try setting the feedback parameter to ``false''.

When using the tcpip interface, PostScript errors will be detected only if the interface supports bidirectional communication.

The tcpip interface has many options. You will seldom have to set any of them.

connect_timeout=
This option controls how long the tcpip interface will wait for the printer to respond to a connexion request. The default is 20 seconds.

refused=
This option tells the interface how to react if the printer refuses its connection attempt. The possible values are ``engaged'' and ``error''. The default is ``engaged'' which causes the interface to assume that the printer is off-line or busy and report it as such to the spooler. The value ``error'' causes the interface to append an error message to the printer's alerts log and report and report a printer fault to the spooler.

refused_retries=
This option tells the interface how many times it should retry a refused connexion before taking the action specified by the ``refused='' option. The retries occur at 2 second intervals.

sndbuf_size=
This option can be used to set the value of the socket option SO_SNDBUF. If this option is ommited, the system default is accepted.

idle_status_interval=
Please see the description serial or parallel interface for an explanation of this option.

This option is especially useful with HP printers with JetDirect network cards. These cards have TCP timeout which by default is 90 seconds. If the card does not receive any characters for 90 seconds it will decide the sender has malfunctioned and hang up the connexion. This is a problem because PPR will wait until the job is finished in case there are any PostScript error messages to receive. If it takes more than 90 seconds for the printer to finish the job after it has received the last byte then it will hang up the network connexion, which PPR will interpret as a printer fault. The result is that PPR will print the same job again and again. The solution is to set an option of ``idle_status_interval=30'' or some other value significantly less them the timeout. The control-T's will reset the JetDirect card's timeout.

snmp_status_interval=
This option will instruct the interface program to send SNMP printer status queries every so many seconds. Unlike the control-T's sent by ``idle_status_interval='', these queries will be sent constantly, without waiting for a lull in communications. The default for this option is 0 (which disables SNMP status queries).

snmp_community=
This option tell the interface what community name (password) to use when using SNMP to fetch the printer status. This is also used when this interface program is running in probe mode. Probe mode is used by the ppad ppdq and ppad ppd query commands. The default value is ``public''. Almost all printers allow read-only access with the community name ``public''.

appsocket_status_interval=
This option will instruct the interface program to send AppSocket UDP printer status queries every so many seconds. This option will have no effect if ``snmp_status_interval='' is greater than zero.

sleep=
This option specifies the number of seconds the should interface delay between closing the connection and exiting. Some TCP/IP printers may need a few seconds to recover after printing a job before they can accept a new connection. This option was originaly intended to provide a way to give them this time. It is now obsolete because the tcpip interface has connect retry code which takes care of this problem. The default is ``sleep=0''.

socketapi

This interface is the same as tcpip.

appsocket

This interface differs from the tcpip interface only in its default options and jobbreak method. The default jobbreak method is newinterface and the default option that differs is ``appsocket_status_interval=15''.

jetdirect

This interace differs from the tcpip only in its default options. The default option that differs is ``snmp_status_interval=15''.

pros

This interface implements the PROS protocol used by Axis print servers. The address format is printer@host:portnum. For example LPT1@myprn.myorg.org:35. If you leave off printer@, LPT1 is assumed. If you leave off :portnum, 35 is assumed.

This interface accepts the options connect_timeout=, refused_retires=, refused=, and sndbuf_size=. They work exactly as they do for the tcpip interface.

In addition, this interface accepts the option password=. You should use this if you have set the printing password on your Axis print server to something other than the default which is ``netprinter''.

Some may wonder whether this interface supports PROS A or PROS B. While the Axis documentation claims that their print servers support two variants of PROS, called PROS A and PROS B, this is not actually the case. PROS A and PROS B are simply two different implementations of the client. One accepts the print data on stdin, the other runs as a daemon and accepts the print data over a named pipe. Thus the protocol which this interface program supports is simply PROS.

lpr

The interface lpr sends the job to another system using the Berkeley LPR/LPD protocol (described in RFC 1179). The filter can be useful for forwarding jobs to other spoolers such as those on Unix systems or Windows NT (with the appropriate service installed).

Most printers with Ethernet cards which claim to support TCP/IP support this protocol. However, because this interface must copy the entire job to a temporary file before transmitting it to the printer, it is much better to use the tcpip interface when the printer's network card supports its protocol.

The address format for the lpr interface is printer@host. For example: ``pooh@sanders.trincoll.edu''. If you really want to, you can specify a port to connect to instead of the normal lpd port. Do it like this: ``pooh@sanders.trincoll.edu:2000''.

If the remote system has a full spooler rather than an Ethernet device connected directly to a printer, jobs could disappear from PPR's queue long before they are printed.

The lpr interface supports all jobbreak methods except signal and signal/pjl. The suitability of any given jobbreak method depends much on the remote system. The default is control-d which is suitable for simple devices such as Ethernet devices which attached directly to the printer. When sending to a real spooler it is sometimes necessary to choose a jobbreak method of newinterface because the remote spooler objects to the control-d's in the data stream. In such a case, the remote spooler will itself insert whatever control codes are necessary.

PostScript errors will not be detected when using the lpr interface because the protocol it implements has no provision for bidirectional communication.

These are the lpr interface's options:

banner=
With this option you can tell the remote printer whether or not you want it to attach its own banner page to the job. The default is ``banner=no''. Certain types of remote systems have been known to refuse to print the job unless ``banner=yes'' is used.

lpr_typecode=
With this option you can specify the file type code to be used when submitting the job to the printer. The preferable code is ``o'' which means that the file is PostScript, however many lpd implementations do not understand this code so ``f'' is the default.

smtp_community=
See the description of this option in the section for the tcpip interface. The only difference is that the lpr interface program uses this value only when it is running in probe mode.

This interface also has the experimental options ``chunk_size='', ``exaggerated_size='', and ``temp_first=''. No documentation is provided for these at this time.

clispool

The interface clispool (formerly called client) sends the job to an MS-DOS LAN Manager client running spooling software. This interface is compatible with the client spooling system found in AT&T's LAN Manager for Unix. An AT&T client spooler consists a an MS-DOS computer running LAN Manager client software, the MS-DOS background spooler PRINT, and a program called CLISPOOL. CLISPOOL advertises an NetBIOS name on the network. This name consists of the NetBIOS machine name with ``.P'' appended. The print server writes the print data to a temporary file in a LAN Manager accesable directory, opens a NetBIOS connexion to CLISPOOL, and sends a packet giving the LAN Manager path and name of the temporary file. CLISPOOL then submits the file to PRINT and waits for it to finish. When PRINT is done printing the file, CLISPOOL sends a response packet to the print server and close the connexion.

The address to use with this interface is the NetBIOS name advertised by CLISPOOL, but without the trailing ``.P''. There are no options.

This interface has no options.

Though it will compile on System V Release 4.0 derived systems, this interface has not been tested in several years.

PostScript errors will not be detected when using the clispool interface because the protocol it implements does not support bidirectional communication with the printer.

smb

The interface smb uses Samba's smbclient to send the job.

This interface looks in /etc/ppr/ppr.conf to learn the location of the smbclient program.

The address should be the UNC name of the print queue. It should be in the format ``\\server\queue''.

If access restrictions require it, you may use the options ``smbuser='' and ``smbpassword='' to indicate the user name and password that the interface should use when logging on to the remote print server. Note that anyone with access to the computer running PPR will be able to read the password. Suggestions for a better scheme are welcome.

In order for this interface to work correctly, Samba must be correctly configured. If it does not work, try using smbclient to connect to the printer server.

PostScript errors will not be detected when using the smb interface because the protocol it implements does not support bidirectional communication with the printer.


RECOMENDATIONS

Recomendations as to which interface program to use with which printers can be found in the PPR Wiki at http://ppr.trincoll.edu/wiki/.


SEE ALSO

ppad(8)


HISTORY

PPR was written at Trinity College during 1993--2006. It was first released to the public on 26 April 1995.


AUTHOR

David Chappell, Trinity College Computing Center, Hartford Connecticut.