Unable to connect Arduino with SIM900A

Hi,
I am trying to connect Arduino with Rotobotix SIM900A shield.(http://www.flipkart.com/rotobotix-sim900a-gsm-shield-arduino/p/itme7qpwy45evfm4)

I’ve plugged the SIM900A shield on my arduino and tried executing the example from GSMWebClient. But it doesn’t go beyond gsmAccess.begin(PINNUMBER). I dont have any “PINNUMBER” set for my SIM (Double checked by putting the SIM in my Phone). The Serial Monitor doesn’t show anything beyond Serial.println(“Starting Arduino web client.”);

It just stuck at the statement if(gsmAccess.begin(PINNUMBER) == GSM_READY)

Any idea what could be the issue ?

At least it should show some error message.

Below is my program:

/**********************************************************/
/* Web client

This sketch connects to a website through a GSM shield. Specifically,
this example downloads the URL "http://www.arduino.cc/asciilogo.txt" and
prints it to the Serial monitor.

Circuit:
* GSM shield attached to an Arduino
* SIM card with a data plan

created 8 Mar 2012
by Tom Igoe

http://www.arduino.cc/en/Tutorial/GSMExamplesWebClient

*/

// libraries
#include <GSM.h>

// PIN Number
#define PINNUMBER ""

// APN data
#define GPRS_APN       "airtelgprs.com" // replace your GPRS APN
#define GPRS_LOGIN     ""    // replace with your GPRS login
#define GPRS_PASSWORD  "" // replace with your GPRS password

// initialize the library instance
GSMClient client;
GPRS gprs;
GSM gsmAccess;

// URL, path & port (for example: arduino.cc)
char server[] = "arduino.cc";
char path[] = "/asciilogo.txt";
int port = 80; // port 80 is the default for HTTP

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

 Serial.println("Starting Arduino web client.");
 // connection state
 boolean notConnected = true;

 // After starting the modem with GSM.begin()
 // attach the shield to the GPRS network with the APN, login and password
 while (notConnected) {
   if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &
       (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
     notConnected = false;
   } else {
     Serial.println("Not connected");
     delay(1000);
   }
 }

 Serial.println("connecting...");

 // if you get a connection, report back via serial:
 if (client.connect(server, port)) {
   Serial.println("connected");
   // Make a HTTP request:
   client.print("GET ");
   client.print(path);
   client.println(" HTTP/1.1");
   client.print("Host: ");
   client.println(server);
   client.println("Connection: close");
   client.println();
 } else {
   // if you didn't get a connection to the server:
   Serial.println("connection failed");
 }
}

void loop() {
 // if there are incoming bytes available
 // from the server, read them and print them:
 if (client.available()) {
   char c = client.read();
   Serial.print(c);
 }

 // if the server's disconnected, stop the client:
 if (!client.available() && !client.connected()) {
   Serial.println();
   Serial.println("disconnecting.");
   client.stop();

   // do nothing forevermore:
   for (;;)
     ;
 }
}

/******************************************************************************/

Thanks
Sandeep

Good show! Thank you for marking it up. Admonishment removed on edit.

I must confess I have no experience with GSM devices but hopefully it will be clearer for someone who does!

Thanks Paul, I've changed the post as per the instructions.

Below is the warnings that i get while uploading this program to my Arduino UNO.

I

n file included from C:\Users\SSANDEE5\arduino-1.6.7-windows\arduino-1.6.7\libraries\GSM\src/GSM.h:46:0,

                from C:\Users\SSANDEE5\arduino-1.6.7-windows\My Arduino Projects\GsmWebClient\GsmWebClient.ino:20:

C:\Users\SSANDEE5\arduino-1.6.7-windows\arduino-1.6.7\libraries\GSM\src/GSM3ShieldV1BandManagement.h:49:125: warning: 'typedef' was ignored in this declaration [enabled by default]

typedef enum GSM3GSMBand {UNDEFINED, EGSM_MODE, DCS_MODE, PCS_MODE, EGSM_DCS_MODE, GSM850_PCS_MODE, GSM850_EGSM_DCS_PCS_MODE};

                                                                                                                            ^

C:\Users\SSANDEE5\arduino-1.6.7-windows\My Arduino Projects\GsmWebClient\GsmWebClient.ino: In function 'void setup()':

C:\Users\SSANDEE5\arduino-1.6.7-windows\My Arduino Projects\GsmWebClient\GsmWebClient.ino:54:35: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &

                                  ^

C:\Users\SSANDEE5\arduino-1.6.7-windows\My Arduino Projects\GsmWebClient\GsmWebClient.ino:55:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

        (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {

                                                            ^

C:\Users\SSANDEE5\arduino-1.6.7-windows\My Arduino Projects\GsmWebClient\GsmWebClient.ino:55:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

C:\Users\SSANDEE5\arduino-1.6.7-windows\My Arduino Projects\GsmWebClient\GsmWebClient.ino:55:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]