ARDUINO GSM SHIELD 2 and Arduino MEGA

Hi,

I have an ARDUINO GSM SHIELD 2 and arduino MEGA.

It’s possible to get IMEI and quality of signal ? System return always “0” (both).

I have connected pin 2 to 10.

example:

// libraries
#include <GSM.h>

// modem verification object
GSMModem modem;

// IMEI variable
String IMEI = "";

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
  }

  // 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("Resetting 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);
}

return:

Modem's IMEI: 0

Thanks.

If use directly SoftwareSerial and AT commands:

AT+GSN

868XXXXXXXXXXXXX

OK

works …

CODE:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 3);

char inChar = 0;

void setup()  
{
  Serial.begin(9600);
  Serial.println("Device ready");
  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
}


void loop() // run over and over
{
  if (mySerial.available()){
    inChar = mySerial.read();
    Serial.write(inChar);
    delay(20);
    }
    
  if (Serial.available()>0){
    mySerial.write(Serial.read());
  }
}

what is my problem with gsm library ?

Ok..

PROBLEM SOLVED with old version of IDE ... arduino ide 1.6.5..

Why ?

Any solution ?

Current carrier: vodafone
Signal Strength: 27 [0-31]
Scanning available networks. May take some seconds.
> vodafone