SIM800L Calls and messages works but Not connecting Internet

Hi All,

I am trying to implement a project with ESP32 and SIM800L. I can make calls and messages but when I try connecting to GPRS, NET LED blinks every 500mSec. I am giving proper power as required. I have used an Airtel 5G sim and am trying to connect 2g network.

I am using tiny GSM libraries. I have used the below code and serial monitor is showing GPRS connected but NET LED on SIM800L blinks continuously at every 500mSec.

Can anyone suggest my next steps related this issue?

Here is my code
"Code Begins"

#define TINY_GSM_MODEM_SIM800 // Uncomment for SIM800L modem

#include <TinyGsmClient.h>
#include <SoftwareSerial.h>

// Define your modem's serial port
#define SerialMon Serial  // Serial monitor
#define SerialAT Serial2  // Serial communication with SIM800L (ESP32 has multiple UARTs)

// Your SIM800L PIN and APN settings

#define SerialMonBaud 115200
#define SerialATBaud 9600

#define MODEM_TX    17  // TX pin (from ESP32 to SIM800L)
#define MODEM_RX    16  // RX pin (from SIM800L to ESP32)

// Initialize the modem
TinyGsm modem(SerialAT);

void setup() {
  // Start the serial monitor
  SerialMon.begin(SerialMonBaud);
  delay(10);

  // Start communication with the modem
  //SerialAT.begin(SerialATBaud, );
  SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);
  delay(3000);

  // Restart the modem
  modem.restart();
  SerialMon.println("SIM800L is ready!");

  // Check network registration
  checkNetwork();
}

void loop() {
  // Run periodic check
  delay(10000);
  checkNetwork();
}

// Function to check if the SIM800L is connected to the network
void checkNetwork() {
  String status;
  
  // Check if GPRS is attached to the network
  modem.sendAT("+CGATT?"); // Check GPRS attachment status
  status = modem.stream.readString();

  modem.sendAT("+SAPBR=3,1,\"CONTYPE\",\"GPRS\"");  // Set GPRS connection type
 modem.sendAT("+SAPBR=3,1,\"APN\",\"airtelgprs.com\""); // Replace 'your_apn' with your carrier's APN
 modem.sendAT("+SAPBR=1,1");  // Activate the bearer profile

  // Display the network status
  if (status.indexOf("1") != -1) {
    SerialMon.println("GPRS is connected!");
  } else {
    SerialMon.println("GPRS is not connected.");
  }
  
  // Check if the SIM800L is registered on the network
  modem.sendAT("+CREG?");  // Check network registration status
  status = modem.stream.readString();
  
  if (status.indexOf("+CREG: 0,1") != -1) {
    SerialMon.println("SIM800L is registered to the network (Home Network).");
  } else if (status.indexOf("+CREG: 0,5") != -1) {
    SerialMon.println("SIM800L is registered to the network (Roaming).");
  } else {
    SerialMon.println("SIM800L is not registered to the network.");
  }
}

COde Ends"

  1. What carrier is the SIM registered to?
  2. Does said carrier provide/support 2G? Many do not any more.

I'd like to add a little bit to this. Even though there is 2G network access and voice calls are possible on 2G, it is still conceivable that the service provider does not provide data access on 2G.

Hi,

Its Airtel and they have 2g services

Hi,
I tried using the the same sim in my phone and enable only 2G. I am able to access the internet. But when shifted to SIM800L, not connecting to internet and NET LED blinking every 500msec

It might be that the APN settings are incorrect. I recommend connecting to the modem with a terminal and checking the settings with AT commands

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.