Solaris 2.x Modem Guide

This document was origianlly written by:
(Version 1.8a, 12/18/95 Christopher Kovacs)
(HTML and minor corrections 9/1/96 Bruce Riddle)

I. Introduction.
II. Initial Sun setup.
III. Modem Setup.
IV. Starting the Login Process.
V. Modem Guidelines.
APPENDIX A, Command line Modem Setup
APPENDIX B, Common Modem Initialization Strings
APPENDIX C, Troubleshooting Advice



I. Introduction.

The following information provides very basic and minimal modem installation
instructions. These instructions give details on installing a modem on a
Solaris 2.3/2.4 Sun system using the standard ttya or ttyb port. It describes a
common method and should prevent any issues or problems that might arise.
Follow. the procedures in sections II, III, and IV to try to install a modem.





II. Initial Sun setup.

1. Install the modem on the Sun system. Use either ttya or ttyb and
make sure that the rs-232 cable is a "straight through" cable with
pins 1-8 and pin 20 provided. (All 25 to 25 pin cable is ok to use.)

Do NOT Use a null modem (cross over) cable or a null modem gender/adapter
cable.

If you are using a system which shares ports a and b, such as the
sparc 10, Classic/LX, etc, and you would like to use port b for
the modem port, you must use the splitter cable. This splitter
cable is available from SunExpress. (p/n: X985A or 530-1869/C9.


2. Add the following entries to "/etc/ttydefs" file. This will be used
by the system for modem port speeds.

        38400m:38400 hupcl:38400 hupcl crtscts::38400m
        19200m:19200 hupcl:19200 hupcl crtscts::19200m
        9600m:9600 hupcl:9600 hupcl crtscts::9600m


Remember, the 14000 and 28800 baud rates are modem to modem speeds and
do not correlate to the actual modem port speed.


3. Verify that there is no port monitor services on the port that is being
configured by typing the command:

         pmadm -p zsmon -l



PMTAG          PMTYPE         SVCTAG         FLGS ID       <PMSPECIFIC>

zsmon          ttymon         ttya           u    root     /dev/term/a - - /usr/bin/login - 9600 ldterm,ttcompat login:  - vt100 y  #Terminal
zsmon          ttymon         ttyb           u    root     /dev/term/b - -/usr/bin/login - 9600 ldterm,ttcompat login:  - vt100 y  #Terminal 


If the services is present, as indicated by the above output, remove
the service by typing:

 
       pmadm -p zsmon -r -s (SVCTAG value from above, ie ttya or ttyb)




III. Modem Setup.
Modem setup is the responsiblity of the customer. This is due to the
various of types of modems and modem manufactures. The customer must
review the modem documentation and setup the modem according to the
guidelines requried by the Sun system (see section V). If there are
questions regarding modem setup, refer to the modem manufacture's
documentation and their support. Appendix B contains examples of modem
initialization/register setups. This information has been gathered and
may change due to modem firmware version levels, modems models and
added features. Use this only as a guide.

In order to set the modem registers up correctly, you must be able
to access the modem and it's port.


  1. Prepare to communicate with the modem using the tip utility program.
    The basic tip command is:

  2.         tip -9600 /dev/cua/a
    


    This command assumes a modem is attached to serial port A.
    It does not require editing of /etc/remote.

    For /etc/remote do the following:

    a. Modify the "/etc/remote" file and add the following
    entry to the file after the "hardwire:\" entry:

    For ttya port:

              hardwire:\
                 :dv=/dev/term/b:br#9600:el=^C^S^Q^U^D:ie=%$:oe=^D:
              modem1:\                            --- add this and next line
                 :dv=/dev/cua/a:br#9600:                    after above entry
                                   ^
                                   |_ appropriate baudrate*
    

    For ttyb port:

              hardwire:\  
                 :dv=/dev/term/b:br#9600:el=^C^S^Q^U^D:ie=%$:oe=^D: 
              modem1:\                            --- add this and next line
                 :dv=/dev/cua/b:br#9600:                    after above entry
                                   ^
                                   |_ appropriate baudrate*
    

    * When using a 28.8k modem, use 38400; for a 14.4 modem,
    use 19200; and for a 9600 modem use 9600.


    b. Change the permissions and owner of the modem port:

                    chmod 666 /dev/cua/a ; chown uucp /dev/cua/a
    

    -- or this for port b --

                    chmod 666 /dev/cua/b ; chown uucp /dev/cua/b
    

    c. After modifying the "/etc/remote" file and changing the
    permission of the port(s), start up a shell tool (if using
    openwindows) and issue the following command:

                    tip modem1
    


    you should get a "connected" message. If you get
    anything else, for example, "all ports busy",
    check the "/etc/remote" device entry.

    d. Verify that the modem is responding to commands type
    typing:

                    at <cr>
    


    you should see an OK displayed.

    Note/reminder - Execute tip in a shell tool
    without scrolling enabled, otherwise a carriage
    return (cr) is not sent.

    if not, check the connection and see if the RD or SD
    lights dimly flash when typing on the keyboard. If
    not, check the cable connection between the serial port
    and modem.


  3. Modem register/initialization

    a. Refer to Appendix B, Common Modem Initialization Strings,
    and look to see if the modem type is referenced. If so,
    set the dip switches and then use that string to initialize
    them modem. For example, the US Robotic Courier Modem:
  4.                 AT&F1&B1&C1&D2X0S0=1&W
    

    b. If you do not have the initialization string, refer to
    the modem manuals. The following lists the guide lines
    to set the modem registers. If you still can not figure
    out the initialation string, refer to the modem manfacture's
    technical support.

    c. After setting up the modem, exit the "tip" utility by
    typing the following sequence:

                            <CR>~.
    


    The above sequence is a "carriage return" followed by a
    "~" character and a "." character.

  5. Using CU


    You need 2 lines in the /etc/uucp/Devices file, for example:

    Direct cua/a - 9600 direct
    ACU cua/a - 9600 hayes

    Note: cua/a is referring to the modem control port /dev/cua/a. Use the
    appropriate port name but not the entire device name.

  6.         cu -d -s(speed) -l /dev/cua/a
    

    To connect to the port inorder to change modem registers
    with AT commands.
    NOTE: The port should be disabled when connecting to the
    port.

    -d option gives full debug output.

            cu -d -s(speed) (phone #) or (system name)
    

    Use for creating UUCP chat scripts and seeing keystrokes
    necessary for successful login.

    (system name) is first entry on line in /etc/uucp/Systems

            cu -sspeed -L (system name)
    

    Use -L for an automated login session. When logging in
    as a UUCP account you should see "SHERE=(machine)"
    This indicates uucico is active process. It will timeout.

            cu -b8 -d (phone number) or -L (system name)
    

    Use for 8 data bits. Otherwise cu defaults to 7 even parity.
    If the login hangs at the login prompt or the password
    prompt then cu is not able to communicate with the
    stty port settings on the answering machine.




IV. Starting the Login Process.

The following will now create a port monitor service to allow login
from a modem.


  1. Using the Administration Tool program (admintool), add a bidirectional
    modem service. If you can not use the admintool, refer to appendix A.

    1. Click on "Serial Port Manager" icon.

    2. Highlight the desired port with left mouse button.

    3. With the right mouse button, press the edit button once. Then
      with the right mouse button, press the "Modify Service" field.
      This will bring up a new pop up menu.

    4. Press the "Use Template" menu button with the right mouse button and
      select the "Modem - Bidriectional" menu item.

    5. Press the "Baud Rate: " menu button and select "Other".

    6. A new pop up window will appear. Enter either 38400m, 19200m, or
      9600m according to the desired baud rate of the modem. Then press
      the "Apply" button.

      Note- Use the 38400m entry for 28800 baud modems,
      the 19200m entry for 14400 baud modems, and 9600m entry
      for 9600 baud modems.


    7. Enter the type of terminal that is going to be logging into
      the system, ei vt100.

    8. Verify all fields that data was entered and then press the
      "Apply" button.

    9. Quit the admintool and it's windows.


  2. Verify that a port monitor was configured by typing the following
    command:
  3.         pmadm -p zsmon -l
    
    
    PMTAG          PMTYPE         SVCTAG         FLGS ID       <PMSPECIFIC>
    zsmon          ttymon         ttyb           u    root     /dev/term/b b -/usr/bin/login - 9600m ldterm,ttcompat login:  - dialup n  #Modem - Bidirectional
    


    If a port monitor is not listed for that port, go back to setup 3 and
    try again, make sure that when completing the fields, press the "Apply"
    button. If the port monitor still is not listed, call Sun support
    for further help.






    V. Modem Guidelines.

    Sun's policy about support of modems is strictly to give guidelines
    and not setting up individual modems and modem registers. The following
    guidelines are given below.





    How to resolve the error "All ports busy" when accessing a modem
    port?

    1. Disable or Delete the port monitor using admintool for that
      port. Then try the following using appropriate device:
    2.      tip -9600 /dev/cua/a
      
    3. Make sure you are not trying to access a device incorrectly
      specified in /etc/remote when using the tip command.
      Use the device /dev/cua/a, for example, and not /dev/term/a.

    4. There could be a permissions problem on the device.
      Change the permissions and owner of the modem port:

    5.         #chmod 666 /dev/cua/a
              #chgown uucp /dev/cua/a
      

      To verify the permission bits and owner use the following
      options to ls inorder to follow the link to the actual device.

              #ls -Ll /dev/cua/a 
      

      Note: If cu is abruptly killed the device will be left
      with an owner of the last user using cu.

    6. Check for a lock file in /var/spool/locks. If there is
      a lock file, for example LK.032.028.001, then cat the
      file. The number displayed is the PID of a process.
      Use the ps command above to determine if the process
      is still active. Try removing the lock file. IF you
      still get "All ports busy" then the process will need
      to be killed. If the process is defunct it can not be
      killed and rebooting will be necessary. This happens
      because the driver is waiting at an unkillable level
      for a device to respond.

    7. Another process has the port open. This might be another tip
      session or another program like lp. It could also be a port monitor.
    8.         #ps -ef |grep tip
      

      Do the following as root: (use appropriate device)

         #fuser /dev/cua/a 
         /dev/cua/a:      652o     651o 
                                       
         #ps -ef | grep 652
         #ps -ef | grep 651
      

      The process id's, PID's, are 652 & 651 ( drop the o )

      If the process using the port is /usr/bin/login or ttymon then
      either somebody has dialed into your machine hence the modem
      will be active or the modem may be asserting DCD all the time.
      Inwhich case check the jumpers and modem settings.

    9. IF the process is "ttymon" there are 2 ways to kill the
      process. The easiest is to use the admintool and select
      the port -> Edit -> Delete Service. You should now
      be able to tip or cu to the port. (The modem is no longer
      configured for dial-in)

      The command to remove the service is as follows:
    10.    #pmadm -r -p zsmon -s (SVCTAG)
      

      (use pmadm -l to determine SVCTAG)

    11. Try bringing system down to single user mode and then back
      up to multiuser mode.
    12.    exit Windows
         init S
         type control-d
      
    13. The following removes the devices and recreates them without
      rebooting. (Do not perform a boot -r if a SparcStorage Array exists)

      a) To determine the physical device name:

    14.    ls -al /dev/term/a
         lrwxrwxrwx   1 root     root          32 Jul 27  1995 /dev/term/a -> 
         ../../devices/obio/zs@0,100000:a
      
      
         cd /devices/obio
         ls zs*:a*                     
         zs@0,100000:a     zs@0,100000:a,cu
        
         ls -al zs*:a*
      crw-------   1 lp       tty       29,  0 Feb 19 14:01 zs@0,100000:a
      crw-rw-rw-   1 uucp     uucp      29,131072 Dec 26 14:08 zs@0,100000:a,cu
      


      There are 2 physical devices for a serial port. Each has a different
      minor number which allows the operating system to identify which
      driver to use. The a,cu (/dev/cua/a) device is typically used for
      modem control and outgoing transactions.

      b) remove the devices:

         rm zs*:a*             
      

      c) then remove the links

         cd /dev/term
         rm a
         cd /dev/cua
         rm a
      


      d) Recreate the devices in /devices and then use ports to
      recreate the links.

         /usr/sbin/drvconfig  
         /usr/sbin/ports    
      


    15. Sometimes a complete reboot is necessary inorder to achieve
      a hardware reset on the port.





    A P P E N D I X A
    The following procedure is provided for users that do not have access
    to openwindows interface and can not use the admintool.


    Setting up Bi-directional modem service from the command line.


    1. Check to see if a zsmon process is running under SAC by typing the
    following command:

    # sacadm -l
    PMTAG          PMTYPE         FLGS RCNT STATUS     COMMAND
    tcp            listen         -    0    ENABLED    /usr/lib/saf/listen tcp #
    zsmon          ttymon         -    0    ENABLED    /usr/lib/saf/ttymon #
    


    2. If you do not see a zsmon entry under PMTAG, execute the following
    command:

      sacadm -a -p zsmon -t ttymon -c /usr/lib/saf/ttymon -v `ttyadm -V`
    

    Check again to see if the zsmon entry is present (STATUS will be
    STARTING, this is normal).

  4. Check to see if a zsmon port monitor is present by executing the
    following command:
  5.          pmadm -p zsmon -l
    PMTAG          PMTYPE         SVCTAG         FLGS ID       <PMSPECIFIC>
    zsmon          ttymon         ttyb           u    root     /dev/term/b b -/usr/bin/login - 9600m ldterm,ttcompat login:  - - n  #Modem - Bidirectional
    
    


  6. If a port monitor for zsmon is present, remove it by executing the
    following command:
  7.         pmadm -r -p zsmon -s (SVCTAG)
    

    Note - the (SVCTAG) value is found by using the output of the previous
    command. In the above example, this value will be "ttyb".


  8. Now configure your port monitor:

    a. Create/edit a file called pm_script. See below:

    Note- remember to change the service name, port, and baud rate
    of the script to match or installation environment.

  9. ---- begin script -------
    #!/bin/sh
    #script to add a port monitor
    
    
    PATH=PATH$:/usr/sbin:
    export PATH
    
    # Below is the ttydefs entry for baudrate usuage.  Use one of the
    # following, 38400m, 19200m, or 9600m
    ttydefs=9600m
    
    # Below specifies the port to use. Use either "/dev/term/a" or "/dev/term/b"
    mport=/dev/term/b
    
    # Below specifies the service name. Use either "ttya" or "ttyb" depending
    # on the port being used.
    service=ttyb
    
    # Note that the single quote characters in the command line below are a
    # "back quote" or "back tick".  This is normally found below the double
    # quote key ("). This is noted for clarity since some printers do not
    # print this character correctly and is printed as a "forward quote" or
    # "forward tick" character.
    
    pmadm -a -p zsmon  -s $service -i root -fu -v `ttyadm -V` -m "`ttyadm -Sn \
      -d $mport -b -m ldterm,ttcompat -l $ttydefs -s /usr/bin/login`" \
      -y "Modem - Bidirectional"
    ------- end script -----------
    



  10. Change the permission of the file for execution and execute the
    script (chmod 755 pm_script).


  11. Verify port monitor is present:

    Note - The entry should look like the output below but the
    baudrate and service tag may be different.
  12. # pmadm -p zsmon -l
    PMTAG          PMTYPE         SVCTAG         FLGS ID       <PMSPECIFIC>
    zsmon          ttymon         ttyb           u    root     /dev/term/b b -/usr/bin/login - 9600m ldterm,ttcompat login:  - - n  #Modem - Bidirectional
    







