Seems cant connect to Blynk server

My ESP8266 is able to connect to my wifi. However, when I tried to included Blynk IOT into my program, the serial monitor keep saying

AT+CIPSTART=1,"TCP","blynk-cloud.com",80
AT+CIPCLOSE=1

it keep repeating this 2 sentences after connected to the wifi. What’s happen? Is it a problem of my code??

Here is my code on Arduino IDE

//Libraries
#include <DHT.h>;
#include <ESP8266_Lib.h>
//#include <ESP8266WiFi.h>;
#include "WiFiEsp.h"
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif

#define DHTPIN 10     // connect the dht output to 10(pwm) 
#define DHTTYPE DHT22   // DHT 22  (AM2302)
#define led 8   //connect to led to pin 8-->change to motor later
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino

#define BLYNK_PRINT Serial
#include <BlynkSimpleShieldEsp8266.h>
#define EspSerial Serial
#define ESP8266_BAUD 115200
#define BLYNK_TEMPLATE_ID "***"
#define BLYNK_DEVICE_NAME "DHT22"
#define BLYNK_AUTH_TOKEN "";

//Variables
int chk;
float hum;  //Stores humidity value
float temp; //Stores temperature value

char ssid[] = ""; //You can replace the wifi name to your wifi
char pass[] = "";  //Type password of your wifi.
int status = WL_IDLE_STATUS;     // the Wifi radio's status

char auth[] = "nfxC29MO9ja1n6hzopoqMg2EA56Znw6N";
ESP8266 wifi(&EspSerial);

