Need help on gprs.AttachGPRS() connection issue, using SIM800 GSM/GPRS module


hi team,

i need immediate help/resolution on sim800 gsm/gprs module arduino uno. sketch not connecting internet. have tried multiple providers based out in india , specific apn. still gprs not showing gprs_ready. gsm getting turned on "gsmaccess.begin()" method. "gprs.attachgprs(gprs_apn, gprs_login, gprs_password)" status in "connecting" state. expecting gprs in gprs_ready state. code can connect 'gsmclient' other ip/server. below, pasting code sample reference.

code: [
#include <gsm.h>

//gprs apn data
#define gprs_apn       "internet" // (for idea) "imis"/"internet" // (for vodafone) "www"/"portalnmms"/"live.vodafone.com" // replace gprs apn
#define gprs_login     ""    // replace gprs login
#define gprs_password  "" // replace gprs password

gsmclient client;
gprs gprs;
gsm gsmaccess;

void setup()

  serial.begin(9600);
  while (!serial) {
    ; // wait serial port connect. needed native usb port only
  }

  boolean gsmconnected = false; //--connection state
  boolean grpsconnected = false;
  int ok = 0;

  //--start gsm shield 
  while (!gsmconnected) {
    serial.println("trying connect...");
    //if (gsmaccess.begin(pinnumber) == gsm_ready) {
    if (gsmaccess.begin() == gsm_ready)
    {     
      serial.println("gsm connected.");     
     
      gprs.attachgprs(gprs_apn, gprs_login, gprs_password);
      delay(1000);
      while (!grpsconnected)
      {
        ok = gsmaccess.getstatus();
        serial.println(ok);
        if (ok == gprs_ready)
        {     
           serial.println("gprs connected.");
           gsmconnected = true;
           grpsconnected = true;     
        }
        else
        {
          serial.println("gprs connection failed.");
          delay(1000);
        }
      }
    }
    else {
      serial.println("gsm not connected.");
      delay(3000);
    }
  }
  serial.println("gsm/gprs initializing...");
}

void loop()
{
....
}

]



Arduino Forum > Products > Arduino GSM Shield (Moderator: fabioc84) > Need help on gprs.AttachGPRS() connection issue, using SIM800 GSM/GPRS module


arduino

Comments

Popular posts from this blog

Valutazione Template - Joomla! Forum - community, help and support

SD Datastring Convention

First use of Arduino Uno : avrdude error on Blink uploading