SIM800L SMS Sending Issue

Hi All!

OVERVIEW OF THE ENTIRE PROJECT:

I'm working on a project wherein I have a SIM800L module plugged into an Arduino, and the Arduino is connected to a PC. The PC is a web application server, and the web application listens to FB posts from a model government bureau FB page.

The web application analyzes posts, and decides whether an SMS announcement should be made. If an announcement is necessary, the web application sends a command to Arduino.

The Arduino then sends the SMS to a group of subscribers.

THE ISSUE
Why is it that, sometimes, the AT commands get included in the SMS sent?

CODE SNIPPETS

 Serial.begin(9600);
  gsmSerial.begin(9600);
  delay(1000);
  gsmSerial.print("AT+CMGF=1\r");
  delay(1000);


String cmd ="AT+CMGS=\""+contact+"\"\r\n";   //contact is the mobile number
  gsmSerial.print(cmd);
  delay(1000);
  getNumber=true;

gsmSerial.write("ANNOUNCEMENT");
  delay(1000);
  gsmSerial.write((char)26);
  delay(2000);

Thanks in advance to those who'll respond! :smiley:

That code won’t compile. When you post something that will then perhaps we’ll be able to help you.

You also need to state which Arduino.

Looking into my crystal ball, based on the limited amount of information you posted, I'd guess it has something to do with your use of the "String" object. But, I'm probably wrong. That's what guesses get you, ideas of little, limited help.

Best to read and follow all the suggestions here: http://forum.arduino.cc/index.php/topic,148850.0.html

Kudos for reading the link but you appear to have stopped at topic #10. That's where Nick points out some really important items that are required to get an answer, not guesses :wink: