Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Feb 1997 11:17:21 -0600 (CST)
From:      "Jay D. Nelson" <jdn@qiv.com>
To:        questions@freebsd.org
Subject:   Solving pppd disconnect problems.
Message-ID:  <Pine.NEB.3.95.970209111159.409A-100000@acp.qiv.com>

next in thread | raw e-mail | index | archive | help
This is long and I apologize. These problems come up frequently so I
thought I'd add my two bits in the hope that it helps.

The first step is your modem. You must set up your modem with the
following characteristics:

	Hardware flow control.		(&K3)
	Echoing off.			(E0)
	Responses off.			(Q1)
	DCD follows remote carrier.	(&C1)
	DTR drop resets modem.		(&D3 on most, but varies)
	DSR active after answer.	(&S1)
	Use profile 0 on reset.		(&Y0 - more on this later)

Log on to your modem and type AT&K3E0Q1&C1&D3&S1&Y0&W0 <return>. Don't
be surprised when nothing comes back. The modem is doing exactly what
you told it.

These settings work for most Hayes compatible modems. USR Sportsters
use dip switches for some of them, Telebit a little different. In
other words, this is an RTFM situation. It is the characteristics that
are important -- not the specific register settings. &D3 seems to vary
the most and may not exist on your modem. Look for another register
that does the same thing. I use a Zoom modem with the following stored
in profile 0:

ACTIVE PROFILE:
B1 E0 L1 M0 N1 Q1 T V1 W1 X4 Y0 &C1 &D3 &G0 &J0 &K3 &Q5 &R1 &S1 &T5 &X0 &Y0
S00:001 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:050 S08:002 S09:006
S10:014 S11:095 S12:050 S18:000 S25:005 S26:001 S36:007 S37:000 S38:020 S44:020
S46:138 S48:007 S95:000 

This is what the modem restores after reset (&D3) and that's important
because you'll change those registers in your pppd chat script. (If
you add S0=1 to the above registers, your modem is now set for dial in
if you have ttyd<n> turned on in /etc/ttys.) The pppd chat script,
though needs verbose responses, at least, to do all the negotiation.
Because echoing is off, the __very first thing you must do__ in your chat
script is add 'ATE1Q0 OK' at the beginning of the send/expect
sequence. My logon script looks like this:

#!/bin/sh
/usr/sbin/pppd connect '/usr/bin/chat -v ABORT BUSY "" \
	\\d\\dAT\\sE1\\sQ0 OK \
	\\dAT\\sL1\\sS7=60\\sS38=40 OK \
	\\dATDT1234567 CONNECT "" ogin: username word: password' \
	/dev/cuaa1 115200 crtscts \
	modem lock kdebug 1 netmask 255.255.255.224 \
	noipdefault defaultroute :10.0.0.1 
exit 0

The empty double quotes after BUSY mean "Expect nothing -- since it
isn't coming anyway" Then, on the second line is "send AT E1 Q0 and
expect OK coming back." Now that echoing and responses are on, the
rest of the chat script works correctly but we've created a problem
when the pppd session is over. If the modem does not reset to a known
and quiet condition when it hangs up, the echoing and reporting left
on in the chat script make getty think someone is trying to log on. So 
getty and the modem end up in an endless chat between themselves and 
the line is tied up.

&D3 (or whatever does the same on your modem) drops DTR which lets
getty know the session is over. It also resets the modem. Since
you've stored echoing off, etc., which is now restored on reset, the
modem is quiet and getty sits quietly by waiting for the next
connection.

Hope this helps.

-- Jay






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.95.970209111159.409A-100000>