Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

at+cnmi parameters to receive sms.

Status
Not open for further replies.

project_quest

Newbie level 3
Newbie level 3
Joined
Aug 31, 2013
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
22
Hello,
i'm trying to receive an sms on to the SIM300 gsm module using arduino uno , but it works only for one set of cnmi paramters.For the other parameters i get junk value on the serial monitor screen. As per another query on the forum,i tried putting all the AT commands in the loop function,but to no avail.
Does anybody have any suggestions to remedy this problem?
Thanks in advance!
 

Hello DineshSL,
Here is the code that i have written along with a screen shot of output .The time ,date and sender's name appear but the content of the message is junk.Kindly help :)

Code:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(9,10); 
char incomingByte=0; 
void setup() 
{
       Serial.begin(9600);  
      mySerial.begin(9600);   
      //pinMode(13, OUTPUT); 
      mySerial.println("AT");
      delay(1000);
      mySerial.println("AT+CMGF=1");
      delay(2000);  
      //mySerial.println("AT+CSMP=17,167,0,0");
      mySerial.println("AT+CNMI=2,2,0,1,0"); 
      delay(1000);
     
     }

void loop()

{   
mySerial.write("AT+CMGL=");
mySerial.write(34);
mySerial.write("ALL");
mySerial.write(34);
mySerial.write(13);//to move down one line
mySerial.write(10);//to place cursor on left margin.Equivalent to pressing "enter"
delay(1000);


        while (mySerial.available() > 0) 
        {       
               incomingByte = mySerial.read();
               if(incomingByte!='\n')
               {
               Serial.print(incomingByte);
               }
               
               if(incomingByte=='\n')
               {
                 Serial.print(incomingByte);
                 Serial.write(13);
                 Serial.write(10);
               }
         
      

        }
}

Screenshot (16).png
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top