A P P E N D I X B
Common Modem Initialation Strings

The following contains modem initialization strings to initailize modems for

use as dialin and dialout on Sun Solaris systems.

The following contains modem initialization strings to initailize modems
for use as dialin and dialout on Sun Solaris systems.


Hayes Optima/Acura Modems:

        AT&FN0Q2X0&C1&D2S0=1&W

US Robitics Courier Modems:

        AT&F1&B1&C1&D2X0S0=1&W
        dip switch settings:

                Switch          Setting
                  1               OFF
                  2               OFF
                  3               ON
                  4               OFF
                  5               OFF*
                  6               OFF
                  7               ON*
                  8               ON
                  9               OFF
                 10               OFF

US Robotics Modems:

        AT&F1&B1&C1&D2X0S0=1&W

Telebit T2500 modems in Conventional mode:

        AT&FQ2X0N0S0=1S37=0&C1&D2&K3&W1&W2

Telebit T2500 modems in Enhanced mode:

        AT&FS52=4Q9S131=1S58=2S68=255S95=0S150=2S50=0S51=5
        S51=5 (19200 bps)
        S51=4 (9600 bps)


GVC 288 V.34 Modem:

        AT&F2E0Q1S0=1&C1&D2&W&W1

Black Box Corporation, Modem 144FX:

        ATN0S37=0S0=1Q1&C1&D2&K3&W

