Discussion in "Embedded GSM Development" started by    Alvanbert    Feb 10, 2012.
Wed Feb 15 2012, 10:50 AM
#11
@ Alvanbert
yes the code is correct
i use it with gsm modem and its works
u need t capture a event of new message notification
same thing is for cell phone as well as modem
which cell phone or modem ur using
Wed Feb 15 2012, 02:14 PM
#12
Hi Majoka, Thanks for yr reply. Pliz show me how i can integrate the capture of the new message notification into the code.
the Code above the last post i made has a code from Ajay that Kiran told me to use which i think is meant for this but i dont know how to integrate it.

Am using a Huawei Modem E160...its A USB modem
Thu Feb 16 2012, 03:50 AM
#13
In that same post its there read notification()
implement it in main program. u ll get.

Thu Feb 16 2012, 03:07 PM
#14
hi guys. i av been working on different though am yet to come to a successful conclusion. i want u to tell me whether this would be possible.

1. Is it possible to increment the 1 using aloop in the the command in the line ..SMSString( "AT+CMGR= 1 \r");...so that it can be able to read
( "AT+CMGR= 2 \r");, ( "AT+CMGR= 3 \r"); ( "AT+CMGR= 4 \r");...so that it can check from address 1-5 using a variable e.g n

2.If The above is okay....in case my simcard receives messages greater that the variable stated, i want it to delete the oldest message..which in this case would be the message at n=1 and replace it with the newest and the loop continues.
Fri Feb 17 2012, 04:04 AM
#15
In SMSString() its not possible to increment no.
Do like this
SMSString("AT+CMGR=");
tx0(var++);
SMSString("\r");

Second method also can be done.As soon as you receive a msg read/store it and delete it.So that when next msg arrives it sits in 1st location only.
Fri Feb 17 2012, 02:44 PM
#16
Thanks Kiran. But the problem now is tx0 function is supposed to output unsigned characters and yet i think the variable will be an integer.
i have tried to declare the (var) as an integer globally but wen the program runs the "AT+CMGR = " doesnt pick up the digit..so in the terminal it displays as shown in the snapshot below


secondly, KiRAN said

Second method also can be done.As soon as you receive a msg read/store it and delete it.So that when next msg arrives it sits in 1st location ony



How can i do this.. thought it would be easier to read from message location 1,2,3,4,5 then back to 1...through the loop i was suggesting above...
so when a new message arrives after location 5 has been filled..instead of storing it in 6, i will delete message in location 1 and place it there and the loop continues..... I hope am clear enough..

THANKS
Tue Feb 21 2012, 11:06 PM
#17
var must be converted to ascii first before sending it to modem. and "AT+CMGR=" without spaces around '=' sign
Wed Feb 22 2012, 10:47 PM
#18
Thanx A jay but problem is i dnt knw how 2 convert variable 2 ascii. Pliz enlighten me on how to do this. Thanx
Wed Feb 22 2012, 11:08 PM
#19


Thanx A jay but problem is i dnt knw how 2 convert variable 2 ascii. Pliz enlighten me on how to do this. Thanx

Alvanbert


For numbers up to 10 the best method is just to add 0x30 to the value.
EG
0 becomes 0x30 which is ascii '0'
1 becomes 0x31 which is ascii '1' etc.

For 10 or above use "printf", "sprintf" or "itoa"
"printf" will often add a lot of code so is best avoided.
Fri Feb 24 2012, 12:27 PM
#20
Thanx alot guys for your help...now am getting some output on the screen.

Now am left with one disturbing issue though it should be easy.
am failing to create a loop that can display the message onto the lcd from at+cmgr=1 to at+cmgr=5
below is the part of the code where i want to set up the loop pliz help.
SMSString("AT\r"); // AT commands to initialize gsm modem
delay_sms(1000);

SMSString( "ATe0\r"); // turn off echo
delay_sms(1000);

SMSString( "AT&W\r"); // save settings
delay_sms(1000);

SMSString( "AT+CMGF=1\r"); // select text mode for sms
delay_sms(1000);

SMSString( "AT+CNMI=2,1,0,0,0\r"); // notification of new sms
delay_sms(1000);

