0

I tried the tutorial in this link

https://lastminuteengineers.com/sim900-gsm-shield-arduino-tutorial/

to send an SMS message using a SIM900 GSM shield

I completed the section to send AT commands successfully but I can't get the Arduino Uno to send an SMS. Below is the output I get after doing AT command tests

Initializing...
AT

OK
AT+CPIN?

+CPIN: READY

OK
AT+CSQ

+CSQ: 6,0

OK
AT+CCID

8944500105191448516F

OK
AT+CREG?

+CREG: 0,5

OK
AT+COPS?

+COPS: 0,0,"T-Mobile "

OK
AT+COPS=?

+COPS: (2,"T-Mobile ","T-Mobile ","310260"),,(0,1,4),(0,1,2)

OK

and below are the responses from the SMS code

Initializing...
AT

OK
AT+CMGF=1

OK
AT+CMGS="+1mycellphonenumber" 

> Last Minute Engineers | lastminuteengineers.com

so no response from the AT+CMGS command and NO SMS received. Plug is 5V 2A.

Any idea what might be causing the issue?

Below is the code I used for the Setup() function

void setup()
{
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(9600);

  //Begin serial communication with Arduino and SIM900
  mySerial.begin(9600);

  Serial.println("Initializing..."); 
  delay(1000);

  mySerial.println("AT"); //Handshaking with SIM900
  updateSerial();

  mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
  updateSerial();
  mySerial.println("AT+CMGS=\"+ZZxxxxxxxxxx\"");//change ZZ with country code and xxxxxxxxxxx with phone number to sms
  updateSerial();
  mySerial.print("Last Minute Engineers | lastminuteengineers.com"); //text content
  updateSerial();
  mySerial.write(26);
}

1

Changed my SIM card to Ting from Hologram and it worked just fine!

| improve this answer | |
  • It's OK to accept your own answer as the solution to the problem. – VE7JRO Apr 13 at 21:47
0

Normally in Setup() you have in the end this sequence

Serial.println("Connecting to the network...");

while( (sendATcommand("AT+CREG?", "+CREG: 0,1", 500) ||
    sendATcommand("AT+CREG?", "+CREG: 0,5", 500)) == 0 );

     sprintf(aux_str, "ATD%s;", phone_number);
     sendATcommand(aux_str, "OK", 10000);

     delay(seconds * 1000);

    Serial.println("ATH"); // disconnects the existing call

So after the registering you send

 Serial.println("AT+CMGS=\"1234567890\""); //CHANGE TO DESTINATION NUMBER

Did you use the \" for the embracing the number. Without your real command its hard to guess. Better use a test program Soft Serial GPRS Code, serial monitor is error prone. EDIT The OP posted code parts. The code after:

  Serial.println("Initializing..."); 
  delay(1000);

should be in the loop()- Look at the linked examples how should communication take place if the code is run once so no recurring tasks like reading chars or similar.

| improve this answer | |
  • I posted the Setup() function code I used above, the line below is to send the SMS. mySerial.println("AT+CMGS=\"+1mycellphonenumber\""); – Olefin Apr 1 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.