Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help using a GSM module and 82S8252 to connect to a TCP port

Status
Not open for further replies.

NunoAs

Newbie level 4
Joined
Sep 7, 2005
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,375
keil c51 ip ppp

Hi, I need to connecto to a TCP port on a remote server using the 89S8252 microcontroller and a SAGEM mod170 GSM module, since the module doesn't have a tcp/ip stack i'm stuck on implementing one by software.

Do all uIP implementations already supportt PPP ?

Can someone tell me where to find C51 code examples on connecting to a port and sending a small string (5-8 characters).

After i send the AT commands to the modem and connecting to the network what do i need to do then ?

Help would be really apretiated.

Thanks in advance

Nuno
 

+motorola +g20 +ppp

Hi,
I did not work with the 89S8252 micro but i am real
experienced about the GSM-GPRS side.
If uIp you said is the IP stack "uIp" of Adam Dunkels, then->
I am sorry!. You can not connect to internet through GPRS with this stack alone.
You need a TCP/IP/PPP stack!. all of them.
After the AT commands, you have to send PPP
packets and connect to server !.
I can suggest you a much more better solution!:
Get a modem with a TCP/IP/PPP stack on it. As an
example Motorola G20!.
We tried it. It can connect to 4 remote servers at the same time. And all you have to do is send AT commands. You do not need to implement TCP/IP/PPP stack!: Very easy.
Just ask specific questions and i can help you on it.
Adelmon
 

    NunoAs

    Points: 2
    Helpful Answer Positive Rating
pppinit lwip

Hi, thanks for your helo
A gsm modem with PPP and TCP/IP stack would be ideal, I've already considered that solution the problem is that this is a school project and my guiding teacher gave me this module and said that I have to use this and only this!

I've taken another look at the userguide and it does say that has some point to point capability, just not sure if it is PPP.

Short Message Service (GSM and GPRS mode):
• Text and PDU
• Point to point MT & MO
• SMS Cell Broadcast

If you care to have a look heres the link to the spec's:
**broken link removed**

You think it's possible a software solution ???
 

+g20 +at +ppp +*99***1#

Hi,
I can understand your limitations now.
I checked the pdf. Sorry but it does not have a TCP/IP/stack.
It is of course possible with a software solution.
I did make such a product for my company!.
I used an 16 bit mitsubishi microcontroller.
And i used the open source TCP/IP/PPP stack called
uCIP. You can download this stack from
ucip.sourceforge.net
But i had to make a lot of work to adapt the ucip
to my microcontroller.
I recommend you another stack that is also open source and it has PPP in it!.
It is called the LwIp. https://www.sics.se/~adam/lwip/
I did not use this TCP/IP/PPP stack. But i just
looked at it a little. It seems to be nice. And
most important, it is still being adapted.
ucIp is an old project. So it is better to have a
new code i think.

You can keep asking anything.
I will try to help.
best regards.
 

    NunoAs

    Points: 2
    Helpful Answer Positive Rating
connect internet using hyperterminal

Thanks for your help, it's encouraging although this is proving to be very complicated for me, I'm going to try lwIp, it seems to be suitable.

Since I'm kinda flying blind here please let me know if this steps are in the correct order, I found it on a Forum.

1. Initialize your system and lwip (including pppInit()).
2. Open your comm port.
3. Dial your modem and wait for it to connect.
4. call pppSetAuth() and pppOpen().
5. wait for PPP to tell you it is open (or if it failed for whatever reason).
6. now you should be on-line. do your thing.
7. call pppClose and close your comm port.

Another difficulty is that the C code in the source isn't always compatible with keil C51. And since i'm no programming expert this is revealing to be painfull!

Best regards and thanks

Nuno Aires
 

gsm at commands to connect internet

Hi,

the order is true.
it is a good definition.

But there are some small details i need to add,
1> in the initialization phase you need to send some
special AT commands to modem. These commands
are for initializion of pdp context! And/0r initialization
of modem data types and other useless stuff.
(as you send initial AT commands to modem, you do not
open comm port in step two!!!)
You must set the pdp context to connect to GPRS!:
For this purpose you can send the AT command below->
at+cgdcont=1,"IP","internet","0.0.0.0"
Modem responds as
OK
2> For dialing GPRS you use a special number. not a real phone number.
the number is *99***1#
you need to send the AT command
atd*99***1#
after the modem connects successfully,
you receive a string telling the connection is ok. And it is
CONNECT ????
The "????" stands for the speed!.
3> after this point on you do the pppOpen and others!.


As you said the most painful thing is to adapt the code to a new compiler.
The most important thing you should check are,
1 - assembler codes if any!
2 - the order of memory alignment. (Little-big endian)
3 - the sizes of data types!.
(int -> 2 bytes or 4 bytes) what is the default of keil, and LwIp

If you want a suggestion, i can give you one!,
Make sure you have a debug feature in the code!: If possible spare a
uart of microcontroller for debugging. And as the code works send debug
strings from there.
As far as i remember there is a debug feature in LwIp.
But i do not know if your microprocessor has 2 uarts! 1 for modem and
one for debugging feature.
If you have a runtime debugging facility, it will be easier to progress!
In some conditions , it is not enough if you have an emulator!.

