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 section of this document. 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. (They will be displayed 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, 0 otherwise. In previous versions, the default was always 0.

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=
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. (They will be displayed 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, 0 otherwise.

status_interval=
The option ``status_interval='' sets the interval (in seconds) at which the interface will request the Centronics parallel port status. By default this is 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.

usblp

This interface sends the print job to a USB printer. It is still experimental. You may get better results with the parallel or simple interface. At this time, the only address format supported is device file name, such as /dev/usb/lp0. In the future it will support alternative address formats which may specify USB bus position or make, model, and serial number.

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 the 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=
The option ``connect_timeout='' controls how long the tcpip interface will wait for the printer to respond to a connexion request. The default is 20 seconds.

refused=
The option ``refused='' 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=
The option ``refused_retries='' 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=
The option ``sndbuf_size='' 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=
The option ``idle_status_interval='' will instruct the interface to send a control-T to the printer every so many seconds whenever the interface doesn't have anything else to send to the printer. This will cause some printers to send back status messages which will be displayed by ppop status. (It will be displayed as an indented line under the queue status). The default for this option is ``15'' if feedback is true and jobbreak is control-d, 0 otherwise.

If feedback is true and jobbreak is control-d, then the default for this the ``idle_status_interval='' option is 15, otherwise it is 0. In previous versions of PPR, the default is always 0.

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

This section contains notes about various printers and embedded print servers as recommendations as to which PPR interface programs to use with them.

Please send contributions to this section to ppr-bugs@trincoll.edu.

Apple LaserWriter II

The Apple LaserWriter II and many other printers of that era have internal networking such as the QMS-PS 810 support only the LocalTalk variant of AppleTalk.

atalk
Fully functional. The AppleTalk type is LaserWriter.

HP DeskWriter with AppleTalk

HP made a version of the DeskJet with LocalTalk support. They called it the DeskWriter. Since these printers don't have internal PostScript interpreters, they were tested with Ghostscript.

atalk
Works well. The AppleTalk type is ``DeskWriter''.

HP JetDirect (Internal)

PPR has been extensively tested with HP printers with internal JetDirect cards.

atalk
This interface is highly recommended. It works in bidirectional mode. These printer advertize AppleTalk names with several types, including LaserWriter, which is probably what you should use in the address.

Some printers will give better status reporting if one selects the signal/pjl jobbreak method. However the 4M will malfunction. The 4M+ works fine though.

jetdirect
This interface is highly recommended. It works in bidirectional mode. Uses port 9100.

lpr
Works as well as the lpr interface ever works. Use a queue name of RAW.

HP JetDirect (External)

HP external JetDirect devices which strap to the backs of DeskJets have received basic testing. The printers tested did not have internal PostScript interpreters and so were used with Ghostscript.

jetdirect
Works well. The port number is 9100.

Extended Systems PocketPrintServer

This product works but does not support bidirectional communication at all. It is a small box with a parallel port on one end and 10BaseT and 2BaseT connectors on the other.

tcpip
Works. The default port for these devices is 9100.

lpr
Works as well as the lpr interface ever works.

AXIS Communications 540+/542+ print server

This print server is a small box with a parallel connector at one end and a 10BaseT Ethernet connection at the other. It supports numberous networking protocols including PROS, SMB, SocketAPI, LPR, FTP, and AppleTalk PAP. The product information page is at http://www.axis.com/techsup/prtsrv/axis_540/. It costs less than US$100.

pros
This option is recommended since it allows reporting of off-line and paper-out and should support bidirectional communication. It is recommended that you use a queue name of LPT1.

tcpip
This works. It is not known if the print server support bidirectional communication using this protocol. The default port is 9900.

lpr
Works as well as the lpr interface ever works. It is recommended that you use a queue name of LPT1.

atalk
Untested but supposedly supported.

smb
Untested but supposedly supported.

Canon ImageRunner

atalk
Works, including bindirectional communication if one selects the name ending in ``DIRECT''.

tcpip
Works, but not bidirectional. The port number is ????. Canon calls this the Universal Printing Protocol.

smb
Works. Offers three queues called HOLD, PRINT, and DIRECT.

lpr
Works as well as the lpr interface ever works.

NIB 450-E Ricoh Aficio 450

This is a network interface board for a Ricoh Aficio 450 combination photo copier and laser printer. At the time of testing in 1999 it performed poorly, manifesting numberous bugs in its network protocol implementations. Among other things, the bidirectional communication was slow and jerky and lost characters. End of job handshaking generally didn't work. It also frequently dropt off the network.

This entry is here to give you some ideas as to how to work around crippling bugs.

atalk
Has serious problems due to the end of job handshaking failures. Might work if one were to disable feedback. The signal/pjl jobbreak method will not work at all over this interface, appearently because the embedded print server TBCP encodes the PJL universal exit language sequence before sending it to the printer. Using this interface method is not recommended.

tcpip
Even though bidirectional communication is supported using this protocol, control-d handshaking is defective, so jobbreak method control-d will result in a hung queue unless feedback is disabled (which has the effect of disabling PPR's end-of-job handshaking). Since characters from the printer to the PPR server are lost, jobbreak method pjl may sometimes result in a hung queue unless feedback is disabled. The default port number is 10001. If you wish to change the port number on the printer, select a ``Base Port'' number which is one less than the desired port number. For example, select 9099 if you want the printer to listen on port 9100.

lpr
Works as long as one uses a queue name of PORT1. The capitalization is said to be important. The printer will accept other queue names but will drop the connexion right after replying that they are OK.


SEE ALSO

ppad(8)


HISTORY

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


AUTHOR

David Chappell, Trinity College Computing Center, Hartford Connecticut.