Home - Search - Members
Full Version: 8051 to control GSM modem
Judgement
May 13 2008, 3:39 PM
Hi guys, I'm a student doing a final year project. My project needs a 8051 microcontroller to program and run a GSM modem to send, read and receive SMS's but the thing is..I'm a total newbie to the 8051.

I need help in the programming part and we're probably going to use Keil C to program the 8051. The modem we're using is a Wavecom fastrack 10 supreme.

Another question: Is there any hardware that can receive SMS and power up devices? (eg. LEDs, buzzer..etc) Prefabaly a small and inexpensive one.

I hope to hear from you all soon as its kinda urgent. Thanks in advance.
shyam
May 13 2008, 7:46 PM
search the site with your querry...

u will find ur answers for sure..

use the search tab at the top left1
Judgement
May 14 2008, 12:48 AM
Thanks for your advice but I've searched the forums and found nothing much on using 8051 to control a wavecom GSM modem.
shyam
May 14 2008, 5:08 AM
u said u r using fasttrack supreme...


u shud have got urself a wavecom q24plus on the first hand.. there u wud have got an inbuilt ARM-7tdmi based controllers with IP support as wellas a few GPIOs to control.. as u said u needed, look if u can still get one.. nevertheless, wavecom supreme is pretty easy to interface..

get urself a working 8051 board and have it interfaced with PC (serially)..
now see if u can communicate ur 51board and PC properly..(write a small serial code).

u will have to try and write code @115200 baudrate.
else u will have to bring the baudrate of the modem down to say 9600.. will tell u how.. but before that,try what has been said above and let us know!
Judgement
May 14 2008, 9:22 AM
Thanks. I'll try that. If I still have any problems, I'll post again.
Judgement
May 20 2008, 1:04 AM
Is there a tutorial or website that teaches you how to send AT commands with C?

Or if any of you here can teach me some basics?

Thanks.
Ajay
May 20 2008, 6:58 PM
all you need to do is.. configure your uart.
create a function to send string.

then send command like this

CODE:
send("AT\r"); //send is your function to send string
//at command sent.
 
Judgement
May 20 2008, 10:19 PM
Thanks dude. That was what I was looking for.
Ajay
May 21 2008, 10:49 PM
do not forget to disable echo, coz that can create problem for you.

ATE0 - disable echo
Judgement
May 29 2008, 9:25 PM
Ok, I'm able to send AT commands to the modem but how do I read values from it?

+CMGR : "REC UNREAD", "+6512345678", "08/05/27"


How do I read the number, +6512345678, and send a reply or something similar in C language?

Thanks.
Ajay
May 30 2008, 12:46 AM
for this you need to do some string manipulation functions..
see the response you get from AT Commands will always be in the above format.
after the above string you will have the sms data.. and then OK
something like this.

+CMGR: "REC UNREAD", "0146290800",
"98/10/01,18:22:11+00", ABCdefGHI
OK


you can create function which can break this string into parts so that you can get extract information from it.
so do this..
look for index of first "," (comma) and then after that keep reading the string from starting quote to ending quote. you have your number in between that.

c example:
CODE:
while(*response != ',')
        response++;
//after you come out of the above loop you reached the starting of number
response++; //bypass the space
response++; //bypass quote
while(*response != '"'){
        *number = *response;
        number++;
        response++;
}
 

now string number will have your number
Judgement
May 30 2008, 1:28 PM
Hey, thanks.
I'll try that out.
Shailesh NAYAK
Jun 4 2008, 5:21 PM
Hi,
You can register yourself in Wavecom Website. and can get downloaded AT Command Interface guide. Also try to get some basic knowledge of GSM modem and phone behavior, so it will be more helpful for you to interface with MICON.
Judgement
Jun 24 2008, 7:07 PM
Alright, I can get my 8051 to communicate with my serial port and now I have another problem. How do I send sms with the GSM in C? I know how to send strings to read and delete SMS but I have a problem with sending SMS.

Sending SMS for my GSM is:
AT+CMGS = +123456789 [enter button]
<sms message here> [control+Z]

The problem is I don't know how to input the enter button and the control+Z into the string. Thanks.
say2paul
Jun 24 2008, 10:46 PM
Judgement wrote ...

Alright, I can get my 8051 to communicate with my serial port and now I have another problem. How do I send sms with the GSM in C? I know how to send strings to read and delete SMS but I have a problem with sending SMS.

Sending SMS for my GSM is:
AT+CMGS = +123456789 [enter button]
<sms message here> [control+Z]

The problem is I don't know how to input the enter button and the control+Z into the string. Thanks.


\r\n should work here, if don't then you can try with the hex code of Line feed/Carriage return. I had not tried it yet so don't know if it works!
Judgement
Jun 25 2008, 12:04 AM
say2paul wrote ...

Judgement wrote ...

Alright, I can get my 8051 to communicate with my serial port and now I have another problem. How do I send sms with the GSM in C? I know how to send strings to read and delete SMS but I have a problem with sending SMS.

Sending SMS for my GSM is:
AT+CMGS = +123456789 [enter button]
<sms message here> [control+Z]

The problem is I don't know how to input the enter button and the control+Z into the string. Thanks.


\r\n should work here, if don't then you can try with the hex code of Line feed/Carriage return. I had not tried it yet so don't know if it works!


Hmm..I've thought of using \r\n as well but I haven't tried it out yet. I don't think it works that way...
say2paul
Jun 25 2008, 1:21 AM
Judgement wrote ...

say2paul wrote ...

Judgement wrote ...

Alright, I can get my 8051 to communicate with my serial port and now I have another problem. How do I send sms with the GSM in C? I know how to send strings to read and delete SMS but I have a problem with sending SMS.

Sending SMS for my GSM is:
AT+CMGS = +123456789 [enter button]
<sms message here> [control+Z]

The problem is I don't know how to input the enter button and the control+Z into the string. Thanks.


\r\n should work here, if don't then you can try with the hex code of Line feed/Carriage return. I had not tried it yet so don't know if it works!


Hmm..I've thought of using \r\n as well but I haven't tried it out yet. I don't think it works that way...



You are lucky you reached at the point where you are sending AT commands from 8051 to mobile phone.

I am still finding how to connect my mobile phone with microcontroller

Judgement
Jun 25 2008, 4:27 AM
say2paul wrote ...

You are lucky you reached at the point where you are sending AT commands from 8051 to mobile phone.

I am still finding how to connect my mobile phone with microcontroller

Well, I'm using a GSM modem instead of a mobile phone. I think its easier to configure the 8051 to communicate with the GSM as compared to a mobile phone. Good luck on your project.
Judgement
Jun 25 2008, 6:13 PM
I have 1 more question. I'll post it up with my old question.

Alright, I can get my 8051 to communicate with my serial port and now I have another problem. How do I send sms with the GSM in C? I know how to send strings to read and delete SMS but I have a problem with sending SMS.

Sending SMS for my GSM is:
AT+CMGS = +123456789 [enter button]
<sms message here> [control+Z]

The problem is I don't know how to input the enter button and the control+Z into the string in C language. Thanks.

Also, I want to do something like a timed SMS. The user send an SMS eg. 1 Hour.
Then, the 8051 programs the GSM modem to send an SMS 1 hour later. How can I do something like that in C language? Thanks.
Judgement
Jun 26 2008, 12:27 AM
Ok, I've solved the sending SMS problem. However, I still have some problems with the timed SMS thing.
Hope to see some replies soon. Thanks.
Ajay
Jun 26 2008, 7:29 AM
timers? or any hardware clock for better accuracy...
Judgement
Jun 26 2008, 6:20 PM
Ajay wrote ...

timers? or any hardware clock for better accuracy...

Hmm..trying not to add any additional hardware.
Its more like a delayed SMS. The user sends the time by SMS for the SMS to be sent by the GSM modem to be delayed. eg.1 hour
And the modem sends an SMS to the sender after 1 hour has passed.
Judgement
Jun 29 2008, 6:25 AM
Also, how can I program it so that the GSM modem only continues with the program when the correct SMS text is sent?

eg. 1 hour

When the GSM modem receives something else, it will ignore it. Thanks. I need it kind of urgently.
Shailesh NAYAK
Aug 12 2008, 11:14 PM
You can use this +6512345678 directly as ASCII charachter with AT+CMGS for exmple

AT+CMGS="+6512345678"\r
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Rickey's World © 2003 - 2007