The printer port characteristics set by the LP print service must be compatible with the printer communication settings. If the default printer port settings provided by the LP print service do not work with a printer, refer to the printer manual from the manufacturer to determine what settings the printer requires from the LP print service. Use the stty command to set and display printer communication settings.
The following table shows the default stty settings that are used by the LP print service.
Table 6.1. Default stty Settings Used by the LP Print Service
Option |
Description |
---|---|
|
Sets baud to 9600 |
|
Sets 8-bit bytes |
|
Sends one stop bit per byte |
|
Does not generate parity |
|
Enables XON/XOFF (also known as START/STOP or DC1/DC3) |
|
Does “output post-processing” using all the settings that follow in this table |
|
Do not map lowercase to uppercase |
|
Changes linefeed to carriage return/linefeed |
|
Does not change carriage returns into linefeeds |
|
Outputs carriage returns even at column 0 |
|
Provides no delay after linefeeds |
|
Provides no delay after carriage returns |
|
Provides no delay after tabs |
|
Provides no delay after backspace characters |
|
Provides no delay after vertical tabs |
|
Provides no delay after form feeds |
How to Adjust the Printer Port Characteristics
Log in as superuser, lp
, or assume
an equivalent role on the print server.
Adjust the printer port characteristics.
#lpadmin -p
printer-name
-o "stty=
options
"
p
Specifies the name of the printer for which you are adjusting the port characteristics.
o
“stty=options”
Sets the port characteristic (stty option) specified
by options
. You can change more than one stty option setting with this command. Enclose each option in single quotation
marks, and use a space to separate the options. For a complete list of options, see
the
stty
(
1
)
man page. Table 6–1 shows the default stty settings used by
the LP print service.
Verify that the printer port characteristics have been changed.
#lpstat -p
printer-name
-l
Example 6.1. Adjusting the Printer Port Characteristics
This example shows how to set the port characteristics for the printer luna
. The parenb
option enables parity checking/generation.
The parodd
option sets odd parity generation. The cs7
option sets the character size to 7 bits.
# lpadmin -p luna -o "stty='parenb parodd cs7'"