Solaris USR Modem Configuration

home


One of the most popular modems in use is the U. S. Robotics Sportster v.32 (and v.90) models.  Inevitably, these modems do find their way to Solaris workstation and servers.  Configuring Solaris to use these modems should be straightforward.  Unfortunately, this task is not without some very frustrating and unforeseen complications.

For the impatient, skip down and read the A Working Configuration section.

Solaris Packages

Solaris supports outgoing modem communications with PPP and UUCP.  The Solaris bundled version of aspppd PPP (prior to Solaris 8 10/2001) and UUCP both share the same set of files for serial interface and modem configuration.  This article assumes both are properly installed.  And there are no conflicts with other Solaris PPP implementations.

As of the Solaris 8 10/2001 release, Sun PPP 4.0 (pppd) supersedes both the aspppd version of PPP and the unbundled Solstice PPP.  This version uses configuration files different, and unrelated, to the ones mentioned here.  Regardless, correctly configuring serial interfaces and modems for successful communication remains an issue.

A Non-Working (Obvious) Configuration

The files which configure the serial interface and modem, for PPP (aspppd) and UUCP, reside in /etc/uucp.  A straight forward configuration to use a U. S. Robotics Sportster modem requires just a few additions and modifications to the /etc/uucp/Systems and /etc/uucp/Devices files.

/etc/uucp/Systems defines dial-up host name targets, speed, phone numbers, and login sequences.  Entries for a PPP and a UUCP target resemble the following:

# name   time type class phone       login
pppisp   Any  ACU  19200 18005551212
uucphost Any  ACU  19200 17005554545 in:--in: nuucp word: secret
/etc/uucp/Devices associates "type" above with a physical serial port and a modem profile:
# type device - speed modemprofile
ACU    cua/b  - Any   usrv32-ec
Here, the modem is wired to the second workstation's onboard serial port (outbound device /dev/cua/b).  The usrv32-ec refers to one of the modem configuration profiles appearing in /etc/uucp/Dialers.  This is the profile entry intended for U. S. Robotics modems.

Immediately, there are two potential "gotchas":

The first problem is avoidable, assuming your aware of it of course.  The second requires some work with U.S. Robotics modem initialization strings.

Modem Initialization Strings

Many difficulties with modems are the result of improper or unknown configuration.  Modems have numerous settings for both its serial interface and telephone connect operations.  DIP switches define some settings.  Most others are set by computer, by sending initialization strings to the modem over it's serial interface.

The technical details of USR Sportster initialization strings are not included with the modem itself.  It's necessary to download these documents from the U. S. Robotics Data Modems support documents site.  The document Technical Reference Guide Sportster High Speed Modems are sp_asci.txt in plain text or sp_word.zip in word format.

Solaris PPP/UUCP obtains modem initialization strings from /etc/uucp/Dialers.  The default entries for USR Courier and Sportster models appear below.

/etc/uucp/Dialers

#   USR Courier V.32 and Sportster
#   Set the switches as follows:
#
#   1 2 3 4 5 6 7 8 9 10
#   U U D U U U D D D U         Courier
#   U U D U U U U D             Sportster
#
usrv32-ec =,-,  "" \dA\pTE1V1X1Q0S2=255S12=255&A0&H1&M5&B2\r\c OK\r \EATDT\T\r\c CONNECT STTY=crtscts,crtsxoff
usrv32-nec =,-, "" \dA\pTE1V1X1Q0S2=255S12=255&A0&H1&M0&B0\r\c OK\r \EATDT\T\r\c CONNECT STTY=crtscts,crtsxoff
There are two profiles, usrv32-ec and usrv32-nec.  The former requires modem error correction negotiations to succeed.  The latter specifically disables modem error correction.  Interpreting each of the modem initialization strings requires help from the Technical Reference Guide.

The initialization string for usrv32-ec in a more readable format is "AT E1 V1 X1 Q0 S2=255 S12=255 &A0 &H1 &M5 &B2"  A character which follows "\" controls the Solaris dialer, rather than the modem.  The modem tokens have the following meaning:

The differences with the non-error correcting modem profile are: Notice the use of &B0 and &B2 can cause the modem's serial port speed to change after dialing a telephone number and connecting.  This frequently creates an extremely frustrating symptom of hung communications between the Sun workstation and the modem.

