Hi guys please let me know if I can post a question regarding GSM modem over here My modem is working fine just when I try to receive msg through at+cmgr=1 1st character I get is not '+' Its not related to h/w but programming and response of GSM modem for at commands so is it ok if I post my query over here?
gsm is not the kiel product you be knowing?????
but:::::: i is be working with gsm and i will help with you.
if you hate the ansewr i giving you you can ask sir erac :::::: he is old and wise and kind and very fun and knows everything you be knowing. and you is be laughing lots for his posing.
Thanks kalib then here is the question: What is the 1st character that I receive after at+cmgr=1 I considered it as '+' as in +CMGR:.... etc. However my check for '+' fails Here is the part of code:
sbit p0 = P2^0; sbit p1 = P2^1; sbit p3 = P2^3; sbit p4 = P2^4; sbit p5 = P2^5; sbit p6 = P2^6; unsigned char CheckMsg(void) { unsigned char at_cmgr[] = "at+cmgr=1"; char Received_Char; Command(at_cmgr); CR(); Received_Char = Receive_Char(); if(Received_Char != '+') { p3 = 1; return 0; } Received_Char = Receive_Char(); if(Received_Char != 'C') { p1 = 1; return 0; } Received_Char = Receive_Char(); if(Received_Char != 'M') { p4 = 1; return 0; } Received_Char = Receive_Char(); if(Received_Char != 'G') { p4 = 1; return 0; } else return 1; } void Command(unsigned char *at_command) { unsigned char i; i = 0; do { Xmit_Char(at_command+i); i++; } while(at_command[i] != '\0'); return; } void CR(void) { Xmit_Static_Char(0x0D); return; }
the function ChkMsg returns 0 even if msg is been received Xmit_Char and Xmit_Static_Char just transmit characters serially they are working correctly on port2 I've connected LEDs so that I can judge the output Thanks in advance
yes it is a difucult question you be thinking.
who you send one "at" and get ansewr?????
i be thinking you must see ok:::: do you see ok ?????? if you not be seeing ok you must work to the code.
if you having the ansewr but i don not now.
you must have a wait for the big sir erac to give his wise post i be thinking.
you be thinking to laugh while you read his post:::: but be good, he is always right!!!!!!!!
Ya for at i get OK But for initialization i've sent
at ate0 atv0 at+cgmf=1 at+cpms="SM"
so for OK it gives response as 0 and I am sure that this initialization is getting dne correctly as i've deleted msg after returning from ChkMsg function and other thing is when I connect my modem to computer after this initialization I can see echo off verbose mode off msg set to text mode etc.
i be thinking ::::::: you must be wait for the great wise anserw of sir erac
i be thinking he sleeping to very late and you must waiting long time
sir erac are you being there yet ???????????
Hey guys please give your opinion or let me know where to read about sms or GSM
prakit,,,,
i think sir erac is still being asleep?????
you please wait for his good wisely commments.
Thanks Kalib I'm waiting anyway its Pratik not Prakit and I guess its Erak not erac
helllo pratrik
sorry to you i is being!!!!
i thinking sir erac is awake but not knowing an anserw???? but he is be always knowing and wise before!!!
That depends on whether or not you have echo enabled:
With echo enabled, the first thing you will receive after sending the command will be the modem's echo of the command.
After that, you will receive the response formatting character (usually LF - set by S4).
Only after that do you receive the first character of the actual response; eg, the '+' of "+CMGR"
http://www.keil.com/forum/docs/thread12316.asp
http://www.keil.com/forum/docs/thread9374.asp
http://www.keil.com/forum/docs/thread9385.asp
Thanks Andy, you can see in one of the above post I've written my initialization code
at<CR> ate0<CR> atv0<CR> at+cmgf=1<CR> at+cpms="SM"<CR>
so I hope for
at+cmgr=1<CR>
I should get '+' as my first character Am I correct? One more thing after reading/manipulating that msg I'm deleting it
at+cmgd=1<CR>
so next msg should be at index 1, right?
One more thing micro controller is sending proper commands to modem as i said in one of the post above as I program modem for something else and then run initialization code it works fine(configured according to initialization code) and even msg used to be deleted after execution of code
"Am I correct?"
No.
Re-read what I said earlier about response formatting...
Ya Andy even I thought I should get LF as my 1st response character however when I tried to do at+cmgr=1<CR> on hyperterminal (with given initialization), I got response on same line thats why I done programming that way anyway I'll be on vacation for few days so will try it with LF after few days. Anyway till then if required I'll post any other problems. Thanks a lot
Rather than relying specifically on receiving a '+', how about allowing your receiver to "skip" all whitespace until a '+' is received - then capture the next 4 characters, and check...