View previous topic :: View next topic |
Author |
Message |
ambivalent Guest
|
SMS protocol!!! |
Posted: Mon Oct 03, 2005 3:33 am |
|
|
i was wondering if anyone here has ever implemented SMS and GPRS protocols using the AT command set. if any one has then please can you tell me about the difficulties associated with them.
thankyou
Take care |
|
|
Foppie
Joined: 16 Sep 2005 Posts: 138 Location: The Netherlands
|
|
Posted: Mon Oct 03, 2005 3:53 am |
|
|
I'm busy with it in my current project. In the beginning I had problems with receiving data. But I now just buffer it in a string and then evaluate. I also se an interrupt for receiving. It just made life easier... |
|
|
ambivalent Guest
|
SMS protocol!! |
Posted: Mon Oct 03, 2005 5:19 am |
|
|
thankyou Foppie for your reply. i want to implement the SMS protocol using PIC micorcontroller 16f877a as part of my project. can you plz guide me as to how i should start. would you recommend any documents or books that i need to read through.
can you tell me what sort of hardware did you use and how do i get to learn about the AT command set (necessary to implement SMS).
Your help in this regard will be greatly appreciated.
Take care
Bye |
|
|
Foppie
Joined: 16 Sep 2005 Posts: 138 Location: The Netherlands
|
|
Posted: Mon Oct 03, 2005 5:41 am |
|
|
I can't tell you much about the hardware, but in our project communication between the PIC (I use a 16F877A also) and the GSM part is done by rs232.
In software terms that made thing relatively easy. I just send something with the printf() statement and receive it with an interrupt. As I said receiving was a bit tricky, I wanted to filter usefull information in the interrupt, but that didn't work out for me. So I just put incoming data in the string (size = 96 bytes) and evaluate later.
What I would recommend that you read the AT commands listing of your GSM part. Especially look for where carriage returns and line feeds are positioned. It will help you to fast filter in the interrupt for the end of the message.
What I basically do is:
- send AT command with printf()
- wait till return message is completed (I use a flag in the interrupt)
- evaluate return
- clear variables for next command
Another note:
I don't use any other interrupt routines, just because I might loose data from the returning message. I don't have done any test on what will happen if there are more interrupts, so that's something you will have to test yourself... |
|
|
ambivalent Guest
|
SMS protocol!! |
Posted: Mon Oct 03, 2005 6:50 am |
|
|
thanx for your reply.
i havent as yet decided on which GSM part i am going to use. i wanted a general overview of the whole software and hardware routine for sending an receiving an SMS using pic16f877a microcontroller.
i want to ask you, what exactly did you implement in your project. were u both sending and receiving SMS or just receiving. and as you said that an interrupt was generated everytime you recieved an SMS. you stored the recieved SMS message in a string, wouldnt that have taken alot of RAM.
i was just concerned about the difficulty involved with sending and receiving an SMS through pic. can you plz tell me where to start with my project. what sort of material to read for AT command set.
if it is possible can you paste your code for SMS so i can examine it.
thankyou and take care |
|
|
Foppie
Joined: 16 Sep 2005 Posts: 138 Location: The Netherlands
|
|
Posted: Mon Oct 03, 2005 7:10 am |
|
|
Sorry for being unclear, but I don't use SMS in my project. I have looked into it however and I think the basics are the same as what I do.
What I described above is how I handle AT commands. If you write a program that can handle AT commands you will see it's all basically the same.
If you can send an sms with AT commands then you are also able to receive them and vice versa.
It does take a lot of RAM to receive something via AT commands so you will have to write a good protocol for what you send to your PIC in a SMS.
I cannot paste any code but I can give you the AT commands needed with my GSM part to send a SMS:
AT+CMGF=1
AT+CSMP=17,167,0,0
AT+CMGS="<phonenumber>"<Carriage Return><Message><CTRL-Z/ESC>
but this is dependant on the GSM part. Maybe you can google for an AT command list which you can studie (don't studie everything, just the Syntax Despcription part for a start and after that try to find some usefull commands)
Hopefully this helps |
|
|
|