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 find out 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 used by the LP print service.
Table 7–1 stty Default Settings Used by the LP Print Service
Option |
Meaning |
---|---|
-9600 |
Set baud to 9600 |
-cs8 |
Set 8-bit bytes |
-cstopb |
Send one stop bit per byte |
-parity |
Do not generate parity |
-ixon |
Enable XON/XOFF (also known as START/STOP or DC1/DC3) |
-opost |
Do “output post-processing” using all the settings that follow in this table |
-olcuc |
Do not map lowercase to uppercase |
-onlcr |
Change line feed to carriage return/line feed |
-ocrnl |
Do not change carriage returns into line feeds |
-onocr |
Output carriage returns even at column 0 |
-n10 |
No delay after line feeds |
-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 |
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 printer-name |
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 stty(1). Table 7–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 |
The following example shows how to set the port characteristics for the printer luna. The parenb option enables parity checking/generation, parodd sets odd parity generation, and cs7 sets the character size to 7 bits.
# lpadmin -p luna -o "stty='parenb parodd cs7'" |
The following example shows how to set the terminal baud rate to 19200 for the printer venus.
# lpadmin -p venus -o "stty=19200" |