Discussion in "8051 Discussion Forum" started by    9780id    May 27, 2013.
Mon May 27 2013, 04:15 pm
#1
hello my friends,maybe this is sound crazy but i need all of your help.
Currently I am doing my project to control power on/off via sms. I am using Siemens C55 and AT89S52 and the dateline is on Thrusday
and now I have some problem how to read the sms from the microcontroller.
For example, how if I send LAMP ON, there will be replied LAMP IS ON.
I am using C language with Keil compiler, and Crystal 11,0592 MHz.
Please help me.
Thank you.
Mon May 27 2013, 07:41 pm
#2
You can refer GSM notice board project for this which is published in home page.
still if you find any issue let us know.
Tue May 28 2013, 05:14 pm
#4
hi, thanks for the reply kirangowle and ajay.
I already download it and try to understand.hopefully i can make it.
but I see an unfamiliar command here,what is AT+CNMI=2,1,0,0,0\r ?
can you explain how it works and the meaning of 2,1,0,0\r?
thank you
Tue May 28 2013, 05:21 pm
#5
hi ajay and kirangowle.
I just look up in the internet that CNMI is need to display the message right?
so the message will showed up in the LCD?
since I don't use any LCD i dont need CNMI right?
Tue May 28 2013, 10:36 pm
#6


hi ajay and kirangowle.
I just look up in the internet that CNMI is need to display the message right?
so the message will showed up in the LCD?
since I don't use any LCD i dont need CNMI right?

9780id


The CNMI command is not about the LCD it is about receiving sms messages.

You are not displaying the message, but you still need to read it,or be aware that
it has arrived.
Wed May 29 2013, 07:23 am
#7
AT+CNMI is tor notify that new msg has arrived. You need this to read always the latest msg.
Wed May 29 2013, 12:31 pm
#8



hi ajay and kirangowle.
I just look up in the internet that CNMI is need to display the message right?
so the message will showed up in the LCD?
since I don't use any LCD i dont need CNMI right?

9780id


The CNMI command is not about the LCD it is about receiving sms messages.

You are not displaying the message, but you still need to read it,or be aware that
it has arrived.

ExperimenterUK


I see then,it is always like that?
I mean always AT+CNMI=2,0,0,0\r?
what does it mean?
Thu May 30 2013, 10:15 am
#9
CNMI = New Message Indication

Download AT Command manual and look at its description. A simple google search would have helped.
Thu May 30 2013, 11:19 am
#10
thanks for the reply ajay,now i trying my best to finish it by 5 pm today!!
I have some difficulties here,where to put send and read sms?
if(strncmp(message,"LAMP ON",7)==0)
	    {	 
			
	   		lamp=ON;
			D1Status=1;
			tx_string("AT+CMGS=\"");
			tx_string(phone_num);
	   		tx_data('\"'); 
	   		tx_data('\r');
	   		while(rx_data()!='
			tx_string("device 1 turned on");
	   		tx_data(0x1A);  // ctrl-z is 0x1A
		}

		else if(strncmp(message,"LAMP OFF",8)==0)
	    {	 
	   		
			lamp=OFF;
			D1Status=0;
			tx_string("AT+CMGS=\"");
	   		tx_string(phone_num);
	   		tx_data('\"'); 
	   		tx_data('\r');
	   		while(rx_data()!='>
');
			tx_string("device 1 turned off");
	   		tx_data(0x1A);  // ctrl-z is 0x1A
		}

is my code already right?
where i should put it?

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

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
Anthonyvab
Wed Apr 17 2024, 08:48 am
RobertCix
Wed Apr 17 2024, 06:46 am