Discussion in "Embedded GSM Development" started by    kirangowle    Nov 20, 2010.
Wed Nov 24 2010, 11:28 pm
#11
hi kirangowle
that switch was optional no need in ur design
ok i see u save ur no and name
just understand the
void read_text( unsigned char *msg,unsigned char *no ,unsigned char *time)
if u understand it then u can decode ur string
Thu Nov 25 2010, 10:54 am
#12
Hi mojaka,

Its working fine with stored msg. LCD is displaying same thing as it was displaying on hyper terminal.

But i didnt get why u have used AT+CNMI=2,2,0,0 parameters wat does it indicates.

In AT+CMGR=901( wat is 901). or it should be 1 always.
Thu Nov 25 2010, 11:36 am
#13
hi kirangowle

But i didnt get why u have used AT+CNMI=2,2,0,0 parameters wat does it indicates.


it iis used for New Message indication
it has a lot of meanings too it can means a lot of things... depends on the gsm modem, phone, etc, where it came from
see this
http://www.cellular.co.za/at_etsi.htm
http://www.activexperts.com/activcomport/tutorials/sms/

In AT+CMGR=901( wat is 901). or it should be 1 always.


see this link
http://www.developershome.com/sms/cmgrCommand.asp
http://www.scribd.com/doc/12434257/Getting-Started-With-at-Commands-RevC
here it is mention that
+CMGR=index
index is int type value it can be 1 or 901 or any value in int range
it can be
AT+CMGR=1
Thu Nov 25 2010, 03:28 pm
#14
Hi majoka,

From ur read_text fn i am getting following o/p on LCD.
+CMGR: // 1st line
REC // 2nd line
Hi welcome... //3 rd line Msg.

I am trying to display only recent msgs. for that which command should i use.

Thu Nov 25 2010, 06:32 pm
#15

Hi

for your ref whenver new sms recives the modem sends like this..

then

controller has to send AT+CMGR=1 to read that msg. that index no. will vary from 1-25( because sim can store only 25 sms)

Thu Nov 25 2010, 08:55 pm
#16
hi kirangowle
as u mention above that
Its working fine with stored msg. LCD is displaying same thing as it was displaying on hyper terminal.
then now where ru getting problem now again
as i am thinking decoder output should not be as as u mention that it is displaying on it
ru using 8052 the above code was 8052
when u send a read message command then ru enable serial interrupt and with what character ur read message start with
ru edit some code or using same as dave uses
for easiness use terminal program that has many option to see values in hex decimal ascii
ru seeing it in proteus


[ Edited Thu Nov 25 2010, 08:56 pm ]
 kirangowle like this.
Fri Nov 26 2010, 01:29 am
#17
AT+CMGF is to select message format, Text or PDU. default is PDU. you have to make it 1 to set mode as text mode.

AT+CNMI is for message indication. its used to set how you want to be notified for new sms, or cell site change or sms delivery notifications. you can disable notifications too.

+CNMI: 2,1,0,0,0 is the default settings. Modem will buffer notification till communication channel is free, and notifications are sent as +CMTI

AT+CMGR is to read message.
AT+CMGR=[num] where num is the index of message you want to read.

usually when you get a new message you are notified as
+CMTI: "SM",4

and you read as
AT+CMGR=4

4 is the index where message is stored.

For your help, i suggest you download and go through at command manual of modem you're using.
 kirangowle like this.
Fri Nov 26 2010, 11:29 am
#18
Thanks mojaka and ajay.

Now i want to read the msg notification i.e +CMTI: "SM",4
In that i have to take index no(i.e '4') and paste it in AT+CMGR= (paste it here)
right naa..
One more issue is there when shall i enable the interrupt. i.e in initialisation or when i try to read the notification or i have to use another interrupt?

Fri Nov 26 2010, 12:35 pm
#19
hi

Now i want to read the msg notification i.e +CMTI: "SM",4


yes u has to wait this
+CMTI: "SM",4
after that u will send AT+CMGR=4 to read new sms

One more issue is there when shall i enable the interrupt. i.e in initialisation or when i try to read the notification or i have to use another interrupt?


in previous examples i not enable interrupt in normal i enable it after the command AT+CMGR=4
so in buffer we has only message string not other like "OK" etc
now it depend on u what u need and where u want to enable interrupt it can be initialized in start too but then when ok comes it also store in buffer array and decoding becomes difficult
u can do one more thing that enable interrupt in start when u send command
AT+CMGR=4
after that forced array index to zero
after that when message comes it stores on 1st l;location of array
Sat Nov 27 2010, 05:42 pm
#20
if you want to capture the notification message +CMTI then you have to use interrupts as notifications are unsolicited messages.

If you want to stick to polling then i would suggest you to use a fix location for receiving SMS. lets say location 1, you keep checking if new message has come. if yes then read it and delete it, so new message goes to same location again.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

carpinteyrowrl
Fri Apr 19 2024, 02:51 pm
DonaldJAX
Fri Apr 19 2024, 01:08 pm
Lewisuhakeply
Thu Apr 18 2024, 06:00 pm
Darrellciz
Thu Apr 18 2024, 11:07 am
Charlessber
Thu Apr 18 2024, 09:29 am
BartonSem
Thu Apr 18 2024, 04:56 am
DonaldKnown
Thu Apr 18 2024, 12:24 am
utaletxcyw
Wed Apr 17 2024, 10:21 am