Getting errors while compiling the GSM test codes

Hi everyone,

My OBJECTIVE: perfoming basic tests on “GSM/GPRS Modem” not shield.

i have gsm/gprs modem with me and i am trying to do some basics tests for this i choose the following code and this code is from the site

and the code is

/*

 This example test if your modem is working correctly.

 Circuit:
 * GSM shield attached (using digital pins 2, 3, and 7)

 Created 12 Jun 2012
 by David del Peral
 modified 21 Nov 2012
 by Tom Igoe
 */

// libraries
#include <GSM.h>

// modem verification object
GSMModem modem;

// IMEI variable
String IMEI = "";

void setup()
{
  // initialize serial communications
  Serial.begin(9600);

  // start modem test (reset and check response)
  Serial.print("Starting modem test...");
  if(modem.begin())
    Serial.println("modem.begin() succeeded");
  else
    Serial.println("ERROR, no modem answer.");
}

void loop()
{
  // get modem IMEI
  Serial.print("Checking IMEI...");
  IMEI = modem.getIMEI();

  // check IMEI response
  if(IMEI != NULL)
  {
    // show IMEI in serial monitor
    Serial.println("Modem's IMEI: " + IMEI);
    // reset modem to check booting:
    Serial.print("Reseting modem...");
    modem.begin();
    // get and check IMEI one more time
    if(modem.getIMEI() != NULL)
    {
      Serial.println("Modem is functoning properly");
    }
    else
    {
      Serial.println("Error: getIMEI() failed after modem.begin()");
    }
  }
  else
  {
    Serial.println("Error: Could not get IMEI");
  }
  // do nothing:
  while(true);
}

to compile this code i have to include the GSM.h file, i have downloaded this from the following link

https://code.google.com/p/gsm-shield-arduino/source/browse/branches/GSMSHIELD/GSM.h?r=102

here i am not adding this file because the header file contains too many lines…

when i am compiling the code i am getting the following errors

GSM_IMEI_testing.cpp:9:1: error: ‘GSMModem’ does not name a type
GSM_IMEI_testing.cpp: In function ‘void setup()’:
GSM_IMEI_testing.cpp:19:4: error: ‘modem’ was not declared in this scope
GSM_IMEI_testing.cpp: In function ‘void loop()’:
GSM_IMEI_testing.cpp:28:8: error: ‘modem’ was not declared in this scope

anyone reading this post please help me out how to overcome this error. and any mistakes i’ve done please correct me…

where can i get the GSM.h,SMS.h and GPRS related libraries can anyone post a link…

thanks in advance…

My OBJECTIVE: perfoming basic tests on “GSM/GPRS Modem”

Which modem? The code on the page you linked to is ONLY for the GSM shield that the Arduino store sells.

where can i get the GSM.h,SMS.h and GPRS related libraries can anyone post a link…

They come with the IDE. No need to download them.

why it is showing this error????

Perhaps it doesn't like your poor spelling.

is there any other way to check the Modem is properly working or not???

If the modem wasn't working (to some degree, at least), you wouldn't have gotten to the point where you got the error you couldn't be bothered researching.

hi,

I'm having same problem as.... ysrinivas described above. im getting error -

error: 'GSMModem' does not name a type

In function 'void IMEI_number()':
error: 'modem' was not declared in this scope
error: 'modem' was not declared in this scope

Plz tell me how to come out from this errors.

Plz tell me how to come out from this errors.

ysrinivas was asked for more details. None were supplied. It seems rather pointless to say that you are having the same problem, without supplying any more details, and still expect to get help.