Blynk GSM Arduino

@PeteKnight

Before creating the topic
blynk lib virsion 1.3.2

Arduino and GSM communication

blynk.cloud port 80

• Blynk Library version:1.3.2

I am using Arduino with a GSM module to connect to Blynk. When the GSM module connects to GPRS and then to the Blynk Cloud, it works fine initially. However, if the GPRS connection suddenly disconnects, the module skips reconnecting to GPRS and directly tries to reconnect to the Blynk Cloud. This causes unexpected connection failures. How can I fix this issue?


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

#define BLYNK_PRINT Serial  

#define TINY_GSM_MODEM_SIM800


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

#define SerialMon Serial

#ifndef __AVR_ATmega328P__
#define SerialAT Serial1

#else
#include <SoftwareSerial.h>
SoftwareSerial SerialAT(2, 3);  // RX, TX
#endif


const char apn[]  = "YourAPN";
const char user[] = "";
const char pass[] = "";


const char auth[] = "YourAuthToken";

TinyGsm modem(SerialAT);

void setup() {
  SerialMon.begin(9600);
  delay(10);

  SerialAT.begin(9600);
  delay(6000);

  SerialMon.println("Initializing modem...");
  modem.restart();

  String modemInfo = modem.getModemInfo();
  SerialMon.print("Modem Info: ");
  SerialMon.println(modemInfo);


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

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


Please fix the formatting of your topic, and Chang it from “Issues and errors” to “Need help…”.

Without more information on your hardware and without seeing your code it’s impossible to help.

Pete.