Technical article 109704

Changing the baud rate for a serial printer using SCOadmin or lpadmin on the command line doesn't affect the comms speed.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6

Written · Last revised

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=4800

but 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/configuration
would 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/printer1
contains 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.

From the Xinuos technical article database, record 109704. Reproduced with permission. The original is at www.sco.com/ta/109704, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.