STTY and LPRng

Issue:
LPRng printcap information on setting TTY parameters when printing to a local serial port.

Solution:

How to set the TTY settings by manually editing the printcap entry for a serial printer. Information taken from the LPRng Reference Manual.

Options used:

  • br=serial port bit rate

  • rw FLAG device opened RW

  • stty=stty options for serial port configuration



The following is a typical printcap for a serial printer:

    # Local Serial ASCII printer
    lp2
      :lp=/dev/ttya
      :rw
      :cm=Serial printer
      :sd=/var/spool/lpd/lp2
      :stty=9600 -echo -crmod -raw -oddp -evenp pass8 cbreak ixon
      :filter=/usr/local/sbin/lpf
      :mx=0


Let's examine the new options:

  1. A serial port is usually bidirectional, and printers will report errors back to the host computer. The rw flag will cause the printer port to be opened read-write, and the lpd server will report status information.

  2. The stty option specifies the stty(1) flags and line speed needed to configure the serial line (See Serial Printers for details).

  3. The legacy br (bit rate) option can be used to specify the line speed as well.


Article ID:
536
Published:
7/13/2005 4:26:38 PM
Last Modified:
7/13/2005 4:26:57 PM
Issue Type:
Trouble Shooting