Re: ppp and nokia 6630
- From: James Carlson <james.d.carlson@xxxxxxx>
- Date: 03 Jan 2006 07:29:12 -0500
"Rodolfo Medina" <romeomedina@xxxxxxxxx> writes:
> "" "\d\d+++\d\dATH"
> '' ATZ
That sequence is bogus.
You're not waiting for anything (""), then sending "+++ ATH", then not
waiting for anything (again!), and then sending ATZ.
At that point, your modem is in an indeterminate state. Almost
anything could be expected to happen. It's equivalent to just this:
"" "\d\d+++\d\dATH\rATZ"
because an empty expect string in the expect-send pair means "just
send; don't expect."
The failure you're seeing is because the input stream to chat now has
*multiple* "OK" strings buffered in it, and it's impossible to tell
which "OK" you're matching against. And, indeed, the confusion is
evident in the results:
Jan 3 00:28:02 localhost chat[4000]: send (ATD*99#^M)
Jan 3 00:28:02 localhost chat[4000]: expect (CONNECT)
Jan 3 00:28:02 localhost chat[4000]: ^M
Jan 3 00:28:02 localhost chat[4000]: AT+CGATT=1^MA^M
You send something new, but are still receiving old data from the
modem.
If you must use +++ here due to flaws in the modem, then you're going
to have to achieve sync with the modem's command interface. It won't
be simple. Here's one suggestion:
# various failure codes
ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT DELAYED
# Attempt to interrupt a left-over call and get the modem's attention.
"" '\d\d+++\d\dATH'
# We may now have zero or more "OKs" waiting for us. Send the factory
# reset command, then send an additional dummy command, and assume
# that the factory defaults include echo-on.
"" AT&F
OK ATS0=0
S0=0-ATS0=0-S0=0 '\c'
# Now we are back in sync and can send our commands. Note that the
# last expect string INTENTIONALLY has "\c" as the send string, so
# that we won't send a stray CR at the end of chat.
OK AT+CGDCONT=1,"IP","web.omnitel.it"
OK AT+CGATT=1
OK ATD*99#
CONNECT '\c'
--
James Carlson, KISS Network <james.d.carlson@xxxxxxx>
Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
.
- Follow-Ups:
- Re: ppp and nokia 6630
- From: Rodolfo Medina
- Re: ppp and nokia 6630
- References:
- ppp and nokia 6630
- From: Rodolfo Medina
- Re: ppp and nokia 6630
- From: Unruh
- Re: ppp and nokia 6630
- From: Rodolfo Medina
- Re: ppp and nokia 6630
- From: Unruh
- Re: ppp and nokia 6630
- From: Mikko Rapeli
- Re: ppp and nokia 6630
- From: Unruh
- Re: ppp and nokia 6630
- From: Mikko Rapeli
- Re: ppp and nokia 6630
- From: Rodolfo Medina
- Re: ppp and nokia 6630
- From: Rodolfo Medina
- ppp and nokia 6630
- Prev by Date: Re: ppp and nokia 6630
- Next by Date: Re: ppp and nokia 6630
- Previous by thread: Re: ppp and nokia 6630
- Next by thread: Re: ppp and nokia 6630
- Index(es):
Relevant Pages
|