How to erase incomming sms


I want to free some space by deleting the sms, that have been readed.
How to make this ?


Hi embeddedone,

You can delete an sms by using the comand AT+CMGD=smsid
They are other command to deal with sms in the at command pdf.

Best regards,



Including how to delete all messages…


In which part of the code should i set the delete all command.
Am asking this because i have set ( as test )

TRACE((2, “SMS send”)) ;

As result i get “SMS send part” but all SMS’s are still on the memory.
Like if there was no delete command ?

There was no errors or warnings.


Hi embeddedOne !

I think that SMS can be stored in different memory areas… With the delete SMS AT command (AT+CMGD), the first parameter tells from which memory area the SMS have to be deleted ! That’s maybe the problem !!

See AT+CPMF command to see where the SMS are stored.

Another thing, with ADL librairy. The smsReceivedHandler() function declared at SMS subscription return a boolean value. If you return FALSE when you receive a SMS, this SMS wont be stored…

PS : did you manage the problem with int parameter parsing ??


Is there a way to check how much money is left on the demo board SIM card ?

hear ya today :slight_smile:


Hi embedded !

I dont think it is possible with OpenAT… but have a look in your AT commands interface guide.

AT+CAOC, AT+CACM, AT+CPUC… (under Supplementary Services commands in my guide) this will maybe help you.

Another thing, as i suppose your are using a prepaid SIM card. I have one and there is a service that tell you the credit left for the card. For me, i’ve to call *130# (not a SMS, a call).

Have a try…


This depends entirely upon your GSM service provider!

On Vodafone in the UK, it can be shecked with AT+CUSD=1,"*#1345#" - but this is specific to Vodafone only, and doesn’t work for any other operator

Yes - there is no specific Open-AT facility for this.

Again, there is no specific AT command for this; there maybe commands that you can use - but you will have to ask your specific operator for details of what methods they support.

It will be operator-specific, and may even depend on the type of subscription you have.

That’ll be like the UK Vodafone one mentioned above - specific to your particular provider.

See also: … t=vodafone … t=vodafone