(URLs updated to reflect new hosting location, 5/05 - mrbill@sunhelp.org)

Celeste's Tutorial on SunOS 4.1.x Modems & Terminals

Revision 1.3, 1/4/96

This document is a tutorial that will teach you everything you should need to know about connecting asynchronous modems and terminals to a Sun workstation under Sun's SunOS 4.1.3 and higher 4.1.x releases (also known as Solaris 1.1 and up). It does not cover the specifics of setting up PPP.

You may distribute this information to anyone who wants it, as long as you never attempt to copyright it in any way. If you find errors in it, or have suggestions for changes in future revisions, please let me know via email. Go for it--you can do it!

..Celeste Stokely, IT Project Management Consultant, Stokely Consulting
8025 FM 620 North, #1722, Austin TX 78726
(512) 249-7812
http://www.stokely.com, celeste@stokely.com



[Document Top] [Previous Section] [Lawyer Section]

Introduction

Setting up modems and terminals under Unix is often painful, but it isn't impossible if you have a guide.

If this is your first attempt at hooking up a modem or terminal to a Unix machine, I'll give you a sound strategy to use and walk you through it. It's not really hard once you learn a few basics.

You must execute the commands as root and you may have to reboot the machine. So, plan the system's downtime accordingly.

WARNING: I have very strong feelings about modems and serial ports, their uses, their manufacturers, and their support. My clients ask me to make their modems work and stay working, so I tend to use only modems that are robust, highly configurable, fast, and well-supported. They're not cheap, but neither is a System Administrator's time. I use cheap modems for doorstops and bookends.

Many thanks to the reviewers of this document! These hard-working folks include Bruce Schoenleber of Magma, and Glenn Satchell of Uniq Professional Services Pty Ltd.



[Document Top] [Previous Section] [Next Section]

Lawyer Section:

Copyright © 2000 Stokely Consulting.
Permission to use, copy, and distribute this documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies, that both that copyright notice and this permission notice appear in supporting documentation, that this document is not modified, and that the name of Stokely Consulting not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Stokely Consulting makes no representations about the suitability of this documentation for any purpose. It is provided "as is" without express or implied warranty. All other product names are copyrighted by their various owners.



[Document Top] [Previous Section] [Next Section]

Which Modem Should You Use?

There are hundreds of Hayes-compatible, asynchronous modems on the market today. Most of them can be made to work on a Sun for dial-out. Many can work for dial-in. Several will work gracefully for bidirectional (dial-in and dial-out) use. Fewer still will bring a smile to a sysadm's heart.

If you're trying to connect a non Hayes-compatible modem to your Sun, this article won't work for you.

This article covers the basic setup for many common serial port usages, such as:

This article specifically does not cover:

In general, you get what you pay for. A $49 modem will cost you a fortune in the time it takes to get it running. A $499 modem can often be configured and running in under 20 minutes and give you little grief in day-to-day use.

Types of Modem Usage

Match your modem to your intended use for it. Don't buy a cheap 2400bps modem to transfer all your company's mail and netnews. If your Internet service provider offers your UUCP connection only over Telebit WorldBlazers, you should strongly consider buying a Telebit WorldBlazer and dedicate it to that use. If they're not a Telebit site and plan on staying that way, there are faster, more widely-compatible modems available for a LOT less money.

My current favorite is the USRobotics Courier V.34--a sweet modem that gets better with every release of the flash-upgrade for the ROM. Next month, who knows what will be the darling? I have so many "former favorite" modems in my office that it's starting to look like a modem museum.

If you have to support a lot of dial-in users with a wide collection of random modems, then you need something which can happily work with all the possible user modems. That means you need one that will run at least 14400bps. The new real V.34 28800bps modems will be even better, in the long run. Plan on spending $250-$600 for this modem.

Modem Programming

In deciding which modem to buy, a key consideration is how you can program the modem. Some modems use DIP switches, some are programmed by connecting to the modem and setting software registers, some use both methods. You get more programming flexibility with software registers, and this is important when you'll be connecting to a lot of different modem types.

If a modem has only DIP switches available, it probably will be hard to make it do everything you need for lots of different connections. It's probably also an old, slow modem. I call these "cheap PC modems" and avoid them like spamming Internet lawyers.

Modem Speed

One of the most important features to look for is the modem's ability to run at split speeds. You really want to run the Sun-to-modem connection at a fixed speed (the DTE rate or serial rate) all the time, and let the modem negotiate the modem-to-modem speed (DCE rate or line speed) independently.

Beware, because many inexpensive modems can't do this. If your modem doesn't do this, you and your users will have to hit <break> until the speeds sync up. This drives users (and you) crazy!

