Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Mar 1997 15:09:31 -0600 (CST)
From:      "Lee Crites (AEI)" <leec@adam.adonai.net>
To:        freebsd-doc@freebsd.org
Subject:   dialup modem setup documentation
Message-ID:  <Pine.BSF.3.95.970327150816.26115E-100000@adam.adonai.net>

next in thread | raw e-mail | index | archive | help

I am thinking this is the right place to send this.  If I'm wrong,
please let me know where I should send it. 

After spending hours and hours sweating blood trying to get my dialup
modems to work, I finally got it!  I got pointers from several people
here and there, from a few web pages and faq's, and from phone calls to
hardware vendors.  But nowhere could I find the complete answer. 

What was the question?  How do you make dialup modems work?  I would
have thought this a pretty simple question which would be found in one
of several faqs. 

Since nobody has put something like this into the handbook, I thought
I'd toss something together.  I'm sure it will have to be prettied up
before it is acceptable as real documentation, but this is the raw
information to start with. 

Anyway, here's what I had to do to make my dialup modems work.  I am
using a digiboard, so keep that in mind.  However, one of the pointers I
got which was most helpful came from someone using a boca 16 port board,
so I assume the concepts are generic enough to be helpful no matter what
kind of board you are using. 

* kernel configuration and MAKEDEV are assumed to have already
  been done.

* change the /etc/rc.serial file to call modem() for each port
  you will be using.  Here's my modem() and call:

  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  modem() {
    # Modem that supports CTS and perhaps RTS handshaking.

    ci=$1; shift # call-in device identifier
    co=$1; shift # call-out device identifier

    for i in $*
    do
        # may depend on modem
        comcontrol /dev/tty$ci$i dtrwait 100 drainwait 180
        # Lock crtscts on.
        # Speed reasonable for V42bis.
        stty </dev/ttyi$ci$i crtscts 115200
        stty </dev/ttyl$ci$i crtscts
        stty </dev/cuai$co$i crtscts 115200
        stty </dev/cual$co$i crtscts
    done
  }
  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  ...
  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Initialize all ports on a Cyclades-16ye.
  # modem    c c  0 1 2 3 4 5 6 7 8 9 a b c d e f 

  # Initialize all ports on a Digiboard 8.
  #modem D D 00 01 02 03 04 05 06 07
  modem D D 00 01 02 03 07
  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  The first 'D' is what you find in the tty (ttyD), and the second
  'D' is what you find after the cua (cuaD).  The parms after that
  are for the alphanumeric string in the device name *after* the
  'D'.  Mine are ttyD00 through ttyD07 and cuaD00 through cuaD07, so
  I have to put the leading zero there.

* add the devices to the /etc/ttys file.  Mine look like this:

  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  ttyD00 "/usr/libexec/getty std.115200" dialup on insecure
  ttyD01 "/usr/libexec/getty std.115200" dialup on insecure
  ttyD02 "/usr/libexec/getty std.115200" dialup on insecure
  ttyD03 "/usr/libexec/getty std.115200" dialup on insecure
  ttyD04 "/usr/libexec/getty std.115200" dialup off insecure
  ttyD05 "/usr/libexec/getty std.115200" dialup off insecure
  ttyD06 "/usr/libexec/getty std.115200" dialup off insecure
  ttyD07 "/usr/libexec/getty std.115200" dialup off insecure # loopback plug
  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  Whatever you have here for the line speed (115200) should match what
  you have in the /etc/rc.serial above.  You might also check /etc/gettytab
  to make sure there is a std.115200 line.  If it's not there, this is
  what it looks like:

  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  g|std.19200|19200-baud:\
      :np:sp#19200:
  std.22800|22800-baud:\
      :np:sp#22800:
  std.38400|38400-baud:\
      :np:sp#38400:
  std.57600|57600-baud:\
      :np:sp#57600:
  std.115200|115200-baud:\
      :np:sp#115200:
  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

* Now, talk to the modem(s).  I use the 'tip' program.  I got several
  suggestions about using 'cu' for communicating with the modem, but
  tip worked as well or better for me.

  To use it, you need to set up /etc/remote.  Here's what I added:
  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  cuaD00|D00|D0:dv=/dev/cuaD00:br#115200
  cuaD01|D01|D1:dv=/dev/cuaD01:br#115200
  cuaD02|D02|D2:dv=/dev/cuaD02:br#115200
  cuaD03|D03|D3:dv=/dev/cuaD03:br#115200
  # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  Then I could access the modem with the command:
      tip -v -115200 D00

* So far this has been setup stuff on the FreeBSD end.  All of this was
  well enough documented that I had it done right off.  It's only included
  here for completelness.  All of the above took me the better part of
  one afternoon to figure out and set up.

* Now comes the blood, sweat, and tears part...  Setting up the modem.
  Without going through what it took to get to here, I'll just tell you
  what modem configuration parameters are needed, and why.  This is the
  order I execute the commands.

  -- at&f (load factory defaults)
     Start with a standard configuration.

  -- at&C1 (select data carrier detect (dcd) option)
     Some modems need &C0 and some need &C1.  You want dcd to follow
     carrier detect.  I needed &C1.

  -- at&Q5 ((operational mode option)
     &Q5 selects error-control mode.  Negotiation options are controlled
     by S36

  -- atS36=7 (protocol negotiation fallback)
     Try V.42 first, fall back to standard asynchronous connection with
     automatic speed buffering(asb).

     This is an important one, folks.  This allows the modem to buffer
     the differences between the input at one baud rate and the output
     at another baud rate.  More on that later.

  -- at&K3 (local and end-to-end flow control options)
     &K3 enables RTS/CTS flow control.  This is also flagged above by
     the crtscts option in the modem() function.  Another biggie.

  -- atS0=1 (ring number to answer)
     Tell the modem to answer on the first ring. Auto-answer mode.

  -- atE0 (echo mode)
     Don't echo back.  You don't want the modem's responses picked up
     by the cpu.  It won't be able to distinguish the modem responses
     from your keystrokes.

  -- atQ1 (enable/disable result codes)
     Turn off result codes.  (don't mix this up with the &Q option above)
     Again, you don't want the modem talking to the cpu at all.

  -- at&Y0 (select stored profile on power-up)
     I guess this is optional, and perhaps not even a part of all modems.
     My modems had multiple configuration save areas so you could store
     several different configurations and recall them at will.

  -- at&W0 (write configuration)
     Since I'm auto-loading configuration zero, I also write to config
     zero.

  Since anything after the E0Q1 doesn't return anything, I actually do all
  of this as a single command:

    at&f&c1&q5s36=7&k3s0=1e0q1&y0&w0

* While still in tip, I try dialing in.  I used procomm on a pc we have here.
  What I type on the pc should show up on the tip screen and what I type in
  tip shows up on procomm.

* I actually did all of my testing while in tip and without the e0q1 part so
  I could see what was going on.  I then did ate0q1&w0 before I got out of
  tip.

So, y'all, wat'cha think?  Is this a good enough start on some
documentation for it to be of some value?  Or, <shutter to think>, is
this already in some very nice format in the handbook and I was just too
brain-dead to find it? 

Any hints or ideas are welcome.

Lee Crites
leec@adonai.net





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970327150816.26115E-100000>