1

I've an Arduino Uno connected to a SIM900 shield (the one in the picture). I can send a message to my phone number, when I execute this code on my Arduino (That's why I think the Arduino and the shield are working)

However, when I try to execute AT command in serial monitor to my Arduino I don't get an "OK" response. Could you please explain to me why I don't get a respond when I execute AT command?

image

/*********
  Complete project details at http://randomnerdtutorials.com  
*********/

#include <SoftwareSerial.h>

// Configure software serial port
SoftwareSerial SIM900(7, 8); 

void setup() {
  // Arduino communicates with SIM900 GSM shield at a baud rate of 19200
  // Make sure that corresponds to the baud rate of your module
  SIM900.begin(19200);
  // Give time to your GSM shield log on to network
  delay(20000);   

  // Send the SMS
  sendSMS();
}

void loop() { 

}

void sendSMS() {
  // AT command to set SIM900 to SMS mode
  SIM900.print("AT+CMGF=1\r"); 
  delay(100);

  // REPLACE THE X's WITH THE RECIPIENT'S MOBILE NUMBER
  // USE INTERNATIONAL FORMAT CODE FOR MOBILE NUMBERS
  SIM900.println("AT + CMGS = \"+212625429762\""); 
  delay(100);

  // REPLACE WITH YOUR OWN SMS MESSAGE CONTENT
  SIM900.println("Message example from Arduino Uno."); 
  delay(100);

  // End AT command with a ^Z, ASCII code 26
  SIM900.println((char)26); 
  delay(100);
  SIM900.println();
  // Give module time to send SMS
  delay(5000); 
}
gre_gor
  • 6,669
  • 9
  • 47
  • 52
amansour
  • 57
  • 6

0 Answers0