Go Down

Topic: sim900 imei not works (Read 2595 times) previous topic - next topic

merci

why my sim900 not work for the imei to show on serial monitor..?
I use arduino uno and ICOMSAT VI.1 sim900
this the code that i used
Code: [Select]
// 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);
}

and the result: modem, no answer, here the screenshot I attached...
please help, thanks

dannable

This is the code I ran:

Code: [Select]
#define power_pin 9
#define RxPin 2
#define TxPin 3

#include <SoftwareSerial.h>

SoftwareSerial GPRS(RxPin, TxPin); // RX, TX

void setup()
{
  pinMode(13, OUTPUT);
  digitalWrite(13,LOW);  
  powerUp();
  GPRS.begin(19200);
  Serial.begin(19200);
}

void loop()
{
  if (GPRS.available())
  {
    while(GPRS.available())
    {
      Serial.write(GPRS.read());
    }
  }
  if (Serial.available())
  {
    GPRS.write(Serial.read());
  }
}

void powerUp()
{
  pinMode(power_pin, OUTPUT);
  digitalWrite(power_pin,LOW);
  delay(1000);
  digitalWrite(power_pin,HIGH);
  delay(2000);
  digitalWrite(power_pin,LOW);
  delay(3000);
}


(IcomSat shield, Tx on 2, Rx on 3)
Once loaded give it a few seconds to initialise...
and these are my results:

Code: [Select]

AT

OK
AT+GSN

012345678901234

OK
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

Go Up