Trouble with connecting Blynk with arduino via Blynk

I am using a Arduino with SIM800l to connect with Blynk library are updated bellow is my code

#define BLYNK_PRINT Serial


#define BLYNK_TEMPLATE_ID           "TMPxxxxxx"
#define BLYNK_TEMPLATE_NAME         "Device"
#define BLYNK_AUTH_TOKEN            "YourAuthToken"


// Select your modem:
#define TINY_GSM_MODEM_SIM800
//#define TINY_GSM_MODEM_SIM900
//#define TINY_GSM_MODEM_M590
//#define TINY_GSM_MODEM_A6
//#define TINY_GSM_MODEM_A7
//#define TINY_GSM_MODEM_BG96
//#define TINY_GSM_MODEM_XBEE

//#define BLYNK_HEARTBEAT 30

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

char apn[]  = "iot.com";
char user[] = "";
char pass[] = "";



#include <SoftwareSerial.h>
SoftwareSerial SerialAT(2, 3); // 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(BLYNK_AUTH_TOKEN, modem, apn, user, pass);
}

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

and my Serial monitor Output is


[5241] Modem init...
[5477] Connecting to network...
[12267] Network: AirTel
[12268] Connecting to iot.com ...
[20352] Connected to GPRS
[20424] Connecting to blynk.cloud:80
[28437] Ready (ping: 1859ms).
[35592] Connecting to blynk.cloud:80
[112663] Connecting to blynk.cloud:8080
[114908] Connecting to blynk.cloud:80
[118553] Ready (ping: 1244ms).
[146138] Connecting to blynk.cloud:80
[149699] Ready (ping: 1786ms).
[156853] Connecting to blynk.cloud:80
[233924] Connecting to blynk.cloud:8080
[236400] Connecting to blynk.cloud:80
[250350] Ready (ping: 902ms).
[257505] Connecting to blynk.cloud:80
[334576] Connecting to blynk.cloud:8080
[337055] Connecting to blynk.cloud:80
[351188] Connecting to blynk.cloud:8080
[365620] Connecting to blynk.cloud:80
[370414] Ready (ping: 2571ms).

it will continuously trys to connect please help me with it I am trying from last 3 days to connect GSM with Blynk @PeteKnight @Oleksii-QA

These ping times are too long, you need a stronger GPRS signal to get better responsiveness.

Pete.

Thank you Pete SIr for repay but the issue is not resolved yet @PeteKnight



[5240] Modem init...
[6505] Connecting to network...
[12027] Network: IDEA Cellular Limited
[12028] Connecting to internet ...
[19828] Connected to GPRS
[19899] Connecting to blynk.cloud:80
[21814] Ready (ping: 563ms).
[28969] Connecting to blynk.cloud:80
[89454] Connecting to blynk.cloud:8080
[95599] Connecting to blynk.cloud:80
[97442] Ready (ping: 624ms).
[104596] Connecting to blynk.cloud:80
[164785] Connecting to blynk.cloud:8080
[170968] Connecting to blynk.cloud:80
[172750] Ready (ping: 581ms).
[179904] Connecting to blynk.cloud:80
[240116] Connecting to blynk.cloud:8080
[246237] Connecting to blynk.cloud:80
[247982] Ready (ping: 545ms).
[255136] Connecting to blynk.cloud:80
[315442] Connecting to blynk.cloud:8080
[321705] Connecting to blynk.cloud:80
[323731] Ready (ping: 547ms).

still facing same issue with the strong network also

Might be worth specifying the regional server url in your Blynk.begin command.

Pete.

can you specify the URL as well please @PeteKnight as I am from India and what I have to do

Look at your Blynk app or web console and find which regional server your account is linked to.

Pete.

Hii, @PeteKnight

I have tried this also but same problem no response. please help me with it

What EXACTLY have you tried, and what are the results?

Pete.

@PeteKnight I Have tried to find a local domain but blynk.cloud is the only working domain I got and the Serial monitor results are bellow



[5216] Modem init...
[5442] Connecting to network...
[12222] Network: AirTel
[12222] Connecting to iot.com ...
[19002] Connected to GPRS
[19073] Connecting to blynk.cloud:80
[22483] Ready (ping: 1377ms).
[29636] Connecting to blynk.cloud:80
[106708] Connecting to blynk.cloud:8080
[108957] Connecting to blynk.cloud:80
[112778] Ready (ping: 903ms).
[119932] Connecting to blynk.cloud:80


I still have no idea what you’ve tried, because you won’t tell me which regional server your account is on.

Open the app and go to the About screen. What does it say under “Server”.
Or, if you can’t manage that, open the web console and find what it says in “Region” in the bottom right hand corner.

Then, tell me EXACTLY what your new Blynk.begin() command looks like.

I’m not interested in seeing anymore serial output until you’ve done these things.