void setup()
{
  // initialize serial for debugging
  Serial.begin(115200);
  // initialize serial for ESP module
  Serial1.begin(115200);
  // initialize ESP module
  WiFi.init(&Serial1);
  pinMode(LED_BUILTIN, OUTPUT);
  dht.begin(); //start running the dht
  pinMode (led, OUTPUT); //set the led(pin8) as output
  pinMode (LED_BUILTIN, OUTPUT); //set the led on board as output

  // check for the presence of the shield
  if (WiFi.status() == WL_NO_SHIELD) {
    digitalWrite(LED_BUILTIN, LOW); //no on board led if no wifi
    Serial.println("WiFi is not connected");
    // don't continue
    while (true);
  }

  // attempt to connect to WiFi network
  while ( status != WL_CONNECTED) {
    digitalWrite(LED_BUILTIN, HIGH);//connecting have on board led
    Serial.print("Connecting to ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network
    status = WiFi.begin(ssid, pass);
  }

  // you're connected now, so print out the data
  Serial.println("You're connected to the network");
  EspSerial.begin(ESP8266_BAUD);
  Blynk.begin(auth, wifi, ssid, pass);

}

void loop()
{
  delay(2000);

  digitalWrite(LED_BUILTIN, HIGH);
  delay(200);
  digitalWrite(LED_BUILTIN, LOW);
  delay(200);

  Blynk.run();

  //Read data and store it to variables hum and temp
  hum = dht.readHumidity();
  temp = dht.readTemperature();
  //Print temp and humidity values to serial monitor(help checking the data)
  Serial.print("Humidity: ");
  Serial.print(hum);
  Serial.print(" %, Temp: ");
  Serial.print(temp);
  Serial.println(" Celsius");

  if (temp >= 20) //running the motor with sensor
  {
    digitalWrite(led, HIGH); //switch on motor
    delay(1000);
  }
  else
  {
    digitalWrite(led, LOW); //switch off motor
    delay(1000);
  }
  delay(1000); //Delay 2 sec.
}

@Neptune please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

@PeteKnight I am so sorry since this is my first time using this community. I am not sure how its work. Thank you for your advice.

These have to be the very first two lines of your sketch.

Pete.

@PeteKnight Thank you for your advice. I have changed the program like this.

#define BLYNK_TEMPLATE_ID "***"
#define BLYNK_DEVICE_NAME "DHT22"
#define BLYNK_PRINT Serial

//Libraries
#include <DHT.h>;
#include <ESP8266_Lib.h>
//#include <ESP8266WiFi.h>;
#include "WiFiEsp.h"
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif

#define DHTPIN 10     // connect the dht output to 10(pwm) 
#define DHTTYPE DHT22   // DHT 22  (AM2302)
#define led 8   //connect to led to pin 8-->change to motor later
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino

#include <BlynkSimpleShieldEsp8266.h>
#define EspSerial Serial
#define ESP8266_BAUD 115200
#define BLYNK_AUTH_TOKEN "***";

However, the results remains like this

AT+CIPCLOSE=1
AT+CIPCLOSE=1
AT+CIPSTART=1,"TCP","blynk.cloud",80

@PeteKnight is it related to the problem of simpletimer??? if yes where and what should i add to the code?

The problem is that you are using the serial port for communication with Blynk (via the ESP-01) and for debug output.

Change this line

to this:

#define EspSerial Serial1

Pete.

@PeteKnight Thx for the help. Now, it show

Ready (ping: 22ms).

I think it should be fine.
However, when I get into the blynk IOT app or blynk webpage. The connection seems not very stable, it keep disconnected and connecting. Is there my problem of the code??
Also, if I would like to control light bulb(pin8) with the app, what should I set for it?? I saw people can set the pin when thay are using the old app.
Moreover, I am not able to detect the temperture anymore. It keep repeating

Ready (ping: 22ms).

but not showing the temperature in the serial monitor.

Yes, now your problem is being caused by your void loop and delays, instead of using BlynkTimer.
Read this…

Use a virtual pin, and read this…

Pete.

@PeteKnight Thank you for your advice. After reading the 2 pages. I changed the code to this. However, it still doesn’t connected.

//Libraries
#include <DHT.h>;
#include <ESP8266_Lib.h>
//#include <ESP8266WiFi.h>;
#include "WiFiEsp.h"
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif

#define DHTPIN 10     // connect the dht output to 10(pwm) 
#define DHTTYPE DHT22   // DHT 22  (AM2302)
#define led 8   //connect to led to pin 8-->change to motor later
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino

#define BLYNK_TEMPLATE_ID "***"
#define BLYNK_DEVICE_NAME "DHT22"
#define BLYNK_PRINT Serial
#include <BlynkSimpleShieldEsp8266.h>
//#include <SimpleTimer.h>
#define EspSerial Serial1
#define ESP8266_BAUD 115200
#define BLYNK_AUTH_TOKEN "***";

//Variables
int chk;
float hum;  //Stores humidity value
float temp; //Stores temperature value

char ssid[] = "GoCO"; //You can replace the wifi name to your wifi
char pass[] = "29882992";  //Type password of your wifi.
int status = WL_IDLE_STATUS;     // the Wifi radio's status

char auth[] = "nfxC29MO9ja1n6hzopoqMg2EA56Znw6N";
ESP8266 wifi(&EspSerial);
SimpleTimer timer;

//int virtual_pin_value = param.asInt();
//param.asStrng()
//param.asFloat()
//BlynkTimer timer;

void setup()
{
  // initialize serial for debugging
  Serial.begin(115200);
  // initialize serial for ESP module
  Serial1.begin(115200);
  // initialize ESP module
  WiFi.init(&Serial1);
  pinMode(LED_BUILTIN, OUTPUT);
  dht.begin(); //start running the dht
  pinMode (led, OUTPUT); //set the led(pin8) as output
  pinMode (LED_BUILTIN, OUTPUT); //set the led on board as output
  WifiStatus();
}

void WifiStatus()
{

  // check for the presence of the shield
  if (WiFi.status() == WL_NO_SHIELD) {
    digitalWrite(LED_BUILTIN, LOW); //no on board led if no wifi
    Serial.println("WiFi is not connected");
    // don't continue
    while (true);
  }

  // attempt to connect to WiFi network
  while ( status != WL_CONNECTED) {
    digitalWrite(LED_BUILTIN, HIGH);//connecting have on board led
    Serial.print("Connecting to ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network
    status = WiFi.begin(ssid, pass);
  }

  // you're connected now, so print out the data
  Serial.println("You're connected to the network");
  timer.setInterval(1000L, sensorDataSend); //timer will run every sec
  EspSerial.begin(ESP8266_BAUD);
  Blynk.begin(auth, wifi, ssid, pass);
  sensorDataSend();
}

void sensorDataSend()
{
  delay(2000);

  digitalWrite(LED_BUILTIN, HIGH);
  delay(200);
  digitalWrite(LED_BUILTIN, LOW);
  delay(200);

  hum = dht.readHumidity();
  temp = dht.readTemperature();
  //Print temp and humidity values to serial monitor(help checking the data)
  Serial.print("Humidity: ");
  Serial.print(hum);
  Serial.print(" %, Temp: ");
  Serial.print(temp);
  Serial.println(" Celsius");

  if (temp >= 20) //running the motor with sensor
  {
    digitalWrite(led, HIGH); //switch on motor
    delay(1000);
  }
  else
  {
    digitalWrite(led, LOW); //switch off motor
    delay(1000);
  }
  delay(1000); //Delay 2 sec.

  //  sensorValue = analogRead(A5);         // reading sensor from analog pin
  //  Blynk.virtualWrite(V1, sensorValue);  // sending sensor value to Blynk app
}
BLYNK_WRITE(V1) // Executes when the value of virtual pin 1 changes
{
  if(param.asInt() == 1)
  {
    // execute this code if the switch widget is now ON
    sensorDataSend();
  }
  else
  {
    // execute this code if the switch widget is now OFF
    digitalWrite(led, LOW); 
  }
}
void loop()
{
  Blynk.run();
  timer.run(); // Initiates SimpleTimer
}

Like already told before you’ll need to put the template id and device name lines on top of the code.

@bazzio oh I know, I tried both way and it seems they are the same. The problem that I am facing is the connection is not that stable. It keep disconnected and all the time in the app. However, in the serial monitor, it keep replying

Ready (ping: 22ms).

You can’t use delays with Blynk!

Pete.

Yes, you can’t use delay with blynk, especially in the loop. Check this out :
https://docs.blynk.io/en/legacy-platform/legacy-articles/keep-your-void-loop-clean

You should use blynktimer or simpletimer instead.

@PeteKnight @John93 Thank you for the advice
So I should change all the delay() to

timer.setInterval(1000L, sensorDataSent);

what should I replace with the " sensorDataSent", if I just want a delay??

@PeteKnight @John93
Here is my update. I created a new void and change all the delay to simple timer. but nothing changed. the connection is still not stable.

void delaytimer()
{
  int count = 0;
  Serial.print("delay");
  Serial.print(count);
  count++;
}
void sensorDataSend()
{
  timer.setInterval(200L, delaytimer);

  digitalWrite(LED_BUILTIN, HIGH);
  timer.setInterval(20L, delaytimer);
  digitalWrite(LED_BUILTIN, LOW);
  timer.setInterval(20L, delaytimer);

  hum = dht.readHumidity();
  temp = dht.readTemperature();
  //Print temp and humidity values to serial monitor(help checking the data)
  Serial.print("Humidity: ");
  Serial.print(hum);
  Serial.print(" %, Temp: ");
  Serial.print(temp);
  Serial.println(" Celsius");

  if (temp >= 20) //running the motor with sensor
  {
    digitalWrite(led, HIGH); //switch on motor
    timer.setInterval(100L, delaytimer);
  }
  else
  {
    digitalWrite(led, LOW); //switch off motor
    timer.setInterval(100L, delaytimer);
  }
  timer.setInterval(100L, delaytimer); //Delay 2 sec.

  //  sensorValue = analogRead(A5);         // reading sensor from analog pin
  //  Blynk.virtualWrite(V1, sensorValue);  // sending sensor value to Blynk app
}

For your reference here is the full version of my code

//Libraries
#include <DHT.h>;
#include <ESP8266_Lib.h>
//#include <ESP8266WiFi.h>;
#include "WiFiEsp.h"
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif

#define DHTPIN 10     // connect the dht output to 10(pwm) 
#define DHTTYPE DHT22   // DHT 22  (AM2302)
#define led 8   //connect to led to pin 8-->change to motor later
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino

#define BLYNK_TEMPLATE_ID "TMPL5vzGTnYc"
#define BLYNK_DEVICE_NAME "DHT22"
#define BLYNK_PRINT Serial
#include <BlynkSimpleShieldEsp8266.h>
//#include <SimpleTimer.h>
#define EspSerial Serial1
#define ESP8266_BAUD 115200
#define BLYNK_AUTH_TOKEN "***";

//Variables
int chk;
float hum;  //Stores humidity value
float temp; //Stores temperature value

char ssid[] = "GoCO"; //You can replace the wifi name to your wifi
char pass[] = "***";  //Type password of your wifi.
int status = WL_IDLE_STATUS;     // the Wifi radio's status

char auth[] = "***";
ESP8266 wifi(&EspSerial);
SimpleTimer timer;

//int virtual_pin_value = param.asInt();
//param.asStrng()
//param.asFloat()
//BlynkTimer timer;

void delaytimer()
{
  int count = 0;
  Serial.print("delay");
  Serial.print(count);
  count++;
}
void setup()
{
  // initialize serial for debugging
  Serial.begin(115200);
  // initialize serial for ESP module
  Serial1.begin(115200);
  // initialize ESP module
  WiFi.init(&Serial1);
  pinMode(LED_BUILTIN, OUTPUT);
  dht.begin(); //start running the dht
  pinMode (led, OUTPUT); //set the led(pin8) as output
  pinMode (LED_BUILTIN, OUTPUT); //set the led on board as output
  WifiStatus();
}

void WifiStatus()
{

  // check for the presence of the shield
  if (WiFi.status() == WL_NO_SHIELD) {
    digitalWrite(LED_BUILTIN, LOW); //no on board led if no wifi
    Serial.println("WiFi is not connected");
    // don't continue
    while (true);
  }

  // attempt to connect to WiFi network
  while ( status != WL_CONNECTED) {
    digitalWrite(LED_BUILTIN, HIGH);//connecting have on board led
    Serial.print("Connecting to ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network
    status = WiFi.begin(ssid, pass);
  }

  // you're connected now, so print out the data
  Serial.println("You're connected to the network");
  timer.setInterval(1000L, sensorDataSend); //timer will run every sec
  EspSerial.begin(ESP8266_BAUD);
  Blynk.begin(auth, wifi, ssid, pass);
  sensorDataSend();
}

void sensorDataSend()
{
  timer.setInterval(200L, delaytimer);

  digitalWrite(LED_BUILTIN, HIGH);
  timer.setInterval(20L, delaytimer);
  digitalWrite(LED_BUILTIN, LOW);
  timer.setInterval(20L, delaytimer);

  hum = dht.readHumidity();
  temp = dht.readTemperature();
  //Print temp and humidity values to serial monitor(help checking the data)
  Serial.print("Humidity: ");
  Serial.print(hum);
  Serial.print(" %, Temp: ");
  Serial.print(temp);
  Serial.println(" Celsius");

  if (temp >= 20) //running the motor with sensor
  {
    digitalWrite(led, HIGH); //switch on motor
    timer.setInterval(100L, delaytimer);
  }
  else
  {
    digitalWrite(led, LOW); //switch off motor
    timer.setInterval(100L, delaytimer);
  }
  timer.setInterval(100L, delaytimer); //Delay 2 sec.

  //  sensorValue = analogRead(A5);         // reading sensor from analog pin
  //  Blynk.virtualWrite(V1, sensorValue);  // sending sensor value to Blynk app
}
BLYNK_WRITE(V1) // Executes when the value of virtual pin 1 changes
{
  if (param.asInt() == 1)
  {
    // execute this code if the switch widget is now ON
    sensorDataSend();
  }
  else
  {
    // execute this code if the switch widget is now OFF
    digitalWrite(led, LOW);
  }
}
void loop()
{
  Blynk.run();
  timer.run(); // Initiates SimpleTimer
}

It must be in the beginning of the sketch.

Try this :

/*************************************************************
  WARNING!
    It's very tricky to get it working. Please read this article:
    http://help.blynk.cc/hardware-and-libraries/arduino/esp8266-with-at-firmware

  This example shows how value can be pushed from Arduino to
  the Blynk App.

  WARNING :
  For this example you'll need Adafruit DHT sensor libraries:
    https://github.com/adafruit/Adafruit_Sensor
    https://github.com/adafruit/DHT-sensor-library

  App project setup:
    Value Display widget attached to V5
    Value Display widget attached to V6
 *************************************************************/

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID           "TMPLxxxxxx"
#define BLYNK_DEVICE_NAME           "Device"
#define BLYNK_AUTH_TOKEN            "YourAuthToken"


// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial


#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <DHT.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1

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

// Your ESP8266 baud rate:
#define ESP8266_BAUD 38400

ESP8266 wifi(&EspSerial);

#define DHTPIN 2          // What digital pin we're connected to

// Uncomment whatever type you're using!
#define DHTTYPE DHT11     // DHT 11
//#define DHTTYPE DHT22   // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21   // DHT 21, AM2301

DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendSensor()
{
  float h = dht.readHumidity();
  float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V5, h);
  Blynk.virtualWrite(V6, t);
}

void setup()
{
  // Debug console
  Serial.begin(115200);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);

  dht.begin();

  // Setup a function to be called every second
  timer.setInterval(1000L, sendSensor);
}

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

@John93 As I said before, i don’t think this change help much but I follow your advice and change it to this

#define BLYNK_TEMPLATE_ID "TMPL5vzGTnYc"
#define BLYNK_DEVICE_NAME "DHT22"
#define BLYNK_AUTH_TOKEN "***";
#define BLYNK_PRINT Serial

//Libraries
#include <DHT.h>;
#include <ESP8266_Lib.h>
//#include <ESP8266WiFi.h>;
#include "WiFiEsp.h"
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif

#define DHTPIN 10     // connect the dht output to 10(pwm) 
#define DHTTYPE DHT22   // DHT 22  (AM2302)
#define led 8   //connect to led to pin 8-->change to motor later
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino

#include <BlynkSimpleShieldEsp8266.h>
//#include <SimpleTimer.h>
#define EspSerial Serial1
#define ESP8266_BAUD 115200

//Variables
int chk;
float hum;  //Stores humidity value
float temp; //Stores temperature value

char ssid[] = "GoCO"; //You can replace the wifi name to your wifi
char pass[] = "29882992";  //Type password of your wifi.
int status = WL_IDLE_STATUS;     // the Wifi radio's status

char auth[] = "***";
ESP8266 wifi(&EspSerial);
SimpleTimer timer;

//int virtual_pin_value = param.asInt();
//param.asStrng()
//param.asFloat()
//BlynkTimer timer;

void delaytimer()
{
  int count = 0;
  Serial.print("delay");
  Serial.print(count);
  count++;
}
void setup()
{
  // initialize serial for debugging
  Serial.begin(115200);
  // initialize serial for ESP module
  Serial1.begin(115200);
  // initialize ESP module
  WiFi.init(&Serial1);
  pinMode(LED_BUILTIN, OUTPUT);
  dht.begin(); //start running the dht
  pinMode (led, OUTPUT); //set the led(pin8) as output
  pinMode (LED_BUILTIN, OUTPUT); //set the led on board as output
  WifiStatus();
}

void WifiStatus()
{

  // check for the presence of the shield
  if (WiFi.status() == WL_NO_SHIELD) {
    digitalWrite(LED_BUILTIN, LOW); //no on board led if no wifi
    Serial.println("WiFi is not connected");
    // don't continue
    while (true);
  }

  // attempt to connect to WiFi network
  while ( status != WL_CONNECTED) {
    digitalWrite(LED_BUILTIN, HIGH);//connecting have on board led
    Serial.print("Connecting to ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network
    status = WiFi.begin(ssid, pass);
  }

  // you're connected now, so print out the data
  Serial.println("You're connected to the network");
  timer.setInterval(1000L, sensorDataSend); //timer will run every sec
  EspSerial.begin(ESP8266_BAUD);
  Blynk.begin(auth, wifi, ssid, pass);
  sensorDataSend();
}

void sensorDataSend()
{
  timer.setInterval(200L, delaytimer);

  digitalWrite(LED_BUILTIN, HIGH);
  timer.setInterval(20L, delaytimer);
  digitalWrite(LED_BUILTIN, LOW);
  timer.setInterval(20L, delaytimer);

  hum = dht.readHumidity();
  temp = dht.readTemperature();
  //Print temp and humidity values to serial monitor(help checking the data)
  Serial.print("Humidity: ");
  Serial.print(hum);
  Serial.print(" %, Temp: ");
  Serial.print(temp);
  Serial.println(" Celsius");

  if (temp >= 20) //running the motor with sensor
  {
    digitalWrite(led, HIGH); //switch on motor
    timer.setInterval(100L, delaytimer);
  }
  else
  {
    digitalWrite(led, LOW); //switch off motor
    timer.setInterval(100L, delaytimer);
  }
  timer.setInterval(100L, delaytimer);
  //  sensorValue = analogRead(A5);         // reading sensor from analog pin
  //  Blynk.virtualWrite(V1, sensorValue);  // sending sensor value to Blynk app
}
BLYNK_WRITE(V1) // Executes when the value of virtual pin 1 changes
{
  if (param.asInt() == 1)
  {
    // execute this code if the switch widget is now ON
    sensorDataSend();
  }
  else
  {
    // execute this code if the switch widget is now OFF
    digitalWrite(led, LOW);
  }
}
void loop()
{
  Blynk.run();
  timer.run(); // Initiates SimpleTimer
}

and the result is remains the same

14:03:22.700 -> [36283] Connected to WiFi
14:03:58.008 -> [71605] Ready (ping: 14ms).
14:04:58.433 -> [132027] Ready (ping: 13ms).
14:05:33.753 -> [167344] Ready (ping: 28ms).
14:06:09.052 -> [202650] Ready (ping: 14ms).
14:06:44.361 -> [237958] Ready (ping: 13ms).
14:07:19.650 -> [273276] Ready (ping: 13ms).

You’ve totally mis-understood the way in which timers are supposed to be used.
You aren’t meant to be using a timer to simulate a delay.
The main delay in your original code was there to ensure that the sensor was only read once every 2 seconds. In reality, when using a DHT sensor, that really ought to be every 5 seconds.

To achieve this without a delay, a timer is defined which will call the code to read the sensor once every 2 (but preferably 5) seconds.

If you also want to flash an LED on and off when the sensor is read then you’d either use a timeout timer, or a 3rd party library like Ticker.

You can read about timeout timers, along with the correct way to use interval timers, here…

but for now I would simply focus on using a timer to read the sensor, then add-in the LED flashing code later.

Pete.

@PeteKnight I deleted some of the timer and delay.

#define BLYNK_TEMPLATE_ID "TMPL5vzGTnYc"
#define BLYNK_DEVICE_NAME "DHT22"
#define BLYNK_AUTH_TOKEN "";
#define BLYNK_PRINT Serial

//Libraries
#include <DHT.h>;
#include <ESP8266_Lib.h>
//#include <ESP8266WiFi.h>;
#include "WiFiEsp.h"
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif

#define DHTPIN 10     // connect the dht output to 10(pwm) 
#define DHTTYPE DHT22   // DHT 22  (AM2302)
#define led 8   //connect to led to pin 8-->change to motor later
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino

#include <BlynkSimpleShieldEsp8266.h>
//#include <SimpleTimer.h>
#define EspSerial Serial1
#define ESP8266_BAUD 115200

//Variables
int chk;
float hum;  //Stores humidity value
float temp; //Stores temperature value

char ssid[] = "GoCO"; //You can replace the wifi name to your wifi
char pass[] = "";  //Type password of your wifi.
int status = WL_IDLE_STATUS;     // the Wifi radio's status

char auth[] = "";
ESP8266 wifi(&EspSerial);
SimpleTimer timer;

//int virtual_pin_value = param.asInt();
//param.asStrng()
//param.asFloat()
//BlynkTimer timer;

void delaytimer()
{
  int count = 0;
  Serial.print("delay");
  Serial.print(count);
  count++;
}
void setup()
{
  // initialize serial for debugging
  Serial.begin(115200);
  // initialize serial for ESP module
  Serial1.begin(115200);
  // initialize ESP module
  WiFi.init(&Serial1);
  pinMode(LED_BUILTIN, OUTPUT);
  dht.begin(); //start running the dht
  pinMode (led, OUTPUT); //set the led(pin8) as output
  pinMode (LED_BUILTIN, OUTPUT); //set the led on board as output
  WifiStatus();
}

void WifiStatus()
{

  // check for the presence of the shield
  if (WiFi.status() == WL_NO_SHIELD) {
    digitalWrite(LED_BUILTIN, LOW); //no on board led if no wifi
    Serial.println("WiFi is not connected");
    // don't continue
    while (true);
  }

  // attempt to connect to WiFi network
  while ( status != WL_CONNECTED) {
    digitalWrite(LED_BUILTIN, HIGH);//connecting have on board led
    Serial.print("Connecting to ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network
    status = WiFi.begin(ssid, pass);
  }

  // you're connected now, so print out the data
  Serial.println("You're connected to the network");
  EspSerial.begin(ESP8266_BAUD);
  Blynk.begin(auth, wifi, ssid, pass);
  timer.setTimeout(3600000L, [] () {} ); // dummy/sacrificial Function
  timer.setInterval(5000L, sensorDataSend); // call the take_sensor_reading() function every 5 seconds
  sensorDataSend();
}

void sensorDataSend()
{
  //timer.setInterval(200L, delaytimer);

  digitalWrite(LED_BUILTIN, HIGH);
  timer.setTimeout(20, delaytimer);
  digitalWrite(LED_BUILTIN, LOW);
  timer.setTimeout(20, delaytimer);

  hum = dht.readHumidity();
  temp = dht.readTemperature();
  //Print temp and humidity values to serial monitor(help checking the data)
  Serial.print("Humidity: ");
  Serial.print(hum);
  Serial.print(" %, Temp: ");
  Serial.print(temp);
  Serial.println(" Celsius");

  if (temp >= 20) //running the motor with sensor
  {
    digitalWrite(led, HIGH); //switch on motor
  }
  else
  {
    digitalWrite(led, LOW); //switch off motor
  }
  //  sensorValue = analogRead(A5);         // reading sensor from analog pin
  //  Blynk.virtualWrite(V1, sensorValue);  // sending sensor value to Blynk app
}
BLYNK_WRITE(V1) // Executes when the value of virtual pin 1 changes
{
  if (param.asInt() == 1)
  {
    // execute this code if the switch widget is now ON
    sensorDataSend();
  }
  else
  {
    // execute this code if the switch widget is now OFF
    digitalWrite(led, LOW);
  }
}
void loop()
{
  Blynk.run();
  timer.run(); // Initiates SimpleTimer
}

But it doesnt help, what should I do? am I still misunderstanding sth?

14:48:38.646 -> [255444] Ready (ping: 14ms).
14:49:03.957 -> [280749] Ready (ping: 14ms).