wvdial sends different modem commands using or not using -c

418 views
Skip to first unread message

Zhang Weiwu

unread,
May 15, 2010, 6:36:54 AM5/15/10
to wvstrea...@googlegroups.com
Hello. The manual says

-c, --chat
Run wvdial as a chat replacement from within pppd, instead of
the more normal method of having wvdial negotiate the connection
and then call pppd.


I took it as if I configure wvdial work fine, then I can use it as chat
by simply adding -c. On my Ubuntu 10.04 it doesn't behave that way. In
short, wvdial runs fine, but if used with -c, output different commands
than it used to.

Please kindly redirect me to the right forum if I asked in the wrong
place. Please also kindly point out if I misread the manual.

Here are command output, at the bottom of the email followed my
/etc/wvdail.conf

# /usr/bin/wvdial --chat
--> WvDial: Internet dialer version 1.60
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
--> Re-Sending: ATZ
--> Modem not responding.

# /usr/bin/wvdial -c
--> WvDial: Internet dialer version 1.60
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
--> Re-Sending: ATZ
--> Modem not responding.
root@orphalese:/etc/ppp/peers# wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat May 15 18:23:13 2010
--> Pid of pppd: 2627
--> Using interface ppp0
--> pppd: ¨@F[08][08]AF[08]
--> pppd: ¨@F[08][08]AF[08]
--> pppd: ¨@F[08][08]AF[08]
--> pppd: ¨@F[08][08]AF[08]
--> pppd: ¨@F[08][08]AF[08]
--> local IP address 115.149.66.69
--> pppd: ¨@F[08][08]AF[08]
--> remote IP address 115.168.14.55
--> pppd: ¨@F[08][08]AF[08]
--> primary DNS address 202.101.224.68
--> pppd: ¨@F[08][08]AF[08]
--> secondary DNS address 202.101.224.69
--> pppd: ¨@F[08][08]AF[08]
[cut from here, connection is now set up properly]

Following are my /etc/wvdial.conf

$ cat /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
ISDN = 0
Phone = *99***1#
Modem = /dev/ttyUSB0
Username = CARD
Password = CARD
Baud = 921600
Stupid Mode = 1
[Dialer Old]
#Init1 = ATZ
#Init3 = ATE0V1
#Init5 = ATS0=0
#Init6 = AT+CFUN=1
#Init1 = ATZ
#Init2 = AT&FE0V1&C1S0=0
#Init3 = AT+cgdcont=1,"IP","CMNET","",0,0
Modem Type = USB Modem
Phone = #777
Modem = /dev/ttyUSB0
Username = MYCARD
Password = MYCARD
New PPPD = yes
[Dialer HS]
Init1 = AT+CGDCONT=1,"IP","internet"
Modem = /dev/ttyACM0
Phone = *99#
Username = internet
Password = internet
[Dialer CM]
Modem = /dev/ttyACM0
Phone = *99***2#
Username = CARD
Password = CARD


--
You received this message because you are subscribed to the Google Groups "wvstreams-devel" group.
To post to this group, send email to wvstrea...@googlegroups.com.
To unsubscribe from this group, send email to wvstreams-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wvstreams-devel?hl=en.

Avery Pennarun

unread,
May 15, 2010, 1:33:50 PM5/15/10
to Zhang Weiwu, wvstrea...@googlegroups.com
On Sat, May 15, 2010 at 6:36 AM, Zhang Weiwu <zhang...@realss.com> wrote:
> I took it as if I configure wvdial work fine, then I can use it as chat
> by simply adding -c.

Not exactly. The idea is that you can use it as a *chat replacement*:
you'd call pppd yourself, and tell pppd to call "wvdial --chat"
instead of normal chat.

> wvdial runs fine, but if used with -c, output different commands
> than it used to.
[...]
> # /usr/bin/wvdial --chat
> --> WvDial: Internet dialer version 1.60
> --> Initializing modem.
> --> Sending: ATZ
> --> Sending: ATQ0
> --> Re-Sending: ATZ
> --> Modem not responding.
...
> root@orphalese:/etc/ppp/peers# wvdial
> --> WvDial: Internet dialer version 1.60
> --> Cannot get information for serial port.
> --> Initializing modem.
> --> Sending: ATZ
> ATZ
> OK
> --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
> ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
> OK

The problem is that if you run "wvdial --chat" all by itself, it's not
talking to a modem - it's talking to *you*. And *you* failed to say
"OK" when wvdial said "ATZ". When that happened, wvdial tried to fall
back to get you to start talking. If you had responded, it would have
proceeded with the usual init string you see in the second session
above.

(You can actually try this: try typing "OK" and then pressing enter
when it says ATZ.)

Have fun,

Avery

Zhang Weiwu

unread,
May 15, 2010, 8:02:24 PM5/15/10
to wvstrea...@googlegroups.com
On 2010年05月16日 01:33, Avery Pennarun wrote:
> On Sat, May 15, 2010 at 6:36 AM, Zhang Weiwu <zhang...@realss.com> wrote:
>
>> I took it as if I configure wvdial work fine, then I can use it as chat
>> by simply adding -c.
>>
> Not exactly. The idea is that you can use it as a *chat replacement*:
> you'd call pppd yourself, and tell pppd to call "wvdial --chat"
> instead of normal chat.
>
Yes, I am aware of this. I had experimented it with ppp before the
original post. When called from pppd, exactly the same thing happened
(that wvdial sends different modem commands and quit for modem not
responding). In an attempt to separate the problem before posting (so
that i know to post to ppp list or to wvdial list), I had decided that I
should try without pppd to make sure it works correctly at least for
sending the first a few commands before when pppd is needed. That's how
you see the first email.

I still believe the manual suggests using or not using -c, the command
to be sent to modem should be the same, although I expect different
behavior when later carrier detected and trying to set up ppp connection.

Here is what happens when called from pppd:

# pppd call dod
--> WvDial: Internet dialer version 1.60
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0TQ0
--> Re-Sending: ATZZ
--> Modem not responding.

And the referred script, /etc/ppp/peers/dod, is as following:

~$ cat /etc/ppp/peers/dod
noauth
name wvdial
connect "/usr/bin/wvdial --chat Defaults"
usepeerdns
921600
modem
crtscts
defaultroute
usehostname
user CARD
noipdefault
usepeerdns
idle 0
logfd 6

Avery Pennarun

unread,
May 16, 2010, 6:12:12 PM5/16/10
to Zhang Weiwu, wvstrea...@googlegroups.com
On Sat, May 15, 2010 at 8:02 PM, Zhang Weiwu <zhang...@realss.com> wrote:
> When called from pppd, exactly the same thing happened
> (that wvdial sends different modem commands and quit for modem not
> responding).

Then your pppd is probably misconfigured. Perhaps it's using the
wrong baud rate or device.

Why aren't you just running wvdial in "normal" mode?

> I still believe the manual suggests using or not using -c, the command
> to be sent to modem should be the same, although I expect different
> behavior when later carrier detected and trying to set up ppp connection.

Once again: since the modem isn't responding, wvdial reacts
differently and doesn't send your normal init string. The problem
isn't wvdial, the problem is that your modem isn't answering, probably
because pppd is set up wrong.

Have fun,

Avery
Reply all
Reply to author
Forward
0 new messages