Problem
I need to change the configured baud rate of my serial printer
from the default setting of 9600. I have tried using SCOadmin:scoadmin printer manager -> Settings -> Serial Comm...and lpadmin(ADM):/usr/lib/lpadmin -p printer1 -o stty=4800but the configured printer baud rate does not seem to change; garbled text can appear on the printer which is physically running at a baud rate different from 9600.
In fact, this is true for any of the serial line characteristics configured via scoadmin(ADM) or lpadmin(ADM), for example, parity, flow control, character size and baud rate.
This is only an issue if the serial printer is configured as a
model other than "standard", for example, "epson", "proprinter",
and so on. Those serial printers defined as model "standard"
(and therefore which use the standard interface script) should
be configured correctly using the methods described above. See
the man page for lpadmin(ADM) for further details on printer model. Cause
Both the scoadmin(ADM) and lpadmin(ADM) methods described above
make changes to the printer configuration file to list the new
baud rate under the stty field.For example, if the printer is called printer1, then the file:
/var/spool/lp/admins/lp/printers/printer1/configurationwould look like:Banner: on Content types: simple Device: /dev/tty1a Interface: /usr/spool/lp/model/epson Printer type: unknown Stty: cs8 -parenb 4800 Number of banners: 1
However, the "Stty:" field of the printer configuration file is ignored by printer interface scripts other than the "standard" interface script and so the new baud rate is not in effect.
Solution
To work around this, the printer interface file can be manually edited using your favorite text editor to set the new baud rate (or other serial line characteristics).
The printer specific interface file (not the template referenced in the configuration file) is located in:
/var/spool/lp/admins/lp/interfaces/<printer_name>The interface should contain a line beginning with "stty" which sets up various characteristics for the serial line. The new baud rate can be added to this list of settings (see stty(C) for an explanation of the various stty settings).
For example, if a printer <printer1> is configured as model "epson", then the file:
/var/spool/lp/admins/lp/interfaces/printer1contains the section:.....
# If it is necessary to change the baud rate or other stty settings for
# your serial printer modify the following line:
stty ixon ixoff opost -ixany 0<&1
.....This can be changed to:.....
# If it is necessary to change the baud rate or other stty settings for
# your serial printer modify the following line:
stty 4800 ixon ixoff opost -ixany 0<&1
.....to reflect a new baud rate of 4800.
This will be in effect the next time a print request is submitted.
See also
SCO OpenServer 5 System Administration Guide.