2
votes

I am trying to send SMS via a SIM 808 GSM Module. After using AT+CMEE = 1, I am getting CMS +CMS ERROR: 604. AT + CMGL command is working fine but I am still not able to send SMS. Here's the code :

#include<msp430.h> 
void sms()
{
Serial.println("AT\r");
delay(1000);
Serial.println("AT+CMGF = 1\r");
delay(1000);
Serial.println("AT+CMGL = \"ALL\"\r");
Serial.println("AT+CMEE = 1\r");
Serial.println(" AT+CMGS =\"+91xxxxxxxxxx\"\r");
delay(1000);
Serial.println("HELLO WORLD");
delay(1000);
Serial.println((char)26);
delay(100);
}
void setup(){
    Serial.begin(9600);
   sms();
}

void loop(){

}
2

2 Answers

2
votes

I have tested the code below. It worked. It was the \r's.
Shorter delays ok..

Serial.println("AT");
delay(50);
Serial.println("AT+CMGF=1");
delay(50);
Serial.println("AT+CMEE=1");
delay(50);
Serial.println("AT+CMGS=\"1xxxxxxxxxx\"");
delay(50);
Serial.println("HELLO WORLD");
delay(50);
Serial.println((char)26);
0
votes

I am looking into your issues. First, and possibly the basis of all issues, you do not need the \r in a println.

Serial.println("AT+CMEE = 1") is proper way to send to SIM 808. I have a sim 808 online and will test what you have. I have just mastered the SMS world with my SIM 808 so this won't take long. dy3