ESP8266 Disconnects very frequintly from blynk server

Blynk Community, i have problem with transfering data to my blynk.app. I send 5 diffeent values to 5 display sensors in application simultaneously. Can you give me hint about my problem?

Code is below.

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SoftwareSerial.h>
#include <SimpleTimer.h>


SoftwareSerial EspSerial(2, 0); // RX, TX

boolean stringComplete = false; 
const int bSize = 20; 
char Buffer[bSize];  
char data[bSize];  
int ByteCount;
String str;
String tempStr;
String speedStr;
long inDataT;
long inDataG;
long inDataD;
long inDataF;
int speeds;
String tmp;


SimpleTimer timer_temp;
SimpleTimer timer_gas;
SimpleTimer timer_dist;
SimpleTimer timer_flame;
SimpleTimer timer_speed;

char auth[] = "e88d93a10ac24bd99f33730ecb7b5e8d";

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, "-----------", "-----------");
  delay(10);

  EspSerial.begin(9600);
  delay(10);

  timer_temp.setInterval(5000L, sendUptimeTemp);
  timer_gas.setInterval(5000L, sendUptimeGas);
  timer_dist.setInterval(5000L, sendUptimeDist);
  timer_flame.setInterval(5000L, sendUptimeFlame);
  timer_speed.setInterval(5000L, sendUptimeSpeed);

  while (Blynk.connect() == false) {
    // Wait until connected
  }
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

BLYNK_WRITE(V10)
{
  speeds = param.asInt();
}

BLYNK_WRITE(V11)
{
  if (param.asInt())
  {
    BLYNK_LOG("forward");
  }
}

BLYNK_WRITE(V12)
{
  if (param.asInt())
  {
    BLYNK_LOG("backward");
  }
}

BLYNK_WRITE(V13)
{
  if (param.asInt())
  {
    BLYNK_LOG("left");
  }
}

BLYNK_WRITE(V14)
{
  if (param.asInt())
  {
    BLYNK_LOG("right");
  }
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

void serialEventRx() 
{
  while (EspSerial.available()) {
    ByteCount = -1;
    ByteCount =  EspSerial.readBytesUntil('\n',Buffer,bSize);  
  
    if (ByteCount  > 0) {
      strcpy(data,Buffer);        
    }
    memset(Buffer, 0, sizeof(Buffer));
    EspSerial.flush();
    stringComplete = true;
  }
}

void serialEventTx(String tmp) 
{
  while (EspSerial.available()) {
    EspSerial.println(tmp);
    EspSerial.flush();
  }
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

void sendUptimeTemp()
{
  Blynk.virtualWrite(V0, inDataT);
  Blynk.virtualWrite(V9, inDataT);
  Blynk.virtualWrite(V5, inDataT);
}

void sendUptimeGas()
{
  Blynk.virtualWrite(V1, inDataG);
  Blynk.virtualWrite(V4, inDataG);
}

void sendUptimeDist()
{
  Blynk.virtualWrite(V2, inDataD);
  Blynk.virtualWrite(V6, 1023-inDataD);
}

void sendUptimeFlame()
{
  Blynk.virtualWrite(V3, inDataF);
  Blynk.virtualWrite(V8, inDataF);
}

void sendUptimeSpeed()
{
  Blynk.virtualWrite(V7,speeds);
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////


void loop()
{ 
  Blynk.run();
  timer_temp.run();
  timer_gas.run();
  timer_dist.run();
  timer_flame.run();
  timer_speed.run();
  
  serialEventRx();
  
  if (stringComplete)
  {  
    str = data;
    
   if (str.startsWith("temperature"))
    {
      tempStr = str; 
      serialEventTx(tempStr);
      
      str.remove(0,11);
      str.trim();
      inDataT = str.toInt();

    }
    if (str.startsWith("gas"))
    {
      tempStr = str; 
      serialEventTx(tempStr);
      
      str.remove(0,3);
      str.trim();
      inDataG = str.toInt();
    }
    if (str.startsWith("distance"))
    {
      tempStr = str;
      serialEventTx(tempStr);
      
      str.remove(0,8);
      str.trim();
      inDataD = str.toInt();
    }
    if (str.startsWith("flame"))
    {
      tempStr = str;
      serialEventTx(tempStr);
      
      str.remove(0,5);
      str.trim();
      inDataF = str.toInt();
    }
    if (str.startsWith("speed"))
    {
      str = String(speeds, DEC);
      speedStr = "speed " + str;
      
      serialEventTx(speedStr);
    }
  
    memset(data, 0, sizeof(data));
    str = "";
    tempStr = "";
    stringComplete = false;
  }
}

Log of my connection is below.

Also interface of my profile.

Maybe you’re sending to much data at a time… all your timers align on 5 second interval, so it produces bursts of data…

Then how can i send data not sumultaneously but 1 transaction after another?

You can send data at different time intervals,
Overall, you don’t need that much timers, why?

You can do it in one (or two)

First you do not need the timer function duplicated. One Simpletimer can handle multiple timers (I believe 10).
and yes you send to many values. I experienced same problems as well.

Hint 1: Use one Simpletimer:
If you want to have all data sent after the 5s you send too much.
SimpleTimer timer;
in Setup:
timer.setInterval(5000L, senddata1); timer.setInterval (6000L, senddata2); timer.setInterval(11000L, senddata3);

in the loop
timer.run();

Hint 2: for LEDs you might want to save the status (Alarm_last_reading in my example and only send data if the LED changes
such as:
if (!alarm_movement && Alarm_last_reading) { Blynk.virtualWrite(ALARM_LED,0); Alarm_last_reading = 0; } else { if (alarm_movement && !Alarm_last_reading) { Blynk.virtualWrite(ALARM_LED,1); Alarm_last_reading = 1; }

Thank you for your detailed explanation.

You wrote about (Alarm_last_reading and alarm_movement). Are these standard functions of blynk library?

No, they are variables, they contain data generated by something (sensor, or whatsoever).