One way to fix the problem is to replace &B0 (and &B2) with a &B1.  This setting locks down the modem's serial port speed, regardless of the modem's connect speed.  However, the better solution is to simply establish a new and better modem profile.

A Working Configuration

In a base working configuration, the desirable attributes for the modem and the serial port are as follows: The strategy for configuring the modem is to begin with manufacturer default settings.  Then make any additional adjustments as necessary.  For the U. S. Robotics, there are several manufacturer defaults.  The hardware flow control template is the one closest to the attribute list above, and may be set by sending "AT &F1" to the modem.

One additional adjustment is "S2=255" which disables the customary "+++" escape string detection that switches the modem from data to command mode.  This precaution prevents disconnects that could result if the escape string occurs as part of normal communications.  Forcing the modem to disconnect requires cycling the DTR serial port signal as hardware modem control dictates.

The resulting modem initialization string is:

AT &F1 S2=255
Incorporating this string into the Solaris PPP/UUCP configuration files results in the following working configuration:

/etc/uucp/Systems

# name   time type class phone       login
pppisp   Any  ACU  19200 18005551212
uucphost Any  ACU  19200 17005554545 in:--in: nuucp word: secret
/etc/uucp/Devices
# type device - speed modemprofile
ACU    cua/b  - Any   usrv32
/etc/uucp/Dialers
usrv32 =,-,  "" P_ZERO "" \dA\pT&F1S2=255\r\c OK\r \EATDT\T\r\c CONNECT STTY=crtscts,crtsxoff
The information in /etc/uucp/Systems sets the fixed serial port speed at the workstation.  "P_ZERO"  in /etc/uucp/Dialers sets zero parity and "STTY=crtscts,crtsxoff" sets hardware flow control.  Other required settings are defaults.

Testing

The following Solaris command are useful for testing the contents of the modem configuration files:
cu -d -L pppisp
and/or
cu -d -L uucphost
The "-d" option enables debugging output and "-L" runs the login script, if any, for the applicable name in the /etc/uucp/Systems file.  The output shows the interaction between the Solaris workstation and the modem.  Use "~." to exit and terminate cu.

Note the above commands only test the modem initialization and the dial-out process.  It does not test PPP or UUCP.  PPP setup still requires configuring /etc/asppp.cf (not discussed here).  For UUCP, the setup is complete, and other commands (like uutry) can exercise UUCP communications.

UUCP Dialer Codes

It's sometimes necessary to refine the UUCP dialer escape codes that's interspersed among the modem initialization strings.  These codes can specify special characters, control serial port settings, add delays, and initiate retries.  The escape codes are part of a script's expect/send sequence.  This sequence begins in the third column for /etc/uucp/Dialers, and the 6th column for /etc/uucp/Systems.

The codes for the Solaris implementation of UUCP are as follows:

\p        pause approximately 1/2 second
\d        delay approximately 2 seconds
\D        phone number
\T        phone number with /etc/uucp/Dialcodes and character translation
\N        null character
\K        insert a BREAK
\E        turn on echo checking (for slow devices)
\e        turn off echo checking
\r        carriage return
\c        suppress implied carriage return at the end of a "send" string
\n        new-line character
\nnn      octal number nnn
\b        backspace character
\H        ignores one hangup for dialback modems
\M        turn on CLOCAL flag; disables modem control
\m        turn off CLOCAL flag; enables modem control
\s        space character
\t        tab character
Special expects:
""                      skip this expect
expect1-send-expect2    if expect1 fails then do send and expect2
Special sends:
EOT                     send EOT, new-line, new-line
BREAK                   send BREAK
P_ZERO                  set zero parity
P_ONE                   set mark parity
P_EVEN                  set even parity (default)
P_ODD                   set odd parity
STTY=value1,value2      set stty mode value1 value2
Additional details about configuring Solaris UUCP files are available in the System Administration Guide, Volume 3 from the Solaris answerbook Solaris 8 System Administrator Collection.  These resources are included as part of the Solaris 8 operating environment.

Dial In

In a dial-in configuration, a Solaris workstation or server answers an incoming call via modem and presents a "login" prompt to the remote user.  The bundled Solaris utilities that implement this service do not include any files for modem initialization.  It's the responsibility of the system administrator to manually configure the modem before using it for dial-in services!

