EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

GSM modem interfacing

Started by abhay August 30, 2006
hi,i m interfacing gsm modem to my microcontroller.i need to send sms
through it.
i am using AT commands for that.the command to send sms (AT+ CMGS)
terminates with
ctrl-Z.now in my program i hav tried all ways to send  ctrl-Z at end of
my sms.but it takes this as
a character or string only.also i tried with ascii value of ctrl-Z but
of no use.

i am able to see the transmitted commands on hyper-terminal through
serial interface & also on serail window while debugging.
the commands are as follows with 2ms delay between each of them.

AT , AT+CMGF = 1, AT+CMGS = mobile no. , "message to be sent " ctrl-Z /
26 / ^Z


plz suggest some way.suggestions are also invited if you suspect some
other problem .

abhay wrote:
> hi,i m interfacing gsm modem to my microcontroller.i need to send sms > through it. > i am using AT commands for that.the command to send sms (AT+ CMGS) > terminates with > ctrl-Z.now in my program i hav tried all ways to send ctrl-Z at end of > my sms.but it takes this as > a character or string only.also i tried with ascii value of ctrl-Z but > of no use. > > i am able to see the transmitted commands on hyper-terminal through > serial interface & also on serail window while debugging. > the commands are as follows with 2ms delay between each of them. > > AT , AT+CMGF = 1, AT+CMGS = mobile no. , "message to be sent " ctrl-Z / > 26 / ^Z > > > plz suggest some way.suggestions are also invited if you suspect some > other problem .
Do you send [CR][LF] at the end of each line? Also, try this before sending messages: AT+CSMP=17,167,0,0[CR][LF] What answers do you get from modem for each command? Why don't you try first to introduce commands manually from a Hyperterminal? It would be of much help. Adrian
> Do you send [CR][LF] at the end of each line?
yes i m sending that.
> Also, try this before sending messages: AT+CSMP=17,167,0,0[CR][LF] > What answers do you get from modem for each command? Why don't you try > first to introduce commands manually from a Hyperterminal? It would be > of much help.
i had already tried this on hyperterminal & everything works fine.but i hav to enter ctrl-z to indicate my modem that the msg is ready to be sent.now the problem is how to send ctrl-z via serial interface to modem.
On 31 Aug 2006 21:07:51 -0700, "abhay" <abhaym244@gmail.com> wrote:

> >> Do you send [CR][LF] at the end of each line? >yes i m sending that. > >> Also, try this before sending messages: AT+CSMP=17,167,0,0[CR][LF] >> What answers do you get from modem for each command? Why don't you try >> first to introduce commands manually from a Hyperterminal? It would be >> of much help. > > >i had already tried this on hyperterminal & everything works fine.but i >hav to enter ctrl-z >to indicate my modem that the msg is ready to be sent.now the problem >is how to > send ctrl-z via serial interface to modem.
___ You might try Googling for the ASCII codes. The first 32 are non-printing characters and were used to control teletype machines. One of these might work to send the message to the modem(all decimal): 3 EOX, End of text 4 EOT, End of transmission 23 ETB, End of transmission block I seem to remember that ctrl-Z was also used as an end-of-file character in BASIC ___ Catapultam habeo. Nisi pecuniam omnem mihi dabris, ad caput tuum saxum immane mittam.-- I have a catapult. Give me all of your money, or I will fling an enormous rock at your head.
abhay wrote:
> now the problem > is how to > send ctrl-z via serial interface to modem.
Send a ctrl-z from hyperterminal and look with an oscilloscope a the character generated. You will find that ctrl-z is 0x1A Adrian

The 2024 Embedded Online Conference