You should try to run the Sun-to-modem (DTE) connection at 9600bps, 19200bps, or 38400bps. A Sun can NOT run the CPU serial port at 14400bps. But, that's ok because all the 14400 modems I've ever seen can run at 19200bps DTE speed. You can also run at slower speeds, but why bother? Buy a faster modem than you think you need and you'll get more use out of it in the long run.

There are a few kernel hacks available to run the Sun CPU serial ports at higher speed. Use them at your own risk. I do NOT recommend them--they're too unstable for most purposes. The Sun CPU serial ports and their drivers are bad enough without hacking on them yourself.

If you crave more speed than 38400bps, you need to look into SBUS serial- port expander cards with DMA (I like Magma's line of DMA serial cards), or even network-connected terminal servers, and modems which are even MORE expensive. If you need a lot of high-speed serial connections, network terminal servers are probably the way you should go.

Flow Control and Parity

When you run at higher speeds (9600bps and above), you MUST worry about flow control. Ideally, you want hardware flow control where the Sun and modem play the right games with the RTS/CTS lines to say "shut up" and "give me more"

Software flow control on the zs (tty[ab]) ports will not cure the "zs[01]: silo overflow" problem. This problem will become apparent at speeds > 9600 on the zs ports, and probably on third party ports at speeds > 19200. Ports which have DMA capability are less prone to have this problem. Of course, any port which uses DMA probably has hardware flow control as well.

For SLIP, PPP and UUCP applications, the performance of the cpu serial ports may be abysmal at very high speeds because of an excessive number of frame retransmits. Determine if the performance is good enough for you, and, if not, plan to spend $500+ for a good, DMA SBUS-based serial port card for your Sun. Yes, that's expensive, but solid, reliable communications may be critical to your application.

Historically, the Sun CPU ports have not been able to use incoming hardware flow control, only outgoing. Sun has released a patch to enable incoming flow control. This is Patch # 100513 for SunOS 4.1.1-4.1.3, and Patch # 101621 for SunOS 4.1.3_U1, each lovingly known as the "Jumbo TTY Patch"

The bugids are 1139832, 1143251, 1143399, 1012954, 1143250, 1182165, 1150599, and many others. Refer to Sunsolve or Sun Technical Support to see if there is a patch for your version of SunOS. I've had moderate success with these patches. Sometimes, they just don't work. Sometimes they do. It's worth a try at least. If it doesn't work and you must have hardware flow control, look into the higher-end SBUS-based serial port expander cards.

If the patch doesn't work for you, you can consider using software (XON/ XOFF) flow control. But, NEVER use software flow control with UUCP or UUCP will go nuts from the unexpected XON and XOFF characters. If you can't use hardware flow control with UUCP, it's better to use no flow control at all and let UUCP do its own packet throttling.

I run my own communications server without port-level flow control on my 13 UUCP connections at 38400bps and all the mail and NetNews gets delivered just fine.

Try to always run your ports and modems at 8 bits, no parity. Parity on serial port transmissions is an outdated concept when you're using modern, error-correcting modem protocols. By default, the Sun CPU ports run at 7 bits, even parity (7E1). I'll explain how to run them at 8 bits, no parity (8N1). If you've got a legitimate use for odd, mark, or space parity, I want to hear from you!



[Document Top] [Previous Section] [Next Section]

Celeste's Strategy for Configuring Modems and Terminals

This strategy gives you flexibility and maintainability in your serial port configurations. It will work for nearly all configurations.

Important Rule: Add and configure only 1 modem or terminal at a time. Get it working, then move on to the next one. Any other approach will result in madness. I been there, done that. Trust me.

There are quite a few steps, but each one is small and easy to accomplish.

Purists may argue that my method of modem-port configuration has extra steps. I find that if a sysadm sets up a port for only dial-in or dial-out, someday he or she will want the port to be bidirectional. Setting things up for this in the beginning means you'll have easier success in the future. And, it doesn't hurt anything.

Ok, So What Do I Do?

To use a port for dial-out only:

To use a port for dial-in only:

To use a port for bidirectional (dial-in and dial-out) use:

To configure a dumb terminal on a port instead of a modem:

If you want to use UUCP, you must configure it as well. This article will tell you about setting up parity and flow control in UUCP, but doesn't cover all the other UUCP file changes. For that, get the O'Reilly and Associates book _Managing UUCP and Usenet_.

Simple, huh? Find the parts of this article that do the pieces you want, modify the scripts as needed, and go for it!



[Document Top] [Previous Section] [Next Section]

Tip and /etc/remote

You may hate tip and love kermit or pcomm. I understand. But, do this via tip to keep it simple, ok?

Decide which serial port you want to use. (One with no cable already plugged in is often a good bet.) The port will be labeled "A" "B" "A/B" or could even be "C" or higher.

If you use one labeled "A/B" and have no Y-type splitter cable plugged into it, you'll have access only to port A. With the splitter, you'll get ports A and B on separate sockets of the splitter cable.

The Sun serial port device driver splits each physical port into two logical devices, /dev/ttya or /dev/ttyb for incoming transmission, and /dev/cua0 or /dev/cua1 for outgoing transmission.

The "speed" referred to in this section is the DTE or Sun-to-modem speed. It is NOT the modem-to-modem speed. A 14400bps modem may have a 19200bps DTE speed.

Make sure you have your serial port permissions right. uucp should own the outgoing side, and root should own the incoming side.

Execute these commands as root, substituting your port name (0/a, 1/b, 2/c, or 3/d) where needed:

 prompt# chown uucp /dev/cua0
 prompt# chown root /dev/ttya
  1. Edit tip's configuration file, /etc/remote, and find the entry beginning with "hardwire:". This is the entry you use to program the modem, and is not usually used for dialing out directly, unless you enjoy AT commands.

    (If this is the second modem you're adding, clone the entire hardwire entry and label the new entry "hardwire2".)

    Change it from an entry like:

         hardwire:\
            :dv=/dev/????:br#????:el=^C^S^Q^U^D:ie=%$:oe=^D
    

    to one set to your port (like /dev/cua0) and baud rate (like 9600)

         hardwire:\
            :dv=/dev/cua0:br#9600:el=^C^S^Q^U^D:ie=%$:oe=^D:
    

  2. Setup and run tip:
    Basic Modem Programming.) Don't forget to write the new settings out to the modem's NonVolatile RAM.

    If you don't see "OK", you are not communicating with the modem. See if the modem is plugged in, verify the baud rate of the modem and the hardwire entry in /etc/remote, verify the modem cable.

/etc/remote example

The following sample /etc/remote file is set up for:

See the remote(4) man page for all the possible options.

cua0:dv=/dev/cua0:br#19200:
cua1:dv=/dev/cua1:p8:br#9600
mysystem:pn=14155551234:tc=UNIX-19200:
hardwire:\
        :dv=/dev/cua1:p8:br#9600:el=^C^S^Q^U^D:ie=%$:oe=^D:
tip0|tip19200:tc=UNIX-19200:
tip9600:tc=UNIX-9600:
UNIX-9600:\
        :el=^D^U^C^S^Q^O@:du:at=hayes:ie=#$%:oe=^D:br#9600:tc=dialb:
UNIX-19200:\
        :el=^D^U^C^S^Q^O@:du:at=hayes:ie=#$%:oe=^D:br#19200:tc=diala:
diala:\
        :dv=/dev/cua0:
dialb:\
        :p8:dv=/dev/cua1:
--------------------------------------------------------------------
The attributes are:
dv      device to use for the tty
du      make a call flag (dial up)
pn      phone numbers (@ =>'s search phones file; possibly taken from
                              PHONES environment variable)
at      ACU type
ie      input EOF marks (default is NULL)
oe      output EOF string (default is NULL)
cu      call unit (default is dv)
br      baud rate (defaults to 300)
tc      to continue a capability



[Document Top] [Previous Section] [Next Section]

Basic Modem Programming

Dust off your modem manual and have it handy. Use tip to connect to the modem and program the modem registers. Be sure to write out the modem's registers to NonVolatile RAM when you're done. Program the modem with:



[Document Top] [Previous Section] [Next Section]

Making the /dev Entries

SunOS 4.x knows that there is an incoming and outgoing side of a port through the major and minor number of the /dev entry. An outgoing port has a minor number that equals the minor number of the incoming port + 128, as in:

crw--w--w-  1 root     wheel     12,   0 Jan 21 07:59 /dev/ttya
crw-------  1 uucp     staff     12, 128 Jan 16 18:24 /dev/cua0
crw--w--w-  1 root     wheel     12,   1 Dec 29 13:57 /dev/ttyb
crw-------  1 uucp     staff     12, 129 Jan 21 08:05 /dev/cua1

Root owns the incoming side of the port, and uucp owns the outgoing side. tip is setuid-uucp, so it can open the outgoing port. If you use kermit, it should be made setuid-uucp, too.

If your port devices do not exist or do not match the major/minor number pairs above, then you will need to make the devices.

Be careful in making assumptions about the major number. It may not always be 12 for the zs driver, and it can be anything for third party drivers. Of course, /dev/ttya and /dev/ttyb should always be present and these will have the correct major number. If these were accidentally removed, then you may want to look for the "zstab" entry in the cdevsw table in /usr/sys/sun/ conf.c to verify the major number.

These commands will make the outgoing devices properly, assuming the major number of your cpu serial ports is 12.

        prompt# cd /dev
        prompt# rm cua0 cua1
        prompt# mknod cua0 c 12 128
        prompt# mknod cua1 c 12 129
        prompt# chmod 600 cua0 cua1
        prompt# chown uucp cua0 cua1



[Document Top] [Previous Section] [Next Section]

/etc/gettytab

The file /etc/gettytab is used to define entries for combinations of baud rate, word length, flow control, and other characteristics of terminal lines. (The file reads a lot like a termcap file.)

This file is used by getty and the entries from /etc/gettytab are referenced in /etc/ttytab.

Practically any stty option can be set in a gettytab entry, but if you get too fancy, expect to run into some problems. This file is also used to set up "login messages" and "initial messages" but you can't make them too long. See the gettytab(5) man page for a full discussion.

/etc/gettytab Example:

Each entry consist of a number of colon-separated (:) fields. The first field for each terminal lists the various names by which it is known, separated by bar ( | ) characters.

Each entry defaults to 7bits, even parity, unless it states otherwise:

#
# 9600 baud, 7E1, s/w flow control
#
2|std.9600|9600-baud:\
        :sp#9600:
#
# 19200 baud, 7E1, h/w (crtscts) flow control
#
g|std.19200|19200-baud:\
        :sp#19200:ms=crtscts:
#
# 38400 baud, 8N1 (because of p8), h/w (crtscts) flow control
#
n|p8.38400|38400-baud:\
        :p8:sp#38400:ms=crtscts:
#
# 38400/19200/9600 rotary (can start either way)
# Lets users hit <break> to try to match up their baud rate with
# the getty's baud rate. (This is gross, IMHO)
# "tc" means "continue the description with the next named entry"
#
Cl|c38400|Fast-Dial-38400:\
        :nx=c19200:tc=38400-baud:
C19200|Fast-Dial-19200:\
        :nx=C9600:tc=19200-baud:
C9|C9600|Fast-Dial-9600:\
        :nx=c38400:tc=9600-baud:



[Document Top] [Previous Section] [Next Section]

/etc/ttytab

The /etc/ttytab file is read by init (process ID 1). /etc/ttytab is used to set up some port characteristics, such as what program should be started on the port (like the getty program), if it should be started, and to set some initial values of the port, (terminal type, secure mode, modem or terminal connection). See the ttytab(5) and termio(4) man pages for a more complete discussion of all the fields.

Fields are separated by TAB and/or SPACE characters. Some fields may contain more than one word and should be enclosed in double quotes. Blank lines and comments can appear anywhere in the file; comments are delimited by `#' and NEW-LINE. Unspecified fields default to NULL.

This document limits its discussion of the fields as they pertain to our friend, getty.

Important: After you make a change to /etc/ttytab or /etc/gettytab, you must execute "kill -1 1" to invoke the changes.

The format of the lines are:

  dev-entry cmd-to-execute terminal-type on-off local-remote secure
dev-entry
The port's entry in /dev. Since getty operates on the incoming side of a port, this is usually ttya or ttyb for cpu serial ports.
cmd-to-execute
The command to be executed, and the command's arguments. Since there are spaces in this token, enclose the token in double quotes. This is the getty invocation, and the argument is the name of an entry in /etc/gettytab.
terminal-type
The initial terminal type, found in /etc/termcap, of the type of terminal or commuications program terminal emulator which will be using this getty. vt100 is usually a safe bet, but you can use practically anything which matches your setup from /etc/termcap.
on-off
Use "on" if you want the getty to start on this port. Use "off" if you do not want the getty to start on this port.
local-remote
Use "remote" to tell getty that a modem will be on this port, and to use hardware carrier detect and modem signaling. "Local" says that you'll be using a terminal, so the kernel will use software carrier detect. Actually, any word other than "remote" means not-a-modem. See termio(4).
secure
If the word "secure" is present, root will be allowed to login directly on this port. If "secure" is not present, root will not be allowed to login directly on this port. This does not affect su in any way.

/etc/ttytab Examples:

Important: After you make a change to /etc/ttytab or /etc/gettytab, you must execute "kill -1 1" to invoke the changes.
  1. Modem on ttya, set to fixed DTE rate of 19200, 7bits even parity (because of the default Sun std.19200 entry in /etc/gettytab), do not allow root to login directly, vt100 terminal emulation:
         ttya    "usr/etc/getty std.19200"       vt100      on remote
    
  2. Terminal on ttyb, set to fixed DTE rate of 19200, 7bits even parity (because of the default Sun std.19200 entry in /etc/gettytab, allow root to login directly, vt100 terminal emulation:
         ttyb    "usr/etc/getty std.19200"       vt100      off remote secure
    

How to turn off getty for a port

You usually can't turn off getty by just killing the getty process. The "init" process will restart an absent getty, if init has been told to do this in the /etc/ttytab file.

The proper way to kill a getty is via the /etc/ttytab file. Locate the line for the port you're working with:

     ttya    "usr/etc/getty std.19200"       vt100      on remote

Edit the line to turn the "on" to "off" as in:

     ttya    "usr/etc/getty std.19200"       vt100      off remote

Then tell "init" (process ID 1) to reread the file and turn off the getty process with:

     prompt# kill -1 1

There should not be a getty running on the port now. Prove this with:

     prompt# ps -auwx | grep getty | grep -v grep



[Document Top] [Previous Section] [Next Section]

eeprom Settings

Religious wars equal to the "vi vs. emacs" war have been fought over eeprom settings for serial ports. If you want to flame me over my eeprom advice, I insist that we discuss this over the drinks you will have to buy for me. :-) Here, I'm just giving you the facts and telling you what works for me.

These are my own eeprom settings, for my 38400bps 8N1 modem on ttya, using hardware flow control:

    ttya-rts-dtr-off=false
    ttya-ignore-cd=true
    ttya-mode=9600,8,n,1,-

Your eeprom entries may vary, depending on which port you're using (ttya, ttyb, ttyc, ttyd), and your cpu architecture. See eeprom(8) for your machine's commands, or just type "eeprom" and look at the output.

Set the entries with "eeprom field-name=value" as in:

       prompt# eeprom ttya-mode=19200,8,n,1,h
ttya-rts-dtr-off
Set to "true" or "false" "true" means do not use modem signaling (like DTR and RTS). "false" means it SHOULD use modem signaling. (Sun's use of reverse logic here drives me nuts!)
ttya-ignore-cd
Set to "true" or "false" "true" means to ignore software carrier detect but use hardware carrier detect, as in a modem connection. "false" means to use software carrier detect only, as in a terminal connection. (This is more reverse logic!)
ttya-mode
Syntax: baudrate,data-bits,parity,stop-bits,flow-control. The
settings for baudrate and flow-control do not seem to matter (as long as they're valid entries) once getty starts. Flow-control is -(none), h(hardware:rts/cts), or s(software:xon/xoff). Stop-bits is 1, 1.5, or 2. Data-bits is 5,6,7, or 8. Parity is n(none), e(even),o(odd), m(mark), or s(space).



[Document Top] [Previous Section] [Next Section]

Setting ttysoftcar

ttysoftcar is invoked at boot time from /etc/rc to enable or disable software carrier detect on ports as specified in /etc/ttytab. It can also be invoked from the command line.

Usually, when adding a modem or terminal to a port, you have to invoke ttysoftcar to get the connection working properly. It's best to turn off any getty on the port, run ttysoftcar to set up the carrier-detect mode you need, and then set up the getty process in /etc/ttytab.

Warning: Running ttysoftcar from the command line will hang if there is a getty already running on a port. Kill the getty first, then run ttysoftcar to change the carrier detect setting.

Syntax: ttysoftcar [-y|-n] tty or ttysoftcar -a

-a resets ttys to appropriate values based on the status field of the /etc/ttytab file. -y turns on software carrier detect. -n turns off software carrier detect and uses hardware carrier detect.

If no options are specified, ttysoftcar returns the current status for tty. This status is reported as y or n.

  1. To set up ttysoftcar for a modem on ttya
  2. To set up ttysoftcar for a terminal on ttya



[Document Top] [Previous Section] [Next Section]

Case Study: Setting up a Bidirectional Modem

This is just a sample, but it may help. The goal of this exercise is to set up a USR Courier V.34 modem on cpu serial port ttyb at a 38400bps, 8bits, no parity, fixed DTE rate, for dial-in and dial-out, using hardware flow control. Root will not be allowed to login directly. Expect a vt100 emulator on the machine dialing in.

  1. Configure /etc/remote for tip (See Tip and /etc/remote.)

    Add this line to the top of /etc/remote:

       usr:p8:br#38400:dv=/dev/cua1:
    
  2. Make the /dev entries (See Making the /dev Entries.)
            prompt# cd /dev
            prompt# rm cua1
            prompt# mknod cua1 c 12 129
            prompt# chmod 600 cua1
            prompt# chown uucp cua1
    
  3. Set up the /etc/gettytab file (See /etc/gettytab.)

    Add this entry to /etc/gettytab: ("p8" makes it 8N1, "crtscts" makes it use hardware flow control.)

         n|p8.38400|38400-baud:\
               :p8:sp#38400:ms=crtscts:
    
  4. Turn off the getty process (See How to turn off getty for a port.)

    Edit /etc/ttytab to create this entry:

       ttyb    "usr/etc/getty p8.38400"       vt100          off remote
    

    then execute the command:

       prompt# kill -1 1
    
  5. Set up ttysoftcar (See Setting ttysoftcar.)

    Execute the command:

         prompt# ttysoftcar -n ttyb
    
  6. Set up the eeprom (See eeprom Settings.).

    Execute the commands:

         prompt# eeprom ttyb-rts-dtr-off=false
         prompt# eeprom ttyb-ignore-cd=true
         prompt# eeprom ttyb-mode=38400,8,n,1,h
    
  7. Plug the modem into ttyb, using a 25 pin, straight-through cable. You can make fancier cables, but that takes time.
  8. Program the modem (See Basic Modem Programming.)

    (Yes, this is cheating. I pulled these settings directly from a client's working USR Courier V.34 modem. But, it's ok because I set it up. :-)

    It will probably take a few tries to get all the right settings into your modem. No, you don't need to set ALL the S registers this way. These have been tweaked for the client's application. Your mileage will definately vary, but the entries below on this modem, from the "B0 C1" through the "S00=001" are very good ones to use, IMHO.

       prompt# tip usr
    

    then program away. Be sure to write things out to NVRAM (Non-volatile RAM).

    Exit tip by typing <carriage return>~.(This means to type 3 separate keys, one at a time, of <carriage return> <tilde> <period> This will also exit rlogin, so if you're running tip through an rlogin, make that <carriage return>~~. (<carriage return> <tilde> <tilde> <period>) or you'll only exit rlogin.)

    USRobotics Courier V.32bis V.34 Fax Settings...
    
       B0  C1  E1  F1  M1  Q2  V0  X0
       BAUD=38400  PARITY=N  WORDLEN=8
       DIAL=TONE   ON HOOK   TIMER
    
       &A0  &B1  &C1  &D2  &G0  &H1  &I0  &K1  &L0  &M4  &N0
       &P0  &R1  &S0  &T5  &X0  &Y1  %N6  
    
       S00=001  S01=000  S02=255  S03=013  S04=010  S05=008  S06=002  S07=060  
       S08=002  S09=006  S10=007  S11=070  S12=255  S13=000  S14=000  S15=000  
       S16=000  S17=000  S18=000  S19=000  S20=000  S21=010  S22=017  S23=019  
       S24=150  S25=005  S26=001  S27=000  S28=008  S29=020  S30=000  S31=000  
       S32=009  S33=000  S34=000  S35=000  S36=000  S37=000  S38=000  S39=000  
       S40=000  S41=000  S42=126  S43=200  S44=015  S45=000  S46=000  S47=000  
       S48=000  S49=000  S50=000  S51=000  S52=000  S53=000  S54=064  S55=000  
       S56=000  S57=000  
    
  9. Configure the getty process to spawn a login correctly (See /etc/ttytab.)

    Re-edit your /etc/ttytab line:

       ttyb    "usr/etc/getty p8.38400"       vt100          on remote
    

    then execute the command:

       prompt# kill -1 1
    

    If you have been only noble and kind all your life, the modem will now be working. It usually takes the rest of us a few more tries to get it right. So, take a deep breath, figure out what isn't right, and correct it in little steps.


[Document Top] [Previous Section] [Next Section]

Case Study: Setting up a Dial-out-only Modem

This is another sample, but it may help. The goal of this exercise is to set up a Telebit WorldBlazer modem on cpu serial port ttyb at a 38400 8bits, no parity, fixed DTE rate, for dial-out only, using hardware flow control.

  1. Configure /etc/remote for tip (See Tip and /etc/remote.)

    Add this line to the top of /etc/remote:

       wb:p8:br#38400:dv=/dev/cua1:
    
  2. Make the /dev entries (See Making the /dev Entries.)
            prompt# cd /dev
            prompt# rm cua1
            prompt# mknod cua1 c 12 129
            prompt# chmod 600 cua1
            prompt# chown uucp cua1
    

  3. Set up the /etc/gettytab file (See /etc/gettytab.)

    add this entry to /etc/gettytab: ("p8" makes it 8N1, "crtscts" makes it use hardware flow control.)

         n|p8.38400|38400-baud:\
               :p8:sp#38400:ms=crtscts:
    
  4. Turn off the getty process (See How to turn off getty for a port.)

    Edit /etc/ttytab to create this entry:

       ttyb    "usr/etc/getty p8.38400"       vt100          off remote
    

    then execute the command:

       prompt# kill -1 1
    
  5. Set up the eeprom (See eeprom Settings.).

    Execute the commands:

         prompt# eeprom ttyb-rts-dtr-off=false
         prompt# eeprom ttyb-ignore-cd=true
         prompt# eeprom ttyb-mode=38400,8,n,1,h
    
  6. Plug the modem into ttyb, using a 25 pin, straight-through cable. You can make fancier cables, but that takes time.

  7. Program the modem (See Basic Modem Programming.)

    (Yes, this is cheating. I pulled these settings directly from a client's working Telebit WorldBlazer modem. But, it's ok because I set it up initially. :-)

    It will probably take a few tries to get all the right settings into your modem. No, you don't need to set ALL the S registers this way. These have been tweaked for the client's application. Your mileage will definately vary, but the entries below on this modem, from the "B1 C1 through the S00=000" are very good ones to use, IMHO. And, S000=000 means "turn off auto-answer" to most modems.

       prompt# tip wb
    

    Then, program your modem's registers. Be sure to write the settings out to the modem's NVRAM (Non-volatile RAM).

    Exit tip by typing <carriage return>~. (This means to type 3 separate keys, one at a time,of <carriage return> <tilde> <period> This will also exit rlogin, so if you're running tip through an rlogin, make that <carriage return>~~. (<carriage return> <tilde> <tilde> <period>) or you'll only exit rlogin.)

    WorldBlazer - SA - Version LA5.01 - Active Configuration
     B1  E1  L1  M0  Q2  T   V0  X0  Y0 
    &C1 &D3 &G0 &J0 &L0 &Q0 &R3 &S4 &T4 &X0 
    S000=0   S001=0   S002=43  S003=13  S004=10  S005=8   S006=2   S007:90 
    S008=2   S009=6   S010=14  S011=70  S012:255 S018=0   S025=5   S026=1  
    S038=0   S041:1   S045=0   S046=0   S047=4   S048=0   S050=0   S051:253
    S056=17  S057=19  S058:2   S059:15  S060=0   S061:0   S062=15  S063=0  
    S064:1   S068=255 S069=0   S090=0   S092:1   S093=8   S094=1   S100=0  
    S104=0   S105=1   S111:30  S112=1   S151=4   S155=0   S180=2   S181=1  
    S183=25  S190=1   S191:6   S253=10  S254=1   S255=255 
    

    The modem is probably now working. But, it may take a few more tries to get it right. So, take a deep breath, figure out what isn't right, and correct it in little steps.


[Document Top] [Previous Section] [Next Section]

Case Study: Setting Up A Terminal

This is a sample of setting up a terminal for SunOS 4.x. The goal of this exercise is to set up a Wyse50 terminal (or terminal which emulates that) on cpu serial port ttya at 19200bps 7bits, even parity,using software flow control.

  1. Set up the /etc/gettytab file (See /etc/gettytab.)

    For this example, I can use the following generic Sun /etc/gettytab entry:

        g|std.19200|19200-baud:\
                :sp#19200:
    
  2. Turn off the getty process (See How to turn off getty for a port.)

    Edit /etc/ttytab's ttya line to read:

       ttya    "usr/etc/getty std.19200"       wyse50          off local
    

    Then execute the command:

         prompt# kill -1 1
    
  3. Set up ttysoftcar (See Setting ttysoftcar.)

    Execute the command:

         prompt# ttysoftcar -y ttya
    
  4. Set up the eeprom (See eeprom Settings.).

    Execute the commands:

         prompt# eeprom ttya-rts-dtr-off=true
         prompt# eeprom ttya-ignore-cd=false
         prompt# eeprom ttya-mode=19200,7,e,1,s
    
  5. Configure the getty process to spawn a login correctly. (See /etc/ ttytab.)

    Re-edit /etc/ttytab's ttya line to read:

       ttya    "usr/etc/getty std.19200"       wyse50          on local
    

    Then execute the command:

         prompt# kill -1 1
    
  6. Configure the terminal itself, setting up the baud rate, word length and parity, and flow control.

    Set up the terminal for 19200bps, 7bits, even parity, 1 stop bit, software (xon/xoff) flow control, wyse50 emulation. Attach the terminal to port A on the Sun with either a null-modem cable or a cable with at least pins 2,3, and 7, with pins 2 and 3 crossed, as in:.

        2------3
        3------2
        7------7
    

    You will probably now see a login prompt on the terminal. If not, check your work closely and try again.



[Document Top] [Previous Section] [Next Section]

Configuring Serial Ports for UUCP

Parity in UUCP

People often get confused about running UUCP in 7 bits vs. 8 bits vs. even vs. odd parity. Here's what's really going on and how to deal with it.

Both the caller and receiver must agree on parity (even, odd, none) during the login sequence. 7 or 8 bit word length often doesn't matter, if you "do the right thing" with parity.

Once the uucico's are running, UUCP's own protocol handles all these issues for you, but you need to be concerned with it during login.

There are 4 parity-related options you can set up during the login chat:

P_ZERO
8 bits, no parity
P_EVEN
7 bits, even parity
P_ODD
7 bits, odd parity
P_ONE
7 bits, "1" or Mark parity

be set for all uses of the port in /etc/uucp/Dialers file.

UUCP Parity-per-system example: Setting up a port within UUCP to run with 8 bits, no parity, on a per-system-connect basis.

In the file /etc/uucp/Systems, include P_ZERO in the chat script, as in:

        outhost Any ACU 9600 5551212 "" P_ZERO ogin: mylogin ssword: mypass

This means that when you first start trying to contact the machine "outhost" uucp expects nothing ("") and sets P_ZERO (8 bits, no parity or 8N1).

UUCP Parity-for-all-systms example: Setting up a port within UUCP to run with no parity, for all uses of this port.

(This example assumes you are using the "tbfast" entry in your /etc/uucp/Devices file)

In /etc/uucp/Dialers:

         tbfast  =W-,    "" P_ZERO "" \dA\pA\pA\pTE1V1X1......

Flow control with UUCP

With UUCP, either use hardware flow control or no flow control. Please remember that there is no incoming hardware flow control on Sun CPU serial ports, only outgoing hardware flow control. (There is no such limitation on non-CPU ports which claim to have hardware flow control.)

Sun has released a patch for some releases of Solaris 1.x to enable hardware flow control on some systems' CPU serial ports. It may work on your system, but it may not.

The lack of incoming hardware flow control is not a problem with UUCP, usually, because the UUCP protocol is robust enough to request retransmission of packets when the data isn't correct.

Using a good modem that has built-in UUCP protocol support (also known as spoofing) may also help your throughput. (This is a good use for a Telebit WorldBlazer.) If all else fails, slow down the connection between the Sun and the modem to what you can support in your environment.

The string "STTY=crtscts" tells UUCP to use hardware flow control. It's usually better to set this up on a per-port basis, rather than on a per-system basis, but UUCP will let you configure it however you want.

  1. UUCP HW flow for all systems:Setting up a port with UUCP to use hardware flow control for all uses of this port. (Preferred way)

    (This example assumes you are using the "tbfast" entry in your /etc/uucp/Devices file)

    In /etc/uucp/Dialers, add "STTY=crtscts" after the CONNECT:

            tbfast  =W-,  "" \dA\pTE1.... \EATDT\T\r\c CONNECT STTY=crtscts
    
  2. UUCP HW flow for some systems:Setting up a port with UUCP to use hardware flow control, on a per-system-connect basis. (Do this if you feel you must, but there are very few good reasons for it.)

    In the file /etc/uucp/Systems, include "STTY=crtscts" in the chat script, as in:

         outhost Any ACU 9600 5551212 ogin: mylog ssword: mypass "" STTY=crtscts
    



[Document Top] [Previous Section] [Next Section]

Vendor List

This list of vendors is vastly incomplete. The Unix Serial Port Resources page is more up to date.

These are just some of the companies whose products and/or services my readers, clients, and I have been usually satisfied with. If you have had a happy experience with other vendors of serial-port-based products for Suns, send me the info and I'll include them in this list.

Companies, their products, and their support staffs change regularly, so your "satisfaction mileage" may vary. (I don't receive any money or special favors from any of these folks, nor would I consider it. I'm just a picky consumer, like you.)

Serial cards:

Modems:

PPP:

Kermit:

Terminal Servers:

Publishers:

Celeste Stokely is an outspoken and pro-user Unix System Administration consultant who has been trying to make the world safer for Unix System Administrators since 1983. She lives in Austin, Texas and runs Stokely Consulting with her husband, Peter, and 2 bouncy cats, L.B. and Sparcy. Celeste can be reached via email at celeste@stokely.com.