Go Down

Topic: Sending SMS with GSM Shield (AT Commands) (Read 2015 times) previous topic - next topic

jkhloep

Hi..I'm new in arduino and I am trying to send sms but it does not work.

Here is the codes.

Code: [Select]
void setup()
{
  Serial.begin(9600);  //Default serial port setting for the GPRS modem is 19200bps 8-N-1-----------19200
  Serial.println("\r");
  delay(1000);                    //Wait for a second while the modem sends an "OK"
  Serial.println("AT+CMGF=1\r");    //Because we want to send the SMS in text mode
  delay(1000);

  Serial.println("AT+CSCA=\"+639180000101\"\r");  //Setting for the SMS Message center number, 
  delay(1000);                                  //uncomment only if required and replace with
                                                  //the message center number obtained from
                                                  //your GSM service provider.
                                                  //Note that when specifying a tring of characters
                                                  // " is entered as \"

  Serial.println("AT+CMGS=\"+639486808432\"\r");    //Start accepting the text for the message
                                                  //to be sent to the number specified.
                                                  //Replace this number with the target mobile number.
  delay(1000);
  Serial.println("SIM900 and Arduino say Hi!\r");   //The text for the message
  delay(1000);
  Serial.write(byte(0));
  //Serial.print(26,BYTE);  //Equivalent to sending Ctrl+Z
}

void loop()
{
      //We just want to send the SMS only once, so there is nothing in this loop.
      //If we put the code for SMS here, it will be sent again and again and cost us a lot.
}



I can't receive any messages..

Go Up