Networking Forums

Networking Forums > Computer Networking > Linux Networking > GPRS / pppd

Reply
 
 
132.a.dabei
Guest
Posts: n/a

 
      07-17-2005, 05:25 PM
Hello World,

I've got a few problems / questions about dialing into a gprs network.


Here are my files:

1. /etc/ppp/options.gprs:
/dev/modem
debug
115200
defaultroute
ipcp-accept-local
ipcp-accept-remote
noauth
novj
connect 'chat -v -f chat.gprs'
user (E-Mail Removed)
usepeerdns
mru 1500
mtu 1500

2. /etc/ppp/chat.gprs:
TIMEOUT 5
ECHO ON
ABORT '\nBUSY\r'
ABORT '\nERROR\r'
ABORT '\nNO ANSWER\r'
ABORT '\nNO CARRIER\r'
ABORT '\nNO DIALTONE\r'
ABORT '\nRINGING\r\n\r\nRINGING\r'
'' \rAT
TIMEOUT 12
OK ATE1
OK 'AT+CPIN=3509'
OK 'AT+cgdcont=1,"IP","A1.net"'
OK ATD*99***1#
CONNECT '\d\c'

3. /etc/ppp/chap-secrets:
"(E-Mail Removed)" * "test"


When trying to dial-in with the scripts above the peer rejects me with
the follwing error:

linux:/etc/ppp # pppd file /etc/ppp/options.gprs
AT
OK
ATE1
OK
AT+cgdcont=1,"IP","A1.net"
OK
Serial connection established.
using channel 21
Using interface ppp0
Connect: ppp0 <--> /dev/modem
rcvd [LCP ConfReq id=0x1 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>
<auth pap>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xea8db58a> <pcomp>
<accomp>]
sent [LCP ConfNak id=0x1 <auth eap>]
rcvd [LCP ConfRej id=0x1 <magic 0xea8db58a>]
sent [LCP ConfReq id=0x2 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x2 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>
<auth pap>]
sent [LCP ConfNak id=0x2 <auth eap>]
rcvd [LCP ConfAck id=0x2 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x3 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>
<auth pap>]
sent [LCP ConfNak id=0x3 <auth eap>]
rcvd [LCP ConfReq id=0x4 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>
<auth pap>]
sent [LCP ConfNak id=0x4 <auth eap>]
rcvd [LCP ConfReq id=0x5 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>
<auth pap>]
sent [LCP ConfNak id=0x5 <auth eap>]
rcvd [LCP ConfReq id=0x6 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>
<auth pap>]
sent [LCP ConfRej id=0x6 <auth pap>]
rcvd [LCP ConfReq id=0x7 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>]
sent [LCP ConfAck id=0x7 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0x0]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3
0.0.0.0>]
rcvd [LCP TermReq id=0x8]
LCP terminated by peer
sent [LCP TermAck id=0x8]
rcvd [LCP EchoRep id=0x0 magic=0x0]
Modem hangup
Connection terminated.



I am not sure what that really means and I am irritated, because this
rejection only happens with one of my two modems:
It happens with my WaveCom Wismo Quik Q2501B (on baudrate 115200) but
not with my Falcom Twist (on baudrate 19200). I used exactly the same
scripts (except for the baudrate in "options.gprs").


Another question is:
How to submit a pin-code within the script?

If I re-submit the pin-code, the script fails:

linux:/etc/ppp # pppd file /etc/ppp/options.gprs
AT
OK
ATE1
OK
AT+CPIN=3509
ERROR
Connect script failed


I know that "at+cpin?" tells me if the pincode was alread submitted,
but I don't know how to build that into my scripts.

I would appreciate if someone was able to help me

yours

Herwig

 
Reply With Quote
 
 
 
 
Dan
Guest
Posts: n/a

 
      07-18-2005, 01:53 AM
On 17 Jul 2005 10:25:09 -0700, "132.a.dabei" <(E-Mail Removed)>
wrote:


>I am not sure what that really means and I am irritated, because this
>rejection only happens with one of my two modems:


It's probably the modem, or sim card. Do you use the same sim card?


