Go Down

Topic: Send SMS using Uno and elecfreaks SIM900 breakout bord (Read 247 times) previous topic - next topic

KerneelsM

I'm trying to send an SMS from my UNO. The code I'm using is:
Code: [Select]
[/
void Do_the_switch(void){
  if((Pos=="U1Front")&&(Switch_state=="on")){//verify light position and switch state to be.
    digitalWrite(U1Frontsw,on);              //Switch on this light.
    Temp='\"'+Phone_Num+'\"';                //format the Phone Number as read from the SMS
    Serial.print("Temp=");
    Serial.println(Temp);
    mySerial.print("AT+CMGS=\"+27716758370\"\r"); //initiate SMS sending
    delay(5000);
    mySerial.println("U1Front is switched on");   //Send the confirmation SMS of the switching done.
  }code]
It doesn't seem to initiate the sending of the SMS. The confirmation SMS also is not sent.

Can someone respond?

dannable

Take a look at the bottom of the page I link to in my signature...
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

KerneelsM

1. I'm not using a shield but a breakout board.
2. The shield you are referring to has an established library that makes things substantially easier.
3. I'm using AT commands to control the SIM900 board not a library.

dannable

I don't see where I used a library in the page I linked to. All done through AT commands.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

KerneelsM

You're right.
The only difference between the link and my code is: I used '\"' instead of (as you used it) "\"".
Now everything works fine thank you.

Go Up