Delete SMS on Motorola W220 with Arduino


I have recently found this: "Tutorial: Send SMS from your Arduino using an old Motorola cell phone" at So I rebuild this to use it in one of my current projects. It works and I receive messages but I have one problem, the delete command does not work reliable. In most cases it just do not delete the messages, until now I had to bypass this by increasing the index every time, but this just works until the Arduino restarts as it is not saved permanently. Also quit bizar is that my mobile phone (Motorola W220) shows in the outbox folder for every SMS a green arrow that means that it has sent the SMS but above there is also some kind of passage prohibited sign that I guess means it couldn't send the SMS, although I receive every time the right message.

Does anyone know something about this or has already some experience with this? I have tried to find other commands for deleting messages, but just found the "AT+CMGD=?" while ? is the index of the SMS I want to delete. Does anyone knows a site which a complete list of commands or a command that deletes everything or all SMS?

And how can I display the response from the phone correctly on my computer as e.g.


This just print a number I guess "11" on my screen

I am looking forward to hear from you.

King regards Greeneco


Those are Hayes modem commands. Googling for "hayes command list motorola gsm" results in this page among other results. I guess you'll be able to find what you need in there.

Here some of the commands:
Don’t think it’s correct for any model, you need to find a doc for specific chip set your mobile has inside.
Example, “AT Command Set SIM5350 _ATC_V1.01” says there are options expected in delete sms command:

Test Command
+CMGD: (list of supported s)[,(list of supporteds)]
Write Command
Defined values

Integer type; value in the range of location numbers supported by the associated memory and start
with zero.

an integer indicating multiple message deletion request as follows:
0 – (or omitted) Delete the message specified in .
1 – Delete all read messages from preferred message storage, leaving unread messages and
stored mobile originated messages (whether sent or not) untouched.
2 – Delete all read messages from preferred message storage and sent mobile originated
messages, leaving unread messages and unsent mobile originated messages untouched.
3 – Delete all read messages from preferred message storage, sent and unsent mobile
originated messages leaving unread messages untouched.
4 – Delete all messages from preferred message storage including unread messages.
NOTE: If set =1, 2, 3 or 4, is omitted, such as AT+CMGD=,1.


thanks for your anwsers. But I am still wondering how to get the response from phone as shown at the wiki page. I am using e.g.


But this just return a number mostly I guess 11, how to I get the "right" response display to my screen?

Wiki page isn't informative enough, this is why I recommend you to search a doc "AT Command Set" for motorola. Google bring me up on second line: and page 84 described response you get on query at+clac:

+CLAC, List of All Available AT Commands Command Execute Syntax +CLAC Response/Action List of available AT commands Remarks The Execute command displays a list of all the AT commands supported by the C24. Example AT+CLAC $ %C &C &D : : : : \A \S OK

What I may think, if this report is too long arduino may not handle it's correctly. I'd suggest, you should test communication link to the phone using hyper terminal / putty / minicom or whatever serial link you prefer , manually first w/o arduino in chain. See what you get, and if all looks right, than you diging into arduino library to find d an issue.

Ok, thank you. I will try it out.