Problem with stable connection (Blynk1.0)

Dear All!

I have faced with a very strange problem with my automatization project.
It is a very basic program to control 4 relays with Arduino MEGA and SIM800L GSM module. I have EVB ROHS GSM breakboard, so I can power it with 5V 2A (I have tested with AT commands, it works great). I use it with iOS (v15.6) all my Blynk (v1.1.0) and TinyGSM (v0.11.5) library are UpToDate. I use Blynk Server.

Sometimes the program continuously run for more hours (up to half day, without any problem), sometimes run it for hours but there are lot of connection failure, but it can reboot, and sometimes after several reboot, it is not able to reconnect, anymore I have message: Connection to blynk-coud.com:80 (neither 8080).

I have read all the related topics, but I couldn’t find the solution.

Is anybody who faced with this kind of problem, or is there anybody, who knows what can be the problem?

I have 2 questions left:

  • is is possible to run his code(after migration) without problem on Blynk2.0 ? or I would struggle with the same problem
  • this message (Connection to blynk-coud.com:80) means: my GPRS connection OK (as it said duing init), but I can’t reach the server or I understand it wrong?

Here is my code:

#define BLYNK_DEBUG
#define BLYNK_PRINT Serial

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_AUTH_TOKEN            "F50xR-ZqwHU3bxGQM_i0YqpiPoFQr9Eb"
#define TINY_GSM_MODEM_SIM800

#include <BlynkSimpleTinyGSM.h> 

// Default heartbeat interval for GSM is 60
// If you want override this value, uncomment and set this option:
//#define BLYNK_HEARTBEAT 30

#include <TinyGsmClient.h>
//#include <BlynkSimpleSIM800.h>
char auth[] = BLYNK_AUTH_TOKEN;

// Your GPRS credentials
// Leave empty, if missing user or pass
char apn[]  = "internet.telekom";
char user[] = "";
char pass[] = "";
// Hardware Serial on Mega, Leonardo, Micro
#define SerialAT Serial3

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

TinyGsm modem(SerialAT);

// This function will be called every time Slider Widget
// in Blynk app writes values to the Virtual Pin V1

int RelayControl1 = 24;    // I/O az 1. körhöz
int RelayControl2 = 25;    // I/O az 2. körhöz
int RelayControl3 = 26;    // I/O az 3. körhöz
int RelayControl4 = 27;    // I/O az 4. körhöz


BlynkTimer timer;

BLYNK_CONNECTED() {
    Blynk.syncAll();
}

void setup()
{

  pinMode(RelayControl1, OUTPUT);
  pinMode(RelayControl2, OUTPUT);
  pinMode(RelayControl3, OUTPUT);
  pinMode(RelayControl4, OUTPUT);

  digitalWrite(RelayControl1,HIGH);
  digitalWrite(RelayControl2,HIGH);
  digitalWrite(RelayControl3,HIGH);
  digitalWrite(RelayControl4,HIGH);

  
  // Debug console
  Serial.begin(9600);

  delay(10);

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

  // 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);
  //Blynk.begin(auth, modem, apn, user, pass, "blynk-cloud.com", 8080);

timer.setInterval(1000L, ellen);

}


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

void ellen(){
 if (Blynk.connected()==0) {
  Serial.println("Reload");
  Blynk.disconnect();
  digitalWrite(RelayControl1,HIGH);
  digitalWrite(RelayControl2,HIGH);
  digitalWrite(RelayControl3,HIGH);
  digitalWrite(RelayControl4,HIGH);

  Blynk.begin(auth, modem, apn, user, pass, "blynk-cloud.com", 8080);
    }
}

Thanks in advance,
Tamas

Hi,
i am also facing same issue, my network is coming for few second and stop, and not connecting to blynk.

did you get the solution for your problem

@Ajinkya are you using exactly the same hardware and connection method?

You certainly aren’t using the Blynk legacy cloud servers that @PokoTomi was using, as they are now decommissioned.

If this is in connection with your solar tracker project then it’s probably because of the weird things you’re doing with mixing Blynk.begin() with manual WiFi connection.

If it’s not part of that project then I’d suggest you create a new topic and explain exactly what hardware you are using, what connection method you are using, which libraries you are using, the code you are running and the serial output you see when you have a disconnection issue.

Pete.

1 Like

yes @PeteKnight this is the same project, i will share details on that same project.
thanks for your quick support