0
\$\begingroup\$

I'm using the sim900A module to try interface with mega 2560 controller using serial1 send SMS to my mobile but it will respond nothing, below I have attached a picture of the gsm module and code enter image description here

void setup()
{
  Serial.begin(115200);
  Serial1.begin(9600);

  Serial.println("Initializing..."); 
  delay(1000);
  Serial1.println("AT"); 
  updateSerial();
  Serial1.println("AT+CMGF=1"); 
  updateSerial();
  Serial1.println("AT+CMGS=\"+xxxxxxxxxxxx\"");
  updateSerial();
  Serial1.print("hi i'm from sim900a"); 
  updateSerial();
  Serial1.write(26);
}

void loop()
{
}

void updateSerial()
{
  delay(500);
  while (Serial.available()) 
  {
    Serial1.write(Serial.read());
  }
  while(Serial1.available()) 
  {
    Serial.write(Serial1.read());
  }
}
\$\endgroup\$
  • \$\begingroup\$ Have you checked the power rails? What you seen when you probe the signal lines? \$\endgroup\$ – Puffafish Feb 14 at 8:36

Your Answer

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

Browse other questions tagged or ask your own question.