If you stuck on anyother thing keep asking.
Bye for now!.
Adelmon
 

    NunoAs

    Points: 2
    Helpful Answer Positive Rating
gps and gsm 8052 project help

Hi again, sending AT commands is no problem, but I think it's impossible for a software solution with only 8Kb of code memory (ROM) and 256 bytes of RAM. I think i'm at a dead end with this microcontroller...
 

using lwip ppp gsm

Hi,
It is very limited. Yes you are right!:
real hard to make a TCP/IP/PPP stack for 8 kb ROM:
But i still have a suggestion for you!:
https://www.freescale.com/webapp/sp...sp?code=68HC908LJ24&nodeId=016246844976638634

There is an application note an2120.pdf and also there is the source code of this application note!.
It says the hc08 microcontroller can operate a TCP/IP/PPP stack!.
I never tried it. But you can look at it.
It may be helpful.
Adelmon
 

    NunoAs

    Points: 2
    Helpful Answer Positive Rating
connect gprs module for true

Again, thanks for your help, if it wasn't for you, I would have given up a couple a days ago. I took a look at the aplication note but I think I'd really need much more in deph knowledge on TCP/IP and C programming. I ordered the DS80C400 from MAXIM and hopefully it will solve my problems when it arrives, and next week my classmate will join me on this headache and we'll try to reason with my teacher for a GSM modem with a tcp/ip stack and GPS (my project requires a gps).

I work on weekends so you wont hear from me for a while but i'll try to keep you posted of the status of my project, maybe you could help some more ;)

If you come to Portugal some day I'll pay you a drink!

Regards

Nuno
 

uip gsm

hi Nuno,
i can help you anytime.
Just let me know.
thanks for the drink offer.
and if you ever come to Turkey, Istanbul i will
pay you a drink too.
Bye for now.
Adelmon
 

ucip versions

I have a similar problem: I have to build a connection between two Nokia32(30) GSM modems to send/receive small data: a server will request data from an embedded client, the client will reply with 1-2kbytes of data.
Few questions:
1. It is possible to implement this through GPRS, not through SMS?
2. If yes, what is the mode data is transmitted after correct set-up of GPRS mode?
Do I need to implement some PPP code in my embedded appl, or it is enough AT commands?
Thanks
 

open source gsm module

Hi xirix,
First of all SMS is not a guarenteed service.
If it was HSCD i would not doubt it. But for SMS,
i always have a question mark.
Because SMS is not a guranteed, time strict GSM
service. Even though you get SMS everytime
your friend sends you one. In standardization SMS
is not a guarenteed service.
For your other questions,
Yes you can implement it through GPRS.
But there are some pitfalls. At first, When you
connect to Internet through GPRS generally you have a dinamic IP address! This actually depends
on the network infrastructure of GSM operator. But %99 it is dinamic.
And as you can see it is quiet hard
to make a server on a dinamic IP address. Actually
it is impossible! The client must somehow know
the ip address of the server. If your GSM operator
can not give static ip addresses to mobileterminals
than you have to work real hard. If GSM operator
can give static IP address to some mobile terminals,
than your work gets lessed.
If you are not using a modem with a built in TCP/IP/PPP stack than you have to implement a
PPP/IP/TCP stack. But if you use a modem with
built in stack than you just need to send AT
commands.
 

lwip pppinit

I have experience in this project and I can tell you for sure that it is practically impossible to do a complete TCP/IP/PPP in 8KB and 256 bytes of an 8052. I used the smallest TCP/IP stack (UIP) and did a subset of PPP on 8051 and my code size is around 17KB and data is around 3KB. I had an external RAM so I did not care about its usage but I think that the shortest you can get is about 1KB if you really use the RAM very carefully. The code can be compacted to fit inside 16KB but there is no way that you can fit everything in an 89C52.

Ofcourse if you use a Module with built in TCP/IP, you can do it with very little ROM and RAM.
 

connect to server gsm module

dear my friends, have u ever tried GR47 sony ericson gsm/gprs module with built in TCP/IP stack?
i have tried to connect to internet using that module. i give AT command to the module using hyperterminal in windows. i use AT command example in its appnote, but it can't connect internet. The module response 'CONNECT' after AT Command is given, but after that, the module response nothing
can anyone help me?

Added after 3 minutes:

dear my friends, have u ever tried GR47 sony ericson gsm/gprs module with built in TCP/IP stack?
i have tried to connect to internet using that module. i give AT command to the module using hyperterminal in windows. i use AT command example in its appnote, but it can't connect internet. The module response 'CONNECT' after AT Command is given, but after that, the module response nothing
can anyone help me?
for the reference, i give u pdf of tcp ip stack appnote from sony ericsson
 

modem at command microcontroller tcp ppp

there is TCP/IP chip known as "TNS010i" (www.tcpip.com)
for these purposes . Does anyone tried that IC for internet purposes..?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top