SMSString( "AT+CMGR="); // AT command to read sms
tx0(var++);
SMSString( "\r");

IE=0X90;   // Enable serial interrupt
delay_sms(2000);

/* i get a response like this

// +CMGR: "REC READ" ,"+2347060580383","10/10/23,14:29:33+04" 
// device1 off 
// Ok. */

// read sms and store in buffer msg1
read_text(msg1);
delay_sms(2000);
IE=0X00;     // Disable all interrupt
while(1);


Get Social

Information

Powered by e107 Forum System

Conversation

Mon Aug 01 2016, 03:25 PM
Manu Mishra
hi guys if u need c code for SD card interfacing with p89v51rd2 8051 controller system u can see the video of the project and the download the c code form blog http://embeddedinrajasthan.blogspot.in/?view=classic
Mon Aug 01 2016, 03:23 PM
Manu Mishra
hi guys if u need c code for finger print security system u can see the video of the project and the download the c code form blog http://embeddedinrajasthan.blogspot.in/?view=classic
ExperimenterUK
Tue Jul 19 2016, 05:59 PM
@mhammad 64 bits is 8 bytes.
Tue Jul 19 2016, 07:56 AM
mhammad kassem
hello! i want to know how to use UART in mikroc , I want to receive 64 bits from another microcontroller and i dont know how to start my code to receive the 64 bits...any help?
ExperimenterUK
Mon Jul 18 2016, 08:32 PM
@meena.. are you still having trouble ?
Sat Jul 16 2016, 10:19 AM
Meena
problem in loading email address while registering.Please help
Sun Jul 10 2016, 02:50 PM
shockwave
could you please provide a sample code that controling LED using bluetooth HC-05 interfacing pic16f877a thank you!
Sun Jul 10 2016, 02:49 PM
shockwave
Help!
ExperimenterUK
Sat Jul 09 2016, 05:25 PM
@Santhana krishnan post in forum to discuss your problem
Thu Jul 07 2016, 09:26 AM
Santhana krishnan
Hi i program atmega 32 it was functiining corectly but now aref pins voltage 2.56 is droped to .85 volts also a ports input viltage also dropped so anologe inpit not funcitonig please help me to find out the problem

Downloads

Comments

martinsnc115877
Sat Aug 20 2016, 01:44 PM
rajavarmanslr
Thu Aug 18 2016, 12:24 PM
mariahcarey
Sat Aug 06 2016, 11:38 AM
dann11
Thu Jul 28 2016, 09:43 PM
adithyapaip
Thu Jul 21 2016, 05:45 PM
celu
Thu Jul 21 2016, 05:27 PM
Aiko
Wed Jul 20 2016, 01:51 PM
JorgeG
Sat Jul 16 2016, 07:19 PM

Online

Guests: 46, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37779
Newest member: martinsnc115877
Forum Activity
rajavarmanslr Avatar
Posted By rajavarmanslr
Thu Aug 18 2016, 01:40 PM
I have two 8051 that interfaces with nRF24l01. One...
rajavarmanslr Avatar
Posted By rajavarmanslr
Thu Aug 18 2016, 12:31 PM
I have two 8051 that interfaces with nRF24l01. One...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Aug 01 2016, 05:26 AM
is working nowugoo5000Great, thanks for letting u...
ugoo5000 Avatar
Posted By ugoo5000
Sat Jul 30 2016, 07:31 AM
is working noworg 00hmov p1,#11111111bmov p3,#1111...
ugoo5000 Avatar
Posted By ugoo5000
Sat Jul 30 2016, 06:40 AM
when i press a button in p3.0,the counter will st...
ugoo5000 Avatar
Posted By ugoo5000
Sat Jul 30 2016, 06:30 AM
proteus file Attachment ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Jul 29 2016, 11:34 PM
Your code does not count at all, it produces a one...
ugoo5000 Avatar
Posted By ugoo5000
Fri Jul 29 2016, 07:49 PM
i want the the counter to be counting in secs with...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Jul 29 2016, 07:31 PM
HiYour Proteus file did not upload, be sure to zip...
ugoo5000 Avatar
Posted By ugoo5000
Fri Jul 29 2016, 11:50 AM
below is the proteus file