Doesn't send sms

So I am trying to do is to make a button triggered SMS, my code does not have any errors but the message will not send. I am using same circuit as is on arduino Button example site. Hope you can help me.

Anyways
sms.SendSMS(“041927045”, “Arduino SMS”);
works

#include "SIM900.h"
#include <SoftwareSerial.h>

#include "sms.h"
SMSGSM sms;

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];
boolean hassent=false;
int buttonState = 0;

void setup() 
{
  pinMode(2, INPUT); // Setting pinmode of button to input
  Serial.begin(9600);
  if (gsm.begin(2400)){
    started=true;  // set that gsm works
  }

};

void loop() 
{
  if(started){
    buttonState = digitalRead(2);
    if(buttonState == HIGH)
    {
      if (hassent == false)
      {
        sms.SendSMS("041927045", "Arduino SMS");
        hassent = true;
      }
    }
  }
};

When you press the button, you probably only want to send it once.

Which country - if UK use +44 instead on 0 in the number.

What hardware are you using?

Take a look at the link in my signature.

dannable: Which country - if UK use +44 instead on 0 in the number.

What hardware are you using?

Take a look at the link in my signature.

I am using gsm shield made by tinysine. So there isn't anything wrong with my code ?

hi..

  1. the phone number must be in the international 13 digit format .. +XX......... to recognized by GSM networks.
  2. Have you checked that the Library is compatible with you GSM shield ?

  3. A speed of 2400 is not normal for a GSM modem, they tend to default to 9600

Does the library have the ability to send a simple AT command and see the reply this will prove if the connection to the Modem is actually working..

SMS send is one of the most complex command sequences to send to Modem, so if there is a connection problem you are trying to run before you can walk..

Happy coding..

8) 8)

I typed tinysine gps into Google and top of the list is a video of how to do what you are trying to. Have you tried following that?