Connect GPRS failed error

I am trying basic example of Blynk with GSM SIM800 module.
I have installed latest blynk and tinygsm libraries.
My code is as below:

#define BLYNK_PRINT Serial

#define TINY_GSM_MODEM_SIM800

#include <TinyGsmClient.h>
#include <BlynkSimpleTinyGSM.h>


char auth[] = "xxxxxxxxxxxxx";

// Your GPRS credentials
// Leave empty, if missing user or pass
char apn[]  = "airtelgprs.com";
char user[] = "";
char pass[] = "";

// Hardware Serial on Mega, Leonardo, Micro
//#define SerialAT Serial1

// or Software Serial on Uno, Nano
#include <SoftwareSerial.h>
SoftwareSerial SerialAT(7, 8); // RX, TX

TinyGsm modem(SerialAT);

void setup()
{
  // Debug console
  Serial.begin(9600);

  delay(10);

  // Set GSM module baud rate
  SerialAT.begin(9600);
  delay(3000);

  // Restart takes quite some time
  // To skip it, call init() instead of restart()
  Serial.println("Initializing modem...");
  modem.restart();

  // Unlock your SIM card with a PIN
  //modem.simUnlock("1234");

  Blynk.begin(auth, modem, apn, user, pass);
}

void loop()
{
  Blynk.run();
}

On running the above code, i get following output:

Initializing modem...
[9863] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino Uno

[9955] Modem init...
[10183] Connecting to network...
[16082] Network: AirTel
[16082] Connecting to airtelgprs.com ...
[19446] Connect GPRS failed

The module is not able to connect to GPRS.
I have checked the SIM card and it is working fine when installing it in the mobile phone.
Does anybody know how to proceed further.
Please help.

1 Like