Ecos, LwIP, PPP and GPRS

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello,

I'm trying to get a GPRS PPP connection going in eCos using the LwIP
stack, but no luck so far.

It seems that my provider and the LwIP PPP code do not understand each
other. I', trying to find examples of correct communication but have
had no luck so far and RFC1661 is a bit hard to decode. Does anyone
know good links to information on this subject? Google has not come
up with many insightfull links for me.

For experts in debugging PPP communication, can you make any sense of the
following log data? I had to capture sending and receiving to the modem
separately, so the below parts should be intermixed.

There seems to be some communication and even user/pass sending and I get
a "Welcome!", but after that it dies somewhere.

If I turn on LWIP debugging, I see lots of "invalid" FCS messages. But
debugging uses diag_printf(), which turns off interrupts and therefore
might introduce character loss.


Sent to modem:

0000   41 54 5A 0A  41 54 20 53  30 3D 30 20  45 30 0A 41  ATZ.AT S0=0 E0.A
0010   54 2B 43 47  44 43 4F 4E  54 3D 31 2C  22 49 50 22  T+CGDCONT=1,"IP"
0020   2C 22 77 65  62 2E 76 6F  64 61 66 6F  6E 65 2E 6E  ,"web.vodafone.n
0030   6C 22 0A 41  54 44 54 2A  39 39 23 0A  7E FF 7D 23  l".ATDT*99#.~.}#
0040   C0 21 7D 21  7D 21 7D 20  7D 34 7D 22  7D 26 7D 20  .!}!}!} }4}"}&}
0050   7D 20 7D 20  7D 20 7D 25  7D 26 52 7D  38 7D 30 44  } } } }%}&R}8}0D
0060   7D 27 7D 22  7D 28 7D 22  6E E1 7E FF  7D 23 C0 21  }'}"}(}"n.~.}#.!
0070   7D 21 7D 22  7D 20 7D 2E  7D 22 7D 26  7D 20 7D 20  }!}"} }.}"}&} }
0080   7D 20 7D 20  7D 27 7D 22  7D 28 7D 22  87 3A 7E 7E  } } }'}"}(}".:~~
0090   FF 7D 23 C0  21 7D 22 7D  21 7D 20 7D  36 7D 21 7D  .}#.!}"}!} }6}!}
00A0   24 7D 25 DC  7D 22 7D 26  7D 20 7D 20  7D 20 7D 20  $}%.}"}&} } } }
00B0   7D 27 7D 22  7D 28 7D 22  7D 23 7D 24  C0 23 D0 47  }'}"}(}"}#}$.#.G
00C0   7E FF 03 C0  23 01 01 00  16 08 76 6F  64 61 66 6F  ~...#.....vodafo
00D0   6E 65 08 76  6F 64 61 66  6F 6E 65 9D  D5 7E 7E FF  ne.vodafone..~~.
00E0   03 80 21 01  01 00 16 03  06 00 00 00  00 81 06 00  ..!.............
00F0   00 00 00 83  06 00 00 00  00 6E DB 7E  FF 03 80 21  .........n.~...!
0100   02 01 00 0A  03 06 C0 A8  6F 6F DA D3  7E FF 03 80  ........oo..~...
0110   21 01 02 00  10 03 06 00  00 00 00 83  06 00 00 00  !...............
0120   00 28 15 7E  FF 03 80 21  01 03 00 0A  03 06 00 00  .(.~...!........
0130   00 00 E9 B3  7E FF 03 80  21 01 04 00  0A 03 06 C0  ....~...!.......
0140   A8 6F 70 DD  3D 7E FF 7D  23 C0 21 7D  26 7D 22 7D  .op.=~.}#.!}&}"}
0150   20 7D 24 94  7D 2D 7E                               }$.}-~

Received from modem:

                             E2  0A 0A 4F 4B  0A 0A 41 54         ...OK..AT