Addition on US Robotics Sprtster Modems:

US Robotics Sportster 14400
(ati4 and ati5 - to see modem settings)
 
	sport144 =,-, "" ATZ&B1&H1&K3&R2V1X4Q0T\r\c OK\r ATD\T\r\c Speed
	 
	or try
	 
	spoort144 =,-, "" AT&A0&B1&C1&D2&H1&K3&R2V1X4Q0T\r\c OK\r ATD\T\r\c CONNECT
 	
	&B1 - fixed serial port rate  (&B0 is for variable rate and must
	      use cycling baud rate in ttydefs)
	&H1 - hardware flow control
	&K3 - data compression. enable v.42 bis and disable MNP5 compression
	&R2 - receive data to computer only on RTS (to be used with &H1)
	V1  - verbal result code
	X4  - full result code set
	Q0  - display result codes
	T   - tone dial
 
	If UUCp connections hang at the Shere=system prompt, try replacing
	&K3 with &K0, data compression disable.
 
	US Robotics Sportster 14400 - I found success with &f&b1&h2&w
	This is for fixed DTE and no flow control.

	US Robotics Sportster 28800
	the following is what could be used in a dialer string:
 
		AT&F1E0Q0T&B1&D2&C1S0=1S2=043
			for modem hangup:
			ATQ0H0
			for modem reset:
			ATQ0Z0
			for modem dialin:
			ATs0=1Q1






