GSM SIM900A SMS content not displaying I am trying to read messages sent from my mobile to a GSM SIM900A module on my Arduino Serial monitor. Neither does the AT+CMGR command nor does the AT+CMGL command display SMS content. I also tried increasing the receiver buffer size in the SoftwareSerial Library but to no avail. I am simply trying to read 'check123'. I want to further store the SMS received as a string for further processing. But I am stuck with no display of SMS content on the serial monitor.

My code is:

#include &lt;SoftwareSerial.h&gt;
SoftwareSerial mySerial(9, 10);
String content = "";
char character;
int i;

void setup() {
  mySerial.begin(9600);
  Serial.begin(9600);
  delay(100);
}

void loop() {
  ReceiveSMS();
  delay(2000);
}

void ReceiveSMS() {
  mySerial.println("AT+CMGF=1");
  delay(2000);
  toSerial();
  mySerial.println("AT+CPMS=\"SM\",\"SM\",\"SM\"");
  delay(2000);
  toSerial();
  mySerial.println("AT+CMGL=\"ALL\"\r");
  delay(5000);
  toSerial();
  mySerial.println("AT+CMGD=1,4");
  delay(2000);
  toSerial();
}

void toSerial() {
  while (mySerial.available() != 0) {
    Serial.write(mySerial.read());
  }
}


Output is:



Edit:

SoftwareSerial.cpp file. I have marked the area where I have changed the value from 64 to 256 according to some previous help post.
Your code is absolutely correct. As I tested it with my Mega with Serial3 connected to GSM SIM900. I think there is something fishy about SoftwareSerial. Double-check the location of SoftwareSerial.


  C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial\src


Maybe you can see if RAM usage is exceeding the safe limit. Here is my output: