Go Down

Topic: AT+CMSS TO SEND SMS TO MULTIPLE RECIPIENTS (Read 17521 times) previous topic - next topic

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,
http://www.developershome.com/sms/sendSmsByAtCommands.asp     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



mistergreen

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

hecanet

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,
http://www.developershome.com/sms/sendSmsByAtCommands.asp     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.

PaulS

Quote
but this method works
Nonsense. It doesn't even compile.
The art of getting good answers lies in asking good questions.

pavankumar

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

dannable

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.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

Messach99

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.

MACKYDONALD

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();

galerivs

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

Go Up