0160   20 53 30 3D  30 20 45 30  0A 0A 0A 4F  4B 0A 0A 0A   S0=0 E0...OK...
0170   0A 4F 4B 0A  0A 0A 0A 43  4F 4E 4E 45  43 54 20 39  .OK....CONNECT 9
0180   36 30 30 0A  0A 7E FF 7D  23 C0 21 7D  21 7D 21 7D  600..~.}#.!}!}!}
0190   20 7D 36 7D  21 7D 24 7D  25 DC 7D 22  7D 26 7D 20   }6}!}$}%.}"}&}
01A0   7D 20 7D 20  7D 20 7D 27  7D 22 7D 28  7D 22 7D 23  } } } }'}"}(}"}#
01B0   7D 24 C0 23  26 B4 7E 7E  FF 7D 23 C0  21 7D 24 7D  }$.#&.~~.}#.!}$}
01C0   21 7D 20 7D  2A 7D 25 7D  26 52 7D 38  7D 30 44 B4  !} }*}%}&R}8}0D.
01D0   C5 7E 7E FF  7D 23 C0 21  7D 22 7D 22  7D 20 7D 2E  .~~.}#.!}"}"} }.
01E0   7D 22 7D 26  7D 20 7D 20  7D 20 7D 20  7D 27 7D 22  }"}&} } } } }'}"
01F0   7D 28 7D 22  B9 B9 7E 7E  FF 7D 23 C0  21 7D 21 7D  }(}"..~~.}#.!}!}
0200   21 7D 20 7D  36 7D 21 7D  24 7D 25 DC  7D 22 7D 26  !} }6}!}$}%.}"}&
0210   7D 20 7D 20  7D 20 7D 20  7D 27 7D 22  7D 28 7D 22  } } } } }'}"}(}"
0220   7D 23 7D 24  C0 23 26 B4  7E 7E C0 23  7D 22 7D 21  }#}$.#&.~~.#}"}!
0230   7D 20 7D 2D  7D 28 57 65  6C 63 6F 6D  65 21 4E BC  } }-}(Welcome!N.
0240   7E 7E 80 21  7D 21 7D 21  7D 20 7D 2A  7D 23 7D 26  ~~.!}!}!} }*}#}&
0250   C0 A8 6F 6F  CD 49 7E 7E  80 21 7D 24  7D 21 7D 20  ..oo.I~~.!}$}!}
0260   7D 2A 81 7D  26 7D 20 7D  20 7D 20 7D  20 22 57 7E  }*.}&} } } } "W~
0270   7E 80 21 7D  24 7D 22 7D  20 7D 2A 83  7D 26 7D 20  ~.!}$}"} }*.}&}
0280   7D 20 7D 20  7D 20 73 89  7E 7E 80 21  7D 23 7D 23  } } } s.~~.!}#}#
0290   7D 20 7D 2A  7D 23 7D 26  C0 A8 6F 70  7D 2F 62 7E  } }*}#}&..op}/b~
02A0   7E FF 7D 23  C0 21 7D 25  7D 22 7D 20  7D 24 59 28  ~.}#.!}%}"} }$Y(
02B0   7E 0A 0A 45  52 52 4F 52  0A 0A 0A 0A  4E 4F 20 43  ~..ERROR....NO C
02C0   41 52 52 49  45 52 0A 0A                            ARRIER..

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)

I think I'll KILL myself by leaping out of this 14th STORY WINDOW while
We've slightly trimmed the long signature. Click to see the full one.
Re: Ecos, LwIP, PPP and GPRS
Quoted text here. Click to load it

The information below looks like a normal basic negotiation.  First LCP
is negotiated.  Then the peer is authenticated with PAP.  Then IPCP is
negotiated.  Your client first asks for several options that the "server"
doesn't care for, but they finally swap IP addresses and should be ready
to send IP traffic.  Then for some unknown reason, the "server" simply
sends a Terminate-Request to the "client".  How long does the whole process
take??

Quoted text here. Click to load it

Where is the LWIP output log?  I can't check the FCS by hand so I'll
have to trust the LWIP debug output.

Quoted text here. Click to load it

Good luck!

Patrick
========= For LAN/WAN Protocol Analysis, check out PacketView Pro! =========
    Patrick Klos                           Email: snipped-for-privacy@klos.com
    Klos Technologies, Inc.                Web:   http://www.klos.com /
==================== http://www.loving-long-island.com/ ====================

Re: Ecos, LwIP, PPP and GPRS
In comp.arch.embedded,
Quoted text here. Click to load it
Thanks, but how can you tell? If I look at RFC1661 and my data, about the
only thing I can make sense of is the 'C021' and 'C023', but the data
following those does not look like what I expect from RFC1661. If you can
point me to a site that explains the data, I'd be very thankfull.

The whole process takes about 5 seconds.
This Terminate-request" is one of last data packets before I get "ERROR"?

Quoted text here. Click to load it
With the debug on, there is data loss because it turns off interrupts
while printing the messages over another serial port. But when turned
on, it mostly complains about invalid FCS for 'C023' and 'C021'
packets. But due to the data loss, I do not trust it that much.

Is there a way to calculate the FCS manually (or programmatically in
my debuggging code)? A page discribing how it is calculated would be
very welcome.

We now also tried to get this modem (multitech MTSMC-G-F1) to work with
windows, but the results are a bit simular. Only thing is that there is
about twice as much data between "Welcome!" and "ERROR". But also hangs
up after a few seconds.

So maybe there is a problem with the mode settings? Looking for GPRS
settings on the net provides me with many different answers, but this
is what I'm using now:

ATZ
AT S0=0 E0
AT+CGDCONT=1,"IP","web.vodafone.nl"
ATDT*99#

But there are many more settings to GPRS.

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)

We just joined the civil hair patrol!

Re: Ecos, LwIP, PPP and GPRS
Quoted text here. Click to load it

Years of experience looking at PPP packets!   ;^)

Quoted text here. Click to load it

The RFC is the primary source.  The frames are pretty straightforward
once you get used to the FLAG and ESCAPE mechanisms.

Quoted text here. Click to load it

Are you aware of any system or device that works with this device and
ISP correctly?  If so, can you get a trace of what it's doing?  

Quoted text here. Click to load it

Can you modify the debug output to go to a memory buffer instead of the
serial port (or severely abbreviate the debug messages)??

Quoted text here. Click to load it

This page looks reasonable, but I haven't tried it myself:

    http://www.netfor2.com/fcs.htm

Quoted text here. Click to load it

As others know better than I, GPRS modems can act a little strange.
Maybe someone else will have some insight on that aspect of your problem?

Quoted text here. Click to load it

Are you sure you have the correct user ID and password for the ISP??  It's
a thought...

Patrick
========= For LAN/WAN Protocol Analysis, check out PacketView Pro! =========
    Patrick Klos                           Email: snipped-for-privacy@klos.com
    Klos Technologies, Inc.                Web:   http://www.klos.com /
==================== http://www.loving-long-island.com/ ====================

Re: Ecos, LwIP, PPP and GPRS
In comp.arch.embedded,
Quoted text here. Click to load it
Ah, that explains it! My experience in this field is a few days. ;-)

Quoted text here. Click to load it
OK, just keep going then.

Quoted text here. Click to load it
Yes, and it is..... This modem!

I've had a talk with our local distributor today and it turns out that
there is another AT command set manual for this modem. The one for the
internal IP stack! The datasheet fails to mention the 'minor' fact that
the modem has an IP stack built in. So I can do FTP comms using AT
commands and serial data. No need for IP stack and PPP on the target.
I'm not sure I can do all I need with the internal IP stack, but the
FTP is the most important right now.

So just now I downloaded a file from an ftp server using only
hyperterminal to type a few AT commands.

For now I will continue with the internal stack, but I would like to
get the PPP stuff working at a later stage.

Quoted text here. Click to load it
That is what I've already done to log the serial data you saw earlier.
I logged it to a buffer and spit it out in a hex-dump like format when
the connection dies. I've also redirected one debug function to use a
normal serial port that does not stop interrupts, but debug data keeps
coming on that blocking channel from other places in LWIP when debug
is turned on. So I would have to go through all the LWIP sources
to find out where it's coming from.


Quoted text here. Click to load it
That looks very good indeed. And pressing 'previous' gets me to a page
that I've been looking for for the last few days: A detailed PPP packet
example. Thanks for that link.

Quoted text here. Click to load it
Yes, this one seems to need an AT+CGATT=1 to get on the network. And i've
found at least 4 AT commands/dial strings to start the actual connection,
but which is 'right'?

OK, I can do my FTP for now and come back to the PPP when that is done.

Thanks for your help.

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)

Cutler Webster's Law:
We've slightly trimmed the long signature. Click to see the full one.
Re: Ecos, LwIP, PPP and GPRS

Quoted text here. Click to load it
.......

From the info I have not tried personally there is a username and password
expected, I suggest you test it and check for capital letters.

If you go to this page for a GPRS modem and get the zip file of all
technical documents, it contains a web page listing of lots of known settings
for user, password, APN, DNS for various operators and countries.

        <http://www.roundsolutions.com/GM862/index.htm

--
Paul Carpenter          | snipped-for-privacy@pcserviceselectronics.co.uk
<http://www.pcserviceselectronics.co.uk/ PC Services
We've slightly trimmed the long signature. Click to see the full one.
Re: Ecos, LwIP, PPP and GPRS
In comp.arch.embedded,
Quoted text here. Click to load it
Always a posibility, but I have got the correct ones. For our vodafone
network it's user:vodafone pass:vodafone. This works with modem in IP mode.

Quoted text here. Click to load it
Lots of datasheets there, downloading now, thanks.

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)

The little town that time forgot,
We've slightly trimmed the long signature. Click to see the full one.
Re: Ecos, LwIP, PPP and GPRS
Quoted text here. Click to load it

To keep it simple:
As a customer of Round Solutions you will enjoy a huge community based
on the biggest GSM module user forum in the Internet with FAQ and a lot
of postings. You will get factory support and you will see that users
help users as well. You will stay in a community with more then 2100
members around the world. A big "technical family" that grows each day.

Regards
Meff
www.gsm-modem.de

P.S: I am the admin of the Round Solutions forum.


Site Timeline