How to fix sim900a error using at commands

Hello i have SIM900A and I cant get the AT commands, Im using the code below

#include <SoftwareSerial.h>
 
SoftwareSerial mySerial(10, 11);  

void setup()
{ 
  Serial.begin(115200); 
  mySerial.begin(115200);

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

  mySerial.println("AT"); //Handshaking with SIM900
  updateSerial();
  mySerial.println("AT+CGSN"); //Check whether it has registered in the network
  updateSerial();
}

void loop()
{
  updateSerial();
}

void updateSerial()
{
  delay(500);
  while (Serial.available()) 
  {
    mySerial.write(Serial.read()); 
  }
  while(mySerial.available()) 
  {
    Serial.write(mySerial.read()); 
  }
}

but the result shows in the serial monitor like


instead of at+cgsn, Im also using 115200 baud since the 9600 is not working.

SoftwareSerial does not work reliably on a UNO above 38400baud
recommend you use a device with hardware serial ports such as a Mega

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.