GSM shield 2 ; Where to begin?

I have recently bought the arduino gsm shield 2, but have some problems getting it to work. I have been trying the example code of sending an sms, and I have followed the tutorial of arduino step by step, but it doesn't seem able to connect to the sim-card.
I know the basics of arduino coding, but I'm no experienced user and I have never used a shield before, so I hope the question is not too silly. Thank you.

The link to the tutorial: Arduino GSM Shield - Intro part 1 - YouTube

Arduino's example code:

/*
 SMS sender

 This sketch, for the Arduino GSM shield,sends an SMS message
 you enter in the serial monitor. Connect your Arduino with the
 GSM shield and SIM card, open the serial monitor, and wait for
 the "READY" message to appear in the monitor. Next, type a
 message to send and press "return". Make sure the serial
 monitor is set to send a newline when you press return.

 Circuit:
 * GSM shield
 * SIM card that can send SMS

 created 25 Feb 2012
 by Tom Igoe

 This example is in the public domain.

 http://arduino.cc/en/Tutorial/GSMExamplesSendSMS

 */

// Include the GSM library
#include <GSM.h>

#define PINNUMBER ""

// initialize the library instance
GSM gsmAccess;
GSM_SMS sms;

void setup()
{
  // initialize serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  Serial.println("SMS Messages Sender");

  // connection state
  boolean notConnected = true;

  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while (notConnected)
  {
    if (gsmAccess.begin(PINNUMBER) == GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("GSM initialized");
}

void loop()
{

  Serial.print("Enter a mobile number: ");
  char remoteNum[20];  // telephone number to send sms
  readSerial(remoteNum);
  Serial.println(remoteNum);

  // sms text
  Serial.print("Now, enter SMS content: ");
  char txtMsg[200];
  readSerial(txtMsg);
  Serial.println("SENDING");
  Serial.println();
  Serial.println("Message:");
  Serial.println(txtMsg);

  // send the message
  sms.beginSMS(remoteNum);
  sms.print(txtMsg);
  sms.endSMS();
  Serial.println("\nCOMPLETE!\n");
}

/*
  Read input serial
 */
int readSerial(char result[])
{
  int i = 0;
  while (1)
  {
    while (Serial.available() > 0)
    {
      char inChar = Serial.read();
      if (inChar == '\n')
      {
        result[i] = '\0';
        Serial.flush();
        return 0;
      }
      if (inChar != '\r')
      {
        result[i] = inChar;
        i++;
      }
    }
  }
}

Have you remember to disable the pin-code on your sim-card, or write the pin-code in the sketch.

The sim has a pin, and I added it to the sketch, but I forgot to add it here.

The GSM Shield 2 has a on/off button. When you power the Arduino, you have to on the GSM Shield.

Hi BrechtV_8,

  1. Try the example GSM modem test sketch to ensure the modem is working ok.

  2. Check your sim is activated, i have fallen for this one too many times. Just rule this on out.

  3. Make sure your GSM shield has enough power to connect to the network.

  4. Try adding a 'delay(1000);' in your sketch between connection attempts, to allow the modem to reset / recover previous attempt before further connection attempts.

Check my youtube link below showing power usage during simple GSM communication (connecting web API and processing requested data packet). Power might be higher for SMS, Voice comms.

Good luck, and stick with it your figure it out.