A P P E N D I X C
Troubleshooting Advice

This section contains the most common problems of installing a modem
on a Sun Solaris system. Most of all problems are the result of having
the modem incorrectly configured.


"Garbage from Sun system with remote system logging in"

This usually is an indication that the modem speed and the configured
port monitor speed is not matched. Check the modem speed and make
certain that it matches the speed of the Sun system. Connect back to
the modem, using tip, and verify modem configuration. Remember, the
modem must be able to lock the modem speed and match the port monitor
speed (speed configured using the admintool.

---------------------------------------------


"When I make a call, the remote modem answers, I can hear the modems
negotiating, then the modem hangs up CALL FAILED."

This is probably down to a setting on one or both modems forcing it to
use a particular connect speed or compression protocol - if one modem
can't manage to connect up to the other modem, the modem will hang up.
Check settings of BOTH modems.

---------------------------------------------


"What does "all ports busy" from the tip utility mean?"

Another process has the port open - this might be another tip session
or anotherprogram like lp. It could also be a port monitor.

The way to find out is:

As root if the device is /dev/cua/a

  fuser /dev/cua/a
  /dev/cua/a:      652o     651o      ---- These are the processes using this port.


You can now use ps -ef to get the program that is using the port.

NB: PID's are 652 & 651 ( drop the o )

If the process using port is /usr/bin/login or ttymon then:

1. Either somebody has dialed into your machine - modem will be active.
2. Modem is asserting DCD all the time. The modem must be configured
so that the Data Carrier Detect is asserted only when a carrier is
detected from the remote modem. Refer to the modem documentation.

---------------------------------------------


"What does 'permission denied or link down' message fro tip utility
mean?"

Make sure you have "dv=/dev/cua/a" or "dv=/dev/cua/b" in the
hardwire entry of the "/etc/remote" file. Check also for
"/var/spool/locks" for a lock file LCK.* and remove that file.
Check the permissions on the serial device (/dev/cua/a or
/dev/cua/b) and ownership.

---------------------------------------------


"Modems do not disconnect properly or user stays logged in even after
disconnecting."

The modem is not configured correctly. The modem must be configured
so that the Data Carrier Detect is asserted only when a carrier is
detected from the remote modem. Refer to the modem documentation.

---------------------------------------------


"Nothing happens when trying to tip to the modem"

Check cabling to the modem. Check to see if the proper port is being used.
Also, make certain that "tip" is being used in a shell tool NOT a command
tool.


"When dialing into the sun, the modems never pick up the phone."

The modem is not configured properly. Check to see if the modem is
setup For auto answer modem (usually S0=1). Make sure that the DTR
or TR light is lit on the modem indicating that the Data Terminal
Ready is asserted from the sun. If it is not, the ttymon process is
either hung or is not running. Try re-initialing the port for
bi-directional modem use.

---------------------------------------------


"Parity problems"

I get a login but its corrupted, (Logn: or Logi ) if I press (RETURN)
nothing happens but it does if I press (LF) or "control-J".
Re-configure the remote computers serial port setup for 8 data bits,
1 stop bit, and no parity.


---------------------------------------------


"I can't login, password fails."

This is a parity problem - The originating terminal / tip session is
using a parity that is different from that used by the ttymon.

---------------------------------------------


"When do you modify the eeprom settings?"

Don't change the eeproms unless you are trying to get a terminal
working at boot prom level.

---------------------------------------------


"No login prompt"

Check to see if a ttymon process is started, type the command below:

   ps -ef | grep ttymon
      root   208   204 80   Sep 21 ?        0:01 /usr/lib/saf/ttymon
      root 17258   208  2 10:42:43 ?        0:00 /usr/lib/saf/ttymon


The pid of 208 is the parent ttymon process and the pid of 17258 is
the child process for term/b.

Call into the system and see if the ttymon process TTY has changed
from "?" to "term/b". See below:

   ps -ef | grep ttymon
    root   208   204 80   Sep 21 ?        0:01 /usr/lib/saf/ttymon
    root 17258   208  6 10:42:43 term/b   0:00 /usr/lib/saf/ttymon


If this does not occur, check to see of the serial port has been
configured properly and the port monitor service is present by
typing:

   pmadm -p zsmon -l 
 PMTAG          PMTYPE         SVCTAG         FLGS ID       <PMSPECIFIC>
 zsmon          ttymon         ttyb           u    root     /dev/term/b b - /usr/bin/login - 9600m ldterm,ttcompat login:  - tvi925 n  #Modem - Bidirectional


Also check and verify that the port monitor service baudrate matches
the modem baudrate. Use the tip utility and connect back into the
modem.