Delete SMS on Motorola W220 with Arduino

Hi,

I have recently found this: "Tutorial: Send SMS from your Arduino using an old Motorola cell phone" at http://murchlabs.com/send-sms-from-your-arduino/. 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.

Serial.println(phone.println("AT+CLAC"));

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

I am looking forward to hear from you.

King regards Greeneco

Hi.

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:
http://en.wikipedia.org/wiki/Motorola_Phone_AT_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:

Syntax
Test Command
AT+CMGD=?
Responses
+CMGD: (list of supported s)[,(list of supporteds)]
OK
Write Command
AT+CMGD=[,]
Responses
OK
ERROR
+CMS ERROR:
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.
Examples
AT+CMGD=1
OK

Hi,

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.

Serial.println(phone.println("AT+CLAC"));

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: http://www.google.com/url?q=http://www.motorolasolutions.com/web/Business/Products/M2M%2520Wireless%2520Modules/C24%2520CDMA%2520Wireless%2520Module/Document/staticfile/C24%2520AT%2520commands.pdf&sa=U&ei=a7jJU_3_J86pyATD9ICQDw&ved=0CBoQFjAB&sig2=EbD6zi98d8yAuzidOzXivw&usg=AFQjCNHZoSgpdExMagOSWBotWTj8mCCLlw 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.