Pete.

Hii @PeteKnight

my blyn.begin command is

Blynk.begin(auth, modem, apnVI, user, pass);

and


Blynk.begin(auth, modem, apnVI, user, pass,"blr1.blynk.cloud", 80);

i have tried both the begin commands

At last!
Not sure why that was so difficult for you.

Your ping times are still far too long, you need a stronger GPRS signal. Maybe try a different provider.

Pete.

@PeteKnight i have tride with hiher strenth also but when I get all the rx and rx data from GSM here as bellow

TX data to the GSM


AT
ATE0
AT+CMEE=0
AT+CLTS=1
AT+CBATCHK=1
AT+CPIN?
AT+CPIN?
AT+CREG?
AT+COPS?
AT+CIPSHUT
AT+CGATT=0
AT+SAPBR=3,1,"Contype","GPRS"
AT+SAPBR=3,1,"APN","airtelgprs.com"
AT+CGDCONT=1,"IP","airtelgprs.com"
AT+CGACT=1,1
AT+SAPBR=1,1
AT+SAPBR=2,1
AT+CGATT=1
AT+CIPMUX=1
AT+CIPQSEND=1
AT+CIPRXGET=1
AT+CSTT="airtelgprs.com","",""
AT+CIICR
AT+CIFSR;E0
AT+CDNSCFG="8.8.8.8","8.8.4.4"
AT+CIPCLOSE=0,1
AT+CIPCLOSE=0,1
AT+CIPCLOSE=0,1
AT+CIPSSL=0
AT+CIPSTART=0,"TCP","blynk.cloud",80
AT+CIPSTART=0,"TCP","blynk.cloud",80
AT+CIPRXGET=4,0
AT+CIPSTATUS=0
AT+CIPSEND=0,37
 QKtDjKHGVphVcGIbbm_uOiHnAL-B1TgLAT+CIPRXGET=4,0
AT+CIPSTATUS=0
AT+CIPRXGET=4,0
AT+CIPRXGET=2,0,5
AT+CIPSEND=0,158
�mcu0.0.0fw-typeTMPL3DMevk-fNbuildOct 14 2024 16:10:45blynk1.3.2h-beat30buff-in256devArduino UnocpuATmega328PconSIM800tmplTMPL3DMevk-fNAT+CIPRXGET=4,0
AT+CIPSTATUS=0
AT+CIPRXGET=4,0
AT+CIPSTATUS=0
AT+CIPSEND=0,11
vw30AT+CIPRXGET=4,0
AT+CIPSTATUS=0
AT+CIPSEND=0,11
vw30AT+CIPRXGET=4,0
AT+CIPSTATUS=0
AT+CIPSEND=0,11
vw30AT+CIPRXGET=4,0
AT+CIPSTATUS=0
AT+CIPSEND=0,11
vw30AT+CIPRXGET=4,0
AT+CIPSTATUS=0
AT+CIPSEND=0,11
avw30AT+CIPRXGET=4,0

and received commands from and data from gsm



SIM800 R14.18

OK

ERROR

OK

OK

OK

OK

OK

+CPIN: READY

OK

+CPIN: READY

OK

+CREG: 0,5

OK

+COPS: 0,0,"AirTel"

OK

SHUT OK

+SAPBR 1: DEACT

OK

OK

OK

OK

+CTZV: +22,0

*PSUTTZ: 2024,10,14,11,6,58,"+22",0

DST: 0

+CIEV: 10,"40490","AIRTEL","airtel", 0, 0

OK

OK

+SAPBR: 1,1,"10.28.54.184"
OK

OK

OK

OK

10.28.54.184

OK

OK

ERROR

ERROR

ERROR

OK

0, CONNECT OK

+CIPRXGET: 4,0,0

OK

+CIPSTATUS: 0,0,"TCP","68.183.87.221","80","CONNECTED"

OK

> 
DATA ACCEPT:0,37

+CIPRXGET: 4,0,0

OK

+CIPSTATUS: 0,0,"TCP","68.183.87.221","80","CONNECTED"

OK

+CIPRXGET: 1,0

+CIPRXGET: 4,0,5


+CIPRXGET: 4,0,0

OK

+CIPSTATUS: 0,0,"TCP","68.183.87.221","80","CONNECTED"

OK

+CIPRXGET: 1,0

+CIPRXGET: 4,0,5

OK

+CIPRXGET: 2,0,5,0
�
OK

> 
DATA ACCEPT:0,158

+CIPRXGET: 4,0,0

OK

+CIPSTATUS: 0,0,"TCP","68.183.87.221","80","CONNECTED"

OK

+CIPRXGET: 4,0,0

OK

That info means nothing to me I’m afraid.
The problem with disconnections is due to high latency on your GPRS connection, which can generally be improved with a better signal strength or switching to a different mobile provider.

Pete.