Hello, I am working on another part of my system which is, sending SMS to multiple recipients using AT command. Using AT+CMGS is working but for single recipient. I've tried also using for loop from an array of numbers, still not working. I wonder how to implement such process using AT Comm.
Hope you have some sources or idea about it.
I don't have any device like yours, but maybe I can try to help anyway...
Would you please send the simplest successful code for sending sms?
Hello Fernando, below is the working codes for sending single sms.
Serial1.println("AT+CPIN?"); // Is SIM ready to use? delay(1000); delay(3000); Serial.println("Connecting to the network..."); Serial1.println("AT+CGREG?"); // Is device registered? delay(1000); Serial1.print("AT+CMGF=1\r"); //Because we want to send the SMS in text mode delay(1000); Serial1.println("AT+CMGS=\"your_mobile_number\""); delay(1000); Serial.print(c); delay(1000); Serial1.println((char)26); //the ASCII code of the ctrl+z is 26 (0x1A) delay(1000); Serial1.println();
Thanks for sending details, if you look at the code in section 22 of the Intel document, there is
if (Serial1.available()) Serial.write(Serial1.read());
do you have that code in your sketch? I don't know if that's essential, but I'd use it just in case, mostly in the debug phase.
There are other details at 3G/GPRS shield over Arduino and Raspberry Pi, including arduino code you may test in your environment...
Edit: just in case, another link: 3G + GPS Shield for Arduino - LinkSprite Playgound