The easiest method to set up Solaris dial-in is by using the GUI admintool.  However, using the command line is more understandable with respect to underlying Solaris activity.  Establishing Solaris dial-in is initially confusing because several lengthy commands are necessary.  The first step is to add the ttymon port monitor to the service access facility:

# sacadm -a -p mbmon -t ttymon -c /usr/lib/saf/ttymon -v `ttyadm -V`
# sacadm -l
PMTAG          PMTYPE         FLGS RCNT STATUS     COMMAND
mbmon          ttymon         -    0    ENABLED    /usr/lib/saf/ttymon #
#
In the first command, "-a" is add, "-p" is a port monitor tag, "-t" is the port monitor type, "-c" is the port monitor executable, and "-v" specifies the port monitor version.  The "-l" in the second command means list.  Other sacadm options to note are: "-d" is disable, "-e" is enable, and "-r" is remove.

The second step is associating one or more physical serial ports with the port monitor.  These are the commands to add the second workstation's onboard serial port (inbound device /dev/term/b) to the port monitor:

# pmadm -a -p mbmon -s ttyb -i root -fu -v `ttyadm -V` -m "`ttyadm -b -d /dev/term/b -l 19200 -p 'ttyb login: ' -s /usr/bin/login -m ldterm,ttcompat -S n`"
# pmadm -l
PMTAG          PMTYPE         SVCTAG         FLGS ID       <PMSPECIFIC>
mbmon          ttymon         ttyb           u    root     /dev/term/b b - /usr/bin/login - 19200 ldterm,ttcompat ttyb login:  - - n  #
#
The options for pmadm are: "-a" is add, "-p" is a port monitor tag, "-s" is a service tag, "-i" is an id from /etc/password, "-fu" is a flag for creating /var/adm/utmpx entries, "-v" specifies the port monitor version, and "-m" is port monitor specific details in string form.  The options for ttyadm are: "-b" is bidirectional, "-d" is the device, "-l" is an entry from /etc/ttydefs, "-p" is prompt string, "-s" is an executable to invoke, "-m" is STREAMS modules to push, and "-S n" is no software carrier.  Other options to note for pmadm are: "-d" is disable, "-e" is enable, and "-r" is remove.

The third step is to configure the parameters for the serial port.  In the ttyadm command above, the 19200 is not the port speed.  It is an entry from /etc/ttydefs that sets serial port parameters.  The desirable settings are identical to those described earlier for dial-out.  The resulting /etc/ttydefs entry is:

/etc/ttydefs

19200:19200 -parenb cs8 -clocal hupcl crtscts crtsxoff:19200 -parenb cs8 -clocal hupcl crtscts crtsxoff::19200
The first 19200 is the name of the entry.  The first group of stty settings, which include the speed, apply immediately upon incoming connection.  The second group of settings apply just before Solaris executes /usr/bin/login.  The remaining colon separated columns indicate autobaud (disabled) and a link to the another /etc/ttydefs entry after BREAK detection.  This 19200 entry sets 19200 speed, hardware flow control (crtscts crtsxoff), modem control (-clocal), 8 bit no parity (-parenb cs8), and modem hangup (hupcl).  Modem hangup occurs when all Solaris processes close the /dev/term/b device.  Any other parameters are implicit defaults.

Finally, it's time to configure the modem.  Reliable attributes for a modem that accepts dial-in calls are:

The earlier "AT &F1 S2=255" USR modem initialization string for dial-out already sets most of the attributes we need.  To set the modem to answer, add "S0=1".  To disable modem generated status strings, use "Q1".  The reason to disable status strings is to prevent them from becoming the input into the Solaris login prompt.  It also prevents nasty character feedback loops since both Solaris and the modem (in command mode) echo characters they receive via their serial ports.

To send the modem's initialization string and to establish the modem's serial port speed, the system administrator can use the tip utility to initiate an outgoing connection.  The port monitor was previously set for bidirectional operation for this very purpose.  For inbound /dev/term/b, the outbound device is /dev/cua/b.

# tip -19200 /dev/cua/b
connected
AT &F1
OK
AT S0=1 S2=255
OK
AT Q1
~
[EOT]
#
Use "~." to disconnect tip.  At this point, the modem is ready for dial-in service.