sim800l deleting sms using at commands

Hi, I was working on a project that uses sim800L. I am reading the first sms by deleting all others messages. In this I only read the new fresh messages.
I am using this library

The problem is that this library does not deletes all messages successfully
It is using at command like this
  this->SoftwareSerial::print(F("at+cmgda=\"del all\"\n\r"));
Why this command is giving error
what are the possible solution
thanks for reading :slight_smile:

try

AT+CMGD=1,4

KASSIMSAMJI:
try

AT+CMGD=1,4

thanks :slight_smile: its working now
but the problem is that i dont want to change the original library and want to send that command using my main code file but when i write
SIM.print(F("AT+CMGD=1,4\n\r"));
It gives error of
'SIM' was not declared in this scope
i also tried using
SIM800L::SIM.print(F("AT+CMGD=1,4\n\r"));
but it also gives error of
'SIM' is not a member of 'Sim800l'
how can i send command in my main code file

in

 Sim800L GSM(RX, TX);

GSM is your instance, so try something like

GSM.print(F("AT+CMGD=1,4\n\r"));

KASSIMSAMJI:
in

 Sim800L GSM(RX, TX);

GSM is your instance, so try something like

GSM.print(F("AT+CMGD=1,4\n\r"));

didnt work :?

Hi, answering your original question as why deleting all SMS messages does not work.
You need to have the "DEL ALL" in capital letters - not small like in your example. Like this:

"AT+CMGDA=\"DEL ALL\""

Note that this command DEL ALL command is SIMCOM specific and does not work with other GSM modems.