AT+CMSS TO SEND SMS TO MULTIPLE RECIPIENTS

For the last two days I have been working on sending SMS to multiple recipients through AT commands.
I have been modifying the code that I attached to this post.
Last night I got to know from the link I address here,
SMS Tutorial: Sending SMS Messages from a Computer/PC Using AT Commands (AT+CMGS, AT+CMSS) that we ought to use the AT+CMSS in order to send multiple sms.
And that it sends message from the sms storage area in sim.I tried through this way........

gsm.print("AT+CMGF=1\r");
delay(100);
gsm.println("AT + CMSS=3,""");
gsm.println("AT + CMSS=3,"
**"");
gsm.println("AT + CMSS=3,"**********"");
delay(100);
gsm.println((char)26);
delay(100);
gsm.println();
delay(5000);
gsmpower();

It's working for me but only sending message to the first number.

Can you people please suggest me the way to use AT+CMSS command help my project complete.!!!!

Thanks in advance!!!
Regards
PavanKumar

code 6 mem.txt (998 Bytes)

You probably want this
http://forum.arduino.cc/index.php?topic=243348.0

pavankumar:
For the last two days I have been working on sending SMS to multiple recipients through AT commands.
I have been modifying the code that I attached to this post.
Last night I got to know from the link I address here,
SMS Tutorial: Sending SMS Messages from a Computer/PC Using AT Commands (AT+CMGS, AT+CMSS) that we ought to use the AT+CMSS in order to send multiple sms.
And that it sends message from the sms storage area in sim.I tried through this way........

gsm.print("AT+CMGF=1\r");
delay(100);
gsm.println("AT + CMSS=3,""");
gsm.println("AT + CMSS=3,"
**"");
gsm.println("AT + CMSS=3,"**********"");
delay(100);
gsm.println((char)26);
delay(100);
gsm.println();
delay(5000);
gsmpower();

It's working for me but only sending message to the first number.

Can you people please suggest me the way to use AT+CMSS command help my project complete.!!!!

Thanks in advance!!!
Regards
PavanKumar

A quick workaround is to create multiple void functions and then call those in your void loop. For instance:

void loop()
{
str="hello world"
sendSMS1();
sendSMS2();
sendSMS3();
sendSMS4();
sendSMS5();
delay(2000);

}

void sendSMS1() //you have to create this for each of the sendSMS* functions.
{

for(int i=0;i<=5;i++){

Serial.println("enter for loop");
gsm.print("AT+CMGF=1");
delay(80);
gsm.println("AT + CMGS = "number1"); // for sendSMS2, use the corresponding number, so also for the remaining from 3 to 5.
delay(80);
gsm.println(str);
delay(80);
gsm.println((char)26);
delay(80);
Serial.print("sending message to");
Serial.println(num*); *

  • gsmpower(); *

  • i++; *

  • }*
    }
    Admittedly, there might be faster and more efficient ways, but this method works...and that is the bottom line.
    Enjoy coding.

1 Like

but this method works

Nonsense. It doesn't even compile.

I know this but it would be tiresome. Can I use better logic here

Put the code that sends the message in a separate procedure, then use a for...next loop, passing each number to the procedure in turn.

Put the recipients' phone numbers into an array and use a loop to run through the array while sending an sms to each of the phone numbers.

Note: AT commands for sending an sms should be inside the loop.

gsm.print("AT+CMGF=1\r");
delay(100);
gsm.println("AT + CMSS=3,"""); //why dont you try to put a delay between the different receiver
delay(100);
gsm.println("AT + CMSS=3,"
**"");
delay(100);
gsm.println("AT + CMSS=3,"**********"");
delay(100);
gsm.println((char)26);
delay(100);
gsm.println();
delay(5000);
gsmpower();

so, did you solve the problem?
what is the solution?