Arduino Shield SIM900 не отвечает на AT Command - PullRequest
0 голосов
/ 15 мая 2018

У меня Arduino Uno, подключенный к экрану SIM900 (тот, что на картинке).Я могу отправить сообщение на свой номер телефона, когда я выполню этот код на моем Arduino (вот почему я думаю, что Arduino и экран работают)

Однако, когда я пытаюсь выполнить команду AT на последовательном мониторе, чтобымой Arduino Я не получаю "ОК" ответ.Не могли бы вы объяснить мне, почему я не получаю ответ при выполнении команды AT?

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); 
}
...