>It happens with my WaveCom Wismo Quik Q2501B (on baudrate 115200) but
>not with my Falcom Twist (on baudrate 19200). I used exactly the same
>scripts (except for the baudrate in "options.gprs").


I was never very happy with Wavecom, although it's been a long time
since I used one. I would have hope they had got over their problems.


>Another question is:
>How to submit a pin-code within the script?
>
>If I re-submit the pin-code, the script fails:
>
>linux:/etc/ppp # pppd file /etc/ppp/options.gprs
>AT
>OK
>ATE1
>OK


>AT+CPIN=3509


I think you need quotation marks around the pin number:
at+cpin="3509"


>I know that "at+cpin?" tells me if the pincode was alread submitted,
>but I don't know how to build that into my scripts.


I had trouble getting a script to work for me. I ended up writing a
C++ program to do the modem initialisation.

Dan


 
Reply With Quote
 
132.a.dabei
Guest
Posts: n/a

 
      07-18-2005, 07:08 AM
Hi dan,

thank you for your suggestions.
It wasn't the sim-card. I had to rename the file "chap-secrets" into
"pap-secrets". That's kinda strange, because I really used the same sim
!?!?!

However: Using quotation marks around the pin code makes no change: the
script fails.

C++: I also started to write a program in c++: Sending AT commands to
/dev/ttyS0 is something easy. The point where I got stuck was: I had no
idea how to start the ppp connection after I initialized the modem. How
did you do that? If I knew how to implement ppp into my project, it
would be the best solution.

Thank you

Herwig

 
Reply With Quote
 
Dan
Guest
Posts: n/a

 
      07-18-2005, 12:19 PM
On 18 Jul 2005 00:08:35 -0700, "132.a.dabei" <(E-Mail Removed)>
wrote:

>The point where I got stuck was: I had no
>idea how to start the ppp connection after I initialized the modem. How
>did you do that? If I knew how to implement ppp into my project, it
>would be the best solution.



I'm trying to remember what I did. :-)

In the /etc/ppp/peers directory I have a ppp options file called
'gprs'. In that file, one of the options is:
connect /bin/g18
which is the C++ modem startup program. So pppd runs the modem
startup program itself.

Pppd runs the ip-up script after it's connected. I copy the
/etc/ppp/resolv.conf that pppd updated into /etc/resolv.conf

Have a good read of man pppd.

Dan
 
Reply With Quote
 
Clifford Kite
Guest
Posts: n/a

 
      07-18-2005, 04:30 PM
132.a.dabei <(E-Mail Removed)> wrote:
> Hello World,


> I've got a few problems / questions about dialing into a gprs network.



> Here are my files:


> 1. /etc/ppp/options.gprs:
> /dev/modem
> debug
> 115200
> defaultroute
> ipcp-accept-local
> ipcp-accept-remote
> noauth
> novj
> connect 'chat -v -f chat.gprs'
> user (E-Mail Removed)
> usepeerdns
> mru 1500
> mtu 1500


> 2. /etc/ppp/chat.gprs:
> TIMEOUT 5
> ECHO ON
> ABORT '\nBUSY\r'
> ABORT '\nERROR\r'
> ABORT '\nNO ANSWER\r'
> ABORT '\nNO CARRIER\r'
> ABORT '\nNO DIALTONE\r'
> ABORT '\nRINGING\r\n\r\nRINGING\r'
> '' \rAT
> TIMEOUT 12
> OK ATE1
> OK 'AT+CPIN=3509'
> OK 'AT+cgdcont=1,"IP","A1.net"'
> OK ATD*99***1#
> CONNECT '\d\c'


> 3. /etc/ppp/chap-secrets:
> "(E-Mail Removed)" * "test"



> When trying to dial-in with the scripts above the peer rejects me with
> the follwing error:


> linux:/etc/ppp # pppd file /etc/ppp/options.gprs
> AT
> OK
> ATE1
> OK
> AT+cgdcont=1,"IP","A1.net"
> OK
> Serial connection established.
> using channel 21
> Using interface ppp0
> Connect: ppp0 <--> /dev/modem
> rcvd [LCP ConfReq id=0x1 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>
> <auth pap>]
> sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xea8db58a> <pcomp>
> <accomp>]
> sent [LCP ConfNak id=0x1 <auth eap>]


The peer wants to authenticate you using PAP, but pppd wants it to use
EAP instead. The peer in this case may be a PPP implementation inside
the "modem" (whether the PPP negotiations are sent elsewhere over GPRS
for processing I don't know). The Nak suggesting EAP likely implies
/etc/ppp/srp-secrets exists and that the pppd refuse-pap and refuse-chap
options are used or there exist no {chap,pap}-secrets files. "Likely"
because EAP (Extensible Authentication Prococol) is new and I have no
experience with it.

In fact pppd _insists_ on EAP and eventually that leads to it terminating
the link.

Why you succeed using a different "modem" with the same host and pppd
options, except for speed, I cannot say - unless the successful one
provides for EAP in it's PPP implementation and the other does not.
(And I know nothing about GPRS pincodes.)

--
Clifford Kite Email: "echo xvgr_yvahk-(E-Mail Removed)|rot13"
 
Reply With Quote
 
Clifford Kite
Guest
Posts: n/a

 
      07-19-2005, 02:50 PM
132.a.dabei <(E-Mail Removed)> wrote:
> Hi dan,


> thank you for your suggestions.
> It wasn't the sim-card. I had to rename the file "chap-secrets" into
> "pap-secrets". That's kinda strange, because I really used the same sim
> !?!?!


It's not strange if the previously successful modem has an EAP
implementation that uses CHAP.

> However: Using quotation marks around the pin code makes no change: the
> script fails.


You might try adding "OK ATZ" just after "TIMEOUT 12" in the chat
script. That should flush modem buffers and reset the default profile.

> C++: I also started to write a program in c++: Sending AT commands to
> /dev/ttyS0 is something easy. The point where I got stuck was: I had no
> idea how to start the ppp connection after I initialized the modem. How
> did you do that? If I knew how to implement ppp into my project, it
> would be the best solution.


A wrapper containing the AT code followed by an execle command to start
"<directory-spec>pppd file /etc/ppp/options.gprs" should work in C -
dunno about C++.

--
Clifford Kite Email: "echo xvgr_yvahk-(E-Mail Removed)|rot13"
PPP-Q&A links, downloads: http://ckite.no-ip.net/
/* "Be liberal in what you accept, and conservative in what you send"
RFC 1122 */
 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      07-19-2005, 04:34 PM
Clifford Kite <(E-Mail Removed)> writes:


>You might try adding "OK ATZ" just after "TIMEOUT 12" in the chat
>script. That should flush modem buffers and reset the default profile.


Uh, use AT&F (or AT&F1 if it is a Sportster modem). This loads the factory
defaults -- ATZ is a crap shoot. It
depends entirely on what setup was saved by some person or some program
sometime in the past.

 
Reply With Quote
 
Clifford Kite
Guest
Posts: n/a

 
      07-19-2005, 05:42 PM
Unruh <unruh-(E-Mail Removed)> wrote:
> Clifford Kite <(E-Mail Removed)> writes:


>>You might try adding "OK ATZ" just after "TIMEOUT 12" in the chat
>>script. That should flush modem buffers and reset the default profile.


> Uh, use AT&F (or AT&F1 if it is a Sportster modem). This loads the factory
> defaults -- ATZ is a crap shoot. It
> depends entirely on what setup was saved by some person or some program
> sometime in the past.


The idea behind the suggestion to use ATZ was to flush the "modem"
buffers where something left-over from previous usage might cause
the ERROR. An old modem manual claims ATZ does this and resets
the modem to it's defaults. His chat script didn't show any AT&F
initialization so I didn't suggest that "OK AT&F" also be added.

Of course, this is GPRS "modem" and the old Hayes de-facto standard
can only serve as a guide when you don't have a modem command manual.
So ATZ may not work and/or also result in an ERROR.

--
Clifford Kite Email: "echo xvgr_yvahk-(E-Mail Removed)|rot13"
PPP-Q&A links, downloads: http://ckite.no-ip.net/
/* Better is the enemy of good enough. */
 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      07-19-2005, 06:11 PM
Clifford Kite <(E-Mail Removed)> writes:

>Unruh <unruh-(E-Mail Removed)> wrote:
>> Clifford Kite <(E-Mail Removed)> writes:


>>>You might try adding "OK ATZ" just after "TIMEOUT 12" in the chat
>>>script. That should flush modem buffers and reset the default profile.


>> Uh, use AT&F (or AT&F1 if it is a Sportster modem). This loads the factory
>> defaults -- ATZ is a crap shoot. It
>> depends entirely on what setup was saved by some person or some program
>> sometime in the past.


>The idea behind the suggestion to use ATZ was to flush the "modem"
>buffers where something left-over from previous usage might cause
>the ERROR. An old modem manual claims ATZ does this and resets
>the modem to it's defaults. His chat script didn't show any AT&F
>initialization so I didn't suggest that "OK AT&F" also be added.


>Of course, this is GPRS "modem" and the old Hayes de-facto standard
>can only serve as a guide when you don't have a modem command manual.
>So ATZ may not work and/or also result in an ERROR.


Fine, except as we both know, ATZ often is implimented to recall a prior
saved setup rather than factory defaults, and can itself be the source of
grief when those saved setting are insane (which often happens). Usually
(Hayes ) AT&F sets up factor default (except on the sportster modems where
AT&F sets up software flow control, and you have to use AT&F1) and is
usually safer. However, as you point out, the modem manufacturer can do
what they damn well please and they may have AT&F igniting a charge inside
the modem. (LG did that with their CD drives. They used a command that the
standards said should be invalid on a Read only drive-- reserved for RW
drives-- and instead had it destroy the PROM memory on the read only drive. )

Ie, I would advise him to use AT&F to start with. If that is an invalid
command, use ATZ. Of course reading the manual, if it exists is an even
better idea.


 
Reply With Quote
 
Clifford Kite
Guest
Posts: n/a

 
      07-19-2005, 08:34 PM
Unruh <unruh-(E-Mail Removed)> wrote:
> Clifford Kite <(E-Mail Removed)> writes:
>>Unruh <unruh-(E-Mail Removed)> wrote:


>>> Uh, use AT&F (or AT&F1 if it is a Sportster modem). This loads the factory
>>> defaults -- ATZ is a crap shoot. It
>>> depends entirely on what setup was saved by some person or some program
>>> sometime in the past.


>>The idea behind the suggestion to use ATZ was to flush the "modem"
>>buffers where something left-over from previous usage might cause
>>the ERROR. An old modem manual claims ATZ does this and resets
>>the modem to it's defaults. His chat script didn't show any AT&F
>>initialization so I didn't suggest that "OK AT&F" also be added.


>>Of course, this is GPRS "modem" and the old Hayes de-facto standard
>>can only serve as a guide when you don't have a modem command manual.
>>So ATZ may not work and/or also result in an ERROR.


> Fine, except as we both know, ATZ often is implimented to recall a prior
> saved setup rather than factory defaults, and can itself be the source of
> grief when those saved setting are insane (which often happens).


Point taken, and it certainly won't hurt to try AT&F and/or AT&F1
after ATZ, if that alone doesn't work.

As you said, the Sportster requires AT&F1 for RTS/CTS flow-control
- but it's the only (normal) modem I've ever known about that used
XON/XOFF in the factory default profile. I'm also not as certain as
you are that a profile restored by ATZ (or ATZ[0,1]) is often a bad
user-created profile, but readily admit I can't say it isn't either.

--
Clifford Kite Email: "echo xvgr_yvahk-(E-Mail Removed)|rot13"
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pppd & gprs PlutoPlanet Linux Networking 2 07-16-2007 06:04 PM
pppd & gprs cannot get ip (long message) Eismann Linux Networking 1 10-03-2006 11:51 PM
GPRS card connected to the GPRS network in Linux 2.6.15, can send SMS messages, but still no internet? D2army Linux Networking 10 02-19-2006 03:09 AM
Slackware, PPPD and GPRS Slacknix Linux Networking 3 02-13-2006 03:02 PM
pppd gotcha with ATT GPRS service using SE GC82 Phil Buonadonna Linux Networking 1 03-03-2004 03:35 PM



1 2 3 4 5 6 7 8 9 10 11