Go Down

Topic: +cme error (Read 43 times) previous topic - next topic


#include <SoftwareSerial.h>
SoftwareSerial SIM900A(10,11);
void setup()
  SIM900A.begin(9600);   // Setting the baud rate of GSM Module 
  Serial.begin(9600);    // Setting the baud rate of Serial Monitor (Arduino)
  Serial.println ("SIM900A Ready");
  Serial.println ("Type s to send message or r to receive message");
void loop()
  if (Serial.available()>0)
    case 's':
    case 'r':
 if (SIM900A.available()>0)
 void SendMessage()
  Serial.println ("Sending Message");
  SIM900A.println("AT+CMGF=1");    //Sets the GSM Module in Text Mode
  Serial.println ("Set SMS Number");
  SIM900A.println("AT+CMGS=\"+60174114491\"\r"); //Mobile phone number to send message
  Serial.println ("Set SMS Content");
  SIM900A.println("Good morning, how are you doing?");// Messsage content
  Serial.println ("Finish");
  SIM900A.println((char)26);// ASCII code of CTRL+Z
  Serial.println ("Message has been sent ->SMS Selesai dikirim");
 void RecieveMessage()
  Serial.println ("SIM900A Membaca SMS");
  delay (1000);
  SIM900A.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS
  Serial.write ("Unread Message done");

im using this code to receive and send msg using gsm module but i get this error +cme error how to solve this problem


@vidyaasini, please don't hijack another person's Thread with your question.

I have suggested to the Moderator to move your Post to its own Thread.

To make it easy for people to help you please modify your post and use the code button </>
Code: [Select]
so your code looks like this and is easy to copy to a text editor. See How to use the Forum

Two or three hours spent thinking and reading documentation solves most programming problems.

Coding Badly


Feb 18, 2018, 12:43 am Last Edit: Feb 18, 2018, 12:44 am by lastchancename
When you send AT commands to the modem, it's very important to WAIT for the reply. - especially when using SMS commands.

Just ploughing messages out will reliably cause issues.

If you can see which command (using your concpsole println() ) messages, you can look deeper as to why that particular  command failed.

p.s. please use <code> tags when posting!
When posting - use the toolbar and read the stickies if you're not sure!  </code> tags are our friend!
You can lead a plug to an outlet, but you can't make them turn it on.

Go Up