This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GSM interface to read text message through microcontroller

Hi everyone.

I am doing this project where I perform real time event operation using 8051. I am using GSM module to send/ and receive text from a hand held device to instruct operations that my 8051 needs to perform. It is basically a home based automation system using GSM module.

Now my question is how do I read only relevant part of the text? When I use GSM module by PC using Hyper terminal with following instruction:
AT
OK
AT+CMGF=1
OK
AT+CMGR=1
>+CMTI:...........
..................
Hi. How are you

OK

I only want to read "Hi. How are you" part of the and nothing else. How do I design my code to do it? This is the part that is bugging me a lot. I would really appreciate your help in it.

Thank You

Parents
  • It is a technique called parsing

    You are going to have to process all the characters as they are returned, but you are trying to recognize sequences that demarcate the beginning and end of the particular ones you want.

    So perhaps look for particular characters with a state-machine type implementation, or read strings, looking for the "OK<cr><lf>" type response, to the message read request and then go back through the prior lines/strings to pull out the message itself, and the phone numbers, etc.

    Processing and parsing would seem to be a computer science staple, review texts if you are unfamiliar.

Reply
  • It is a technique called parsing

    You are going to have to process all the characters as they are returned, but you are trying to recognize sequences that demarcate the beginning and end of the particular ones you want.

    So perhaps look for particular characters with a state-machine type implementation, or read strings, looking for the "OK<cr><lf>" type response, to the message read request and then go back through the prior lines/strings to pull out the message itself, and the phone numbers, etc.

    Processing and parsing would seem to be a computer science staple, review texts if you are unfamiliar.

Children