Sim800l Receiving SMS Problem

Its a bit strange that sometimes i get a message and sometimes (99% of times) i get a weird error i did try to sent sms with no problem and i did try 3 Sketches and same result by all with this problem not being able to read and print out the sms.

Any ideas?

#include <SoftwareSerial.h>

//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino #3 & #2

void setup()
{
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(9600);
  
  //Begin serial communication with Arduino and SIM800L
  mySerial.begin(9600);

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

  mySerial.println("AT"); //Once the handshake test is successful, it will back to OK
  updateSerial();
  
  mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
  updateSerial();
  //mySerial.println("AT+CMGR=1"); // Configuring TEXT mode
  //updateSerial();
  mySerial.println("AT+CNMI=1,2,0,0,0"); // Decides how newly arrived SMS messages should be handled
  updateSerial();
  mySerial.println("AT+CBC"); // Battery
  updateSerial();
}

void loop()
{
  updateSerial();
}

void updateSerial()
{
  
  delay(500);
  while (Serial.available()> 0) 
  {
    mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
  }
  while(mySerial.available()> 0) 
  {
    Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
  }
}

Screenshot_633.png

Screenshot_632.png

Screenshot_630.png

Screenshot_629.png

Screenshot_628.png

Screenshot_627.png

You are not adding any delays between your AT commands. After receving the response from AT commands i.e. OK, you should add some delay i.e. delay(500); and then try it.

Mooreover, in your updateSerial() function, you should verify the response and then move forward i.e. you should check whether you are receiving OK or not for each command.

jackthom41:
You are not adding any delays between your AT commands. After receving the response from AT commands i.e. OK, you should add some delay i.e. delay(500); and then try it.

Mooreover, in your updateSerial() function, you should verify the response and then move forward i.e. you should check whether you are receiving OK or not for each command.

Thanks will try that solution,

EDIT: added delays and still the same

No luck with the solution, is it maybe the text format?

We can say its solved i needed to turn off (Auto-bauding) on the Sim800l and set it to fix 9600, now it works. AT command used AT+IPR=9600