Advanced printer configuration

Setting printer port characteristics

Printer port characteristics are attributes defined with the -o "stty='stty-option-list'" option of the lpadmin command. Printers connected directly to computers and those connected over some networks require that the printer port characteristics be set by the interface program. These characteristics define the low level communications with the printer. Included are the baud rate; use of XON/XOFF flow control; 7, 8, or other bits per byte; type of parity; and output postprocessing. The standard interface program uses the stty command to initialize the printer port, minimally setting the baud rate and a few other default characteristics.

Default port characteristics

The default characteristics applied by the standard interface program are listed here.

Default Meaning
9600 9600 baud rate
cs8 8-bit bytes
-cstopb 1 stop bit per byte
-parenb no parity generation
ixon enable XON/XOFF flow control
-ixany allow only XON to restart output
opost postprocess data stream as listed below:
-olcuc don't map lower case to upper case
onlcr map linefeed into carriage return/linefeed
-ocrnl don't map carriage return into linefeed
-onocr output carriage returns even at column 0
nl0 no delay after linefeeds
cr0 no delay after carriage returns
tab0 no delay after tabs
bs0 no delay after backspaces
vt0 no delay after vertical tabs
ff0 no delay after form feeds

You may find that the default characteristics are sufficient for your printers. However, printers vary enough that you may have to set different characteristics. See stty(1) for a complete list of characteristics.

If you have a printer that requires printer port characteristics other than those handled by the stty program, you will have to customize the interface program. See ``Printer interface scripts'' for help.

When you add a new printer, you may specify an additional list of port characteristics. The list you give will be applied after the default list so that you do not need to include in your list items that you don't want to change. Specify the additional list as follows:

/usr/sbin/lpadmin -p printer-name -o "stty='stty-option-list'"

Note that both the double quotes and single quotes are needed if you give more than one item in the stty-option-list.

Suppose your printer is to be used for printing graphical data, where linefeed characters should be output alone, without an added carriage return. You would enter the following command:

/usr/sbin/lpadmin -p printer-name -o "stty=-onlcr"

Note that the single quotes are omitted because there is only one item in the list.

As another example, suppose your printer requires odd parity for data sent to it. You would enter the following command:

/usr/sbin/lpadmin -p printer-name -o "stty='parenb parodd cs7'"

Next topic: Setting up a printer with multiple names
Previous topic: Alerting to mount a font cartridge

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004