I want to create a climate control

It’s not good practise to compare a float against an int (or unsigned int in your case)

temp5 is a float
max_temp5 is uint_8

1 Like

I did the work on the bugs. Now void fantempcheck () works exactly. The error was that void fantempcheck () used data types intended for void tempcheck (). Thus, when data processing took place for both void fantempcheck () and void tempcheck (), a comparison error occurred and the algorithm got stuck. (maybe I’m wrong)
Already the whole day void fantempcheck () passes the test and there is no stuck.
Help me understand how Blynk.syncAll () works? There is a task to save the state of the relay after an unplanned reset. I added Blynk.syncAll () to the setup and it works, but only until the 2nd reset.
The controller runs the code being executed. Scheduler starts switching on the relay, for example, an error occurred in the code and the WDT worked.The controller has restarted, the state has reversed to the specified value. But if the reboot occurs again, the relay will not return its state any more, what am I doing wrong?

#define BLYNK_PRINT Serial
#define I2C_SCL 5  //d1    
#define I2C_SDA 4  //d2
#define humidifier 13
#define Heater 3
#define Fan 2 
#define Light 0
#define Pump 14 
#define Aero 12

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <EEPROM.h>
#include <Adafruit_Si7021.h>
#include <SimpleTimer.h>
#include <TimeLib.h>
#include <WidgetRTC.h>


WidgetRTC rtc;
BlynkTimer timer;

char currentTime[9];  
bool clockSync = false; 
bool pinValue32;
bool pinValue35;
bool pinValue38;
bool pinValue41;
bool metric = false;

float hum3, temp5;

uint8_t temppin ; // LOW/HIGH
uint8_t eeprom_temp5 ; // Allow/Disallow
uint8_t min_temp5;
uint8_t max_temp5;
bool flag_temp5_off_state = true;
bool flag_temp5_on_state = true;
uint8_t lastsettemp5;
//--------------------------------------- проба для вентилятора--------------------
uint8_t temppin51 ; // LOW/HIGH
uint8_t eeprom_temp51 ; // Allow/Disallow
uint8_t min_temp51;
uint8_t max_temp51;
bool flag_temp51_off_state = true;
bool flag_temp51_on_state = true;
uint8_t lastsettemp51;
/////////////////////////////////////////////////////////////////////////////////////
uint8_t hum3pin ; // LOW/HIGH
uint8_t eeprom_hum3 ; // Allow/Disallow
uint8_t min_hum3;
uint8_t max_hum3;
bool flag_fany_off_state = true;
bool flag_fany_on_state = true;
uint8_t lastm;
uint8_t lastbutton;
uint8_t lastp;
uint8_t lastsethum3;

char auth[] = "9babcd13";
char ssid[] = "Tool36";
har pass[] = "frekf123";

Adafruit_Si7021 sensor;
SimpleTimer timer1; // sensor timer
SimpleTimer timer2;  // humcheck
SimpleTimer timer3;  // tempcheck
SimpleTimer timer4;  // fantempcheck

unsigned long timestamp3;


WidgetTerminal terminal(V51);

BLYNK_WRITE(V50) // reset
{
  int pinValue = param.asInt();
  if (pinValue != lastp && pinValue > 0)
  {
    lastp = 0;
    ESP.reset();
  }
}


//-------------Timer pin-----------
BLYNK_WRITE(V32)
{
  int pinValue32 = param.asInt();
  digitalWrite(Light, pinValue32);
}

BLYNK_WRITE(V35)
{
  int pinValue35 = param.asInt();
  digitalWrite(Fan, pinValue35);
}

BLYNK_WRITE(V38)
{
  int pinValue38 = param.asInt();
  digitalWrite(Pump, pinValue38);
}

BLYNK_WRITE(V41)
{
  int pinValue41 = param.asInt();
  digitalWrite(Aero, pinValue41);
}
//---------------Timer pin end-----------------------------

//---------------------TEMP---------------------------------
BLYNK_WRITE(V19) // write EEPROM temp
{
  int pinValue = param.asInt();
  if (pinValue != lastp && pinValue > 0 && eeprom_temp5 == 1)
  {
    lastp = 0;
    int EEaddress = 164;
    EEPROM.write(EEaddress, min_temp5);
    EEaddress++;
    EEPROM.write(EEaddress, max_temp5);
    EEaddress++;
    EEPROM.write(EEaddress, temppin);
    EEPROM.commit();
    //ESP.reset();
  }
}
BLYNK_WRITE(V25) // eeprom access temp
{
  int pinValue = param.asInt();
  eeprom_temp5 = pinValue;
}
BLYNK_WRITE(V26) // level temp
{
  int pinValue = param.asInt();
  temppin = pinValue;
}

BLYNK_WRITE(V20) // setup temp
{
  int pinValue = param.asInt();
  lastsettemp5 = pinValue;
}
BLYNK_WRITE(V21) // temp down
{
  int pinValue = param.asInt();
  if (lastsettemp5 == 1)
  {
    if (pinValue != lastp && pinValue > 0 && min_temp5 > 0)
    {
      lastp = 0;
      min_temp5--;
      Blynk.virtualWrite(V23, min_temp5);
    }
  }

  if (lastsettemp5 == 0)
  {
    if (pinValue != lastp && pinValue > 0 && max_temp5 - min_temp5 > 1)
    {
      lastp = 0;
      max_temp5--;
      Blynk.virtualWrite(V24, max_temp5);
    }
  }
}
BLYNK_WRITE(V22) // temp up
{
  int pinValue = param.asInt();
  if (lastsettemp5 == 1)
  {
    if (pinValue != lastp && pinValue > 0 && max_temp5 - min_temp5 > 1)
    {
      lastp = 0;
      min_temp5++;
      Blynk.virtualWrite(V23, min_temp5);
    }
  }

  if (lastsettemp5 == 0)
  {
    if (pinValue != lastp && pinValue > 0 && max_temp5 < 100)
    {
      lastp = 0;
      max_temp5++;
      Blynk.virtualWrite(V24, max_temp5);
    }
  }
}
//---------------------TEMP END-----------------------------

//---------------------HUM---------------------------------
BLYNK_WRITE(V13) // write EEPROM hum
{
  int pinValue = param.asInt();
  if (pinValue != lastp && pinValue > 0 && eeprom_hum3 == 1)
  {
    lastp = 0;
    int EEaddress = 161;
    EEPROM.write(EEaddress, min_hum3);
    EEaddress++;
    EEPROM.write(EEaddress, max_hum3);
    EEaddress++;
    EEPROM.write(EEaddress, hum3pin);
    EEPROM.commit();
    //ESP.reset();
  }
}
BLYNK_WRITE(V9) // eeprom access hum
{
  int pinValue = param.asInt();
  eeprom_hum3 = pinValue;
}
BLYNK_WRITE(V12) // level hum
{
  int pinValue = param.asInt();
  hum3pin = pinValue;
}

BLYNK_WRITE(V14) // setup hum
{
  int pinValue = param.asInt();
  lastsethum3 = pinValue;
}
BLYNK_WRITE(V15) // hum down
{
  int pinValue = param.asInt();
  if (lastsethum3 == 1)
  {
    if (pinValue != lastp && pinValue > 0 && min_hum3 > 0)
    {
      lastp = 0;
      min_hum3--;
      Blynk.virtualWrite(V16, min_hum3);
    }
  }

  if (lastsethum3 == 0)
  {
    if (pinValue != lastp && pinValue > 0 && max_hum3 - min_hum3 > 1)
    {
      lastp = 0;
      max_hum3--;
      Blynk.virtualWrite(V18, max_hum3);
    }
  }
}
BLYNK_WRITE(V17) // hum up
{
  int pinValue = param.asInt();
  if (lastsethum3 == 1)
  {
    if (pinValue != lastp && pinValue > 0 && max_hum3 - min_hum3 > 1)
    {
      lastp = 0;
      min_hum3++;
      Blynk.virtualWrite(V16, min_hum3);
    }
  }

  if (lastsethum3 == 0)
  {
    if (pinValue != lastp && pinValue > 0 && max_hum3 < 100)
    {
      lastp = 0;
      max_hum3++;
      Blynk.virtualWrite(V18, max_hum3);
    }
  }
}
//---------------------HUM END-----------------------------
//---------------------TEMP---------------------------------
/*BLYNK_WRITE(V19) // write EEPROM temp
{
  int pinValue = param.asInt();
  if (pinValue != lastp && pinValue > 0 && eeprom_temp51 == 1)
  {
    lastp = 0;
    int EEaddress = 168;
    EEPROM.write(EEaddress, min_temp51);
    EEaddress++;
    EEPROM.write(EEaddress, max_temp51);
    EEaddress++;
    EEPROM.write(EEaddress, temppin);
    EEPROM.commit();
    //ESP.reset();
  }
}
BLYNK_WRITE(V25) // eeprom access temp
{
  int pinValue = param.asInt();
  eeprom_temp51 = pinValue;
} */
BLYNK_WRITE(V43) // level temp
{
  int pinValue = param.asInt();
  temppin51 = pinValue;
}

BLYNK_WRITE(V44) // setup temp
{
  int pinValue = param.asInt();
  lastsettemp51 = pinValue;
}
BLYNK_WRITE(V45) // temp down
{
  int pinValue = param.asInt();
  if (lastsettemp51 == 1)
  {
    if (pinValue != lastp && pinValue > 0 && min_temp51 > 0)
    {
      lastp = 0;
      min_temp51--;
      Blynk.virtualWrite(V46, min_temp51);
    }
  }

  if (lastsettemp51 == 0)
  {
    if (pinValue != lastp && pinValue > 0 && max_temp51 - min_temp51 > 1)
    {
      lastp = 0;
      max_temp51--;
      Blynk.virtualWrite(V47, max_temp51);
    }
  }
}
BLYNK_WRITE(V48) // temp up
{
  int pinValue = param.asInt();
  if (lastsettemp51== 1)
  {
    if (pinValue != lastp && pinValue > 0 && max_temp51 - min_temp51 > 1)
    {
      lastp = 0;
      min_temp51++;
      Blynk.virtualWrite(V46, min_temp51);
    }
  }

  if (lastsettemp51 == 0)
  {
    if (pinValue != lastp && pinValue > 0 && max_temp51< 100)
    {
      lastp = 0;
      max_temp51++;
      Blynk.virtualWrite(V47, max_temp51);
    }
  }
}
//---------------------TEMP END-----------------------------
void tempcheck()
{
  if (temp5 <= min_temp5 && flag_temp5_on_state)
  {
    if (temppin == 1 )
    {
      digitalWrite(3, LOW); //  вкл
      Blynk.virtualWrite(V27, 1023); //  вкл
      Blynk.virtualWrite(V28, 0); //  выкл
    } else {
      digitalWrite(3, HIGH); //  выкл
      Blynk.virtualWrite(V27, 0); //  выкл
      Blynk.virtualWrite(V28, 1023); //  вкл
    }
    flag_temp5_on_state = false;
    flag_temp5_off_state = true;
  }

  if (temp5 >= max_temp5 && flag_temp5_off_state)
  {
    if (temppin == 1 )
    {
      digitalWrite(3, HIGH); //  вкл
      Blynk.virtualWrite(V27, 0); //  вкл
      Blynk.virtualWrite(V28, 1023); //  выкл
    } else {
      digitalWrite(3, LOW); //  выкл
      Blynk.virtualWrite(V27, 1023); //  выкл
      Blynk.virtualWrite(V28, 0); //  выкл
    }
    flag_temp5_off_state = false;
    flag_temp5_on_state = true;
  }
}

void humcheck()
{
  if (hum3 <= min_hum3 && flag_fany_on_state)
  {
    if (hum3pin == 1 )
    {
      digitalWrite(13, LOW); //  вкл
      Blynk.virtualWrite(V10, 1023); //  вкл
      Blynk.virtualWrite(V11, 0); //  выкл
    } else {
      digitalWrite(13, HIGH); //  выкл
      Blynk.virtualWrite(V10, 0); //  выкл
      Blynk.virtualWrite(V11, 1023); //  выкл
    }
    flag_fany_on_state = false;
    flag_fany_off_state = true;
  }


  if (hum3 >= max_hum3 && flag_fany_off_state)
  {
    if (hum3pin == 1 )
    {
      digitalWrite(13, HIGH); //  вкл
      Blynk.virtualWrite(V10, 0); //  вкл
      Blynk.virtualWrite(V11, 1023); //  выкл
    } else {
      digitalWrite(13, LOW); //  выкл
      Blynk.virtualWrite(V10, 1023); //  выкл
      Blynk.virtualWrite(V11, 0); //  выкл
    }
    flag_fany_off_state = false;
    flag_fany_on_state = true;
  }
}
//-----------------auto Fan-----------------
void fantempcheck()
{
  if (temp5 >= max_temp51 && flag_temp51_on_state) // 
  {
    if (temppin51 == 1 )
    {
      digitalWrite(2, LOW); //  вкл
      Blynk.virtualWrite(V42, 1023); //  вкл
      Blynk.virtualWrite(V43, 0); //  выкл
    } else {
      digitalWrite(2, HIGH); //  выкл
      Blynk.virtualWrite(V42, 0); //  выкл
      Blynk.virtualWrite(V43, 1023); //  вкл
    }
    flag_temp51_on_state = false;
    flag_temp51_off_state = true;
    terminal.println("autoFan On ");
    terminal.println(temp5);
  }

  if (temp5 <= max_temp51 && flag_temp51_off_state) // 
  {
    if (temppin51 == 1 )
   {
      digitalWrite(2, HIGH); //  вкл
      Blynk.virtualWrite(V42, 0); //  вкл
      Blynk.virtualWrite(V43, 1023); //  выкл
    } else {
      digitalWrite(2, LOW); //  выкл
      Blynk.virtualWrite(V42, 1023); //  выкл
      Blynk.virtualWrite(V43, 0); //  выкл
    }
    flag_temp51_off_state = false;
    flag_temp51_on_state = true;
    terminal.println("autoFan Off ");
    terminal.println(temp5);
  }
  terminal.flush();
}
//----------------- end auto Fan-----------------
void sendSensor1()
{
  temp5 = sensor.readTemperature();
  hum3 = sensor.readHumidity();
  Blynk.virtualWrite(V3, hum3);
  Blynk.virtualWrite(V5, temp5);
}

void readEEPROM(int startAdr, int maxLength, char* dest)
{
  EEPROM.begin(256);
  delay(10);
  for (int i = 0; i < maxLength; i++)
  {
    dest[i] = char(EEPROM.read(startAdr + i));
  }
  EEPROM.end();
}
void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
  Wire.begin(I2C_SDA, I2C_SCL);
  ESP.wdtDisable();
  ESP.wdtEnable(WDTO_8S);
  Blynk.syncAll();
  ArduinoOTA.setHostname("ESP8266-climat"); //OTA Задаем имя сетевого порта
  //ArduinoOTA.setPassword((const char *)"0000"); //OTA Задаем пароль доступа для удаленной прошивки
  ArduinoOTA.begin(); //OTA Инициализируем OTA
  
  EEPROM.begin(256);
  min_hum3 = EEPROM.read(161);
  max_hum3 = EEPROM.read(162);
  hum3pin = EEPROM.read(163);
  min_temp5 = EEPROM.read(164);
  max_temp5 = EEPROM.read(165);
  temppin = EEPROM.read(166);

  pinMode(13, OUTPUT); // увлажнитель
  digitalWrite(13, LOW); // 
  pinMode(3, OUTPUT); // нагреватель
  digitalWrite(3, LOW); //
  pinMode(Light, OUTPUT);// свет
  digitalWrite(Light, HIGH);
  Blynk.virtualWrite(V32, HIGH);
  pinMode(Fan, OUTPUT);// вентилятор
  digitalWrite(Fan, LOW);
  Blynk.virtualWrite(V35, HIGH);
  pinMode(Pump, OUTPUT);//помпа воды
  digitalWrite(Pump, HIGH);
  Blynk.virtualWrite(V38, HIGH);
  pinMode(Aero, OUTPUT);//аэратор воды
  digitalWrite(Aero, HIGH);
  Blynk.virtualWrite(V41, HIGH);
      
  timer.setInterval(58000L, activetoday);  // check every 60s if ON / OFF trigger time has been reached
  timer.setInterval(1000L, clockDisplay);  // check every second if time has been obtained from the server
  timer.setInterval(2570L, sendSensor1);
  timer.setInterval(2350L, humcheck);
  timer.setInterval(2280L, tempcheck);
  timer.setInterval(2080L, fantempcheck);

  Blynk.virtualWrite(V16, min_hum3);
  Blynk.virtualWrite(V18, max_hum3);
  Blynk.virtualWrite(V24, max_temp5);
  Blynk.virtualWrite(V23, min_temp5);

  if (min_hum3 <= 30 ||  min_hum3 >= 99 || max_hum3 <= 30 ||  max_hum3 >= 99) {
    min_hum3 = 65;
    max_hum3 = 70;
  }
  if (min_temp5 <= 0 ||  min_temp5 >= 99 || max_temp5 <= 0 ||  max_temp5 >= 99) {
    min_temp5 = 20;
    max_temp5 = 26;
  }
  if (min_temp51 <= 0 ||  min_temp51 >= 99 || max_temp51 <= 0 ||  max_temp51 >= 99) {
    min_temp51 = 20;
    max_temp51 = 26;
  }
  if (!sensor.begin())
  {
    Serial.println("Couldn't find sensor!");
    while (1);
  }
}

BLYNK_CONNECTED() {
  rtc.begin();
}
//----------------------------Timer------------------------------
void activetoday(){         // check if schedule should run today
  if(year() != 1970){
    Blynk.syncVirtual(V30);
    Blynk.syncVirtual(V33);
    Blynk.syncVirtual(V36);
    Blynk.syncVirtual(V39);// sync scheduler #
  }
}

void clockDisplay(){  // only needs to be done once after time sync
  if((year() != 1970) && (clockSync == false)){ 
    sprintf(currentTime, "%02d:%02d:%02d", hour(), minute(), second());
    Serial.println(currentTime);
    terminal.println(currentTime);
    clockSync = true;
    terminal.flush();
  } 
}    

BLYNK_WRITE(V30) {   // Scheduler #1 Time Input widget  
  TimeInputParam t(param);
  unsigned int nowseconds = ((hour() * 3600) + (minute() * 60) + second());
  unsigned int startseconds = (t.getStartHour() * 3600) + (t.getStartMinute() * 60);  
  unsigned int stopseconds = (t.getStopHour() * 3600) + (t.getStopMinute() * 60);
  int dayadjustment = -1;  
  if(weekday() == 1){
    dayadjustment = 6; // needed for Sunday Time library is day 1 and Blynk is day 7
  }
  if(t.isWeekdaySelected((weekday() + dayadjustment))){ //Time library starts week on Sunday, Blynk on Monday  
    //Schedule is ACTIVE today 
    if(nowseconds >= startseconds - 31 && nowseconds <= startseconds + 31 ){    // 62s on 60s timer ensures 1 trigger command is sent
      pinMode(Light, OUTPUT);
      digitalWrite(Light, LOW);
      Blynk.virtualWrite(V31, 1023);  // turn on virtual LED
      Blynk.syncVirtual(Light);
      Serial.println("Schedule 1 started");
      terminal.println("Schedule 1 started");
      terminal.println(currentTime);
    }                  
    if(nowseconds >= stopseconds - 31 && nowseconds <= stopseconds + 31 ){   // 62s on 60s timer ensures 1 trigger command is sent
      pinMode(Light, OUTPUT);
      digitalWrite(Light, HIGH);
      Blynk.virtualWrite(V31, 1);   // turn OFF virtual LED
      Blynk.syncVirtual(Light);
      Serial.println("Schedule 1 finished");
      terminal.println("Schedule 1 finished");
      terminal.println(currentTime);
    }
    terminal.flush();               
  }
}

/*BLYNK_WRITE(V33) {   // Scheduler #2 Time Input widget  
  TimeInputParam t(param);
  unsigned int nowseconds = ((hour() * 3600) + (minute() * 60) + second());
  unsigned int startseconds = (t.getStartHour() * 3600) + (t.getStartMinute() * 60);  
  unsigned int stopseconds = (t.getStopHour() * 3600) + (t.getStopMinute() * 60);
  int dayadjustment = -1;  
  if(weekday() == 1){
    dayadjustment = 6; // needed for Sunday Time library is day 1 and Blynk is day 7
  }
  if(t.isWeekdaySelected((weekday() + dayadjustment))){ //Time library starts week on Sunday, Blynk on Monday  
    //Schedule is ACTIVE today 
    if(nowseconds >= startseconds - 31 && nowseconds <= startseconds + 31 ){    // 62s on 60s timer ensures 1 trigger command is sent
      pinMode(Fan, OUTPUT);
      digitalWrite(Fan, LOW);
      Blynk.virtualWrite(V34, 1023);  // turn on virtual LED
      Serial.println("Schedule 2 started");
    }                  
    if(nowseconds >= stopseconds - 31 && nowseconds <= stopseconds + 31 ){   // 62s on 60s timer ensures 1 trigger command is sent
      pinMode(Fan, OUTPUT);
      digitalWrite(Fan, HIGH);
      Blynk.virtualWrite(V34, 1);   // turn OFF virtual LED
      Serial.println("Schedule 2 finished");
    }               
  }
}
*/
BLYNK_WRITE(V36) {   // Scheduler #3 Time Input widget  
  TimeInputParam t(param);
  unsigned int nowseconds = ((hour() * 3600) + (minute() * 60) + second());
  unsigned int startseconds = (t.getStartHour() * 3600) + (t.getStartMinute() * 60);  
  unsigned int stopseconds = (t.getStopHour() * 3600) + (t.getStopMinute() * 60);
  int dayadjustment = -1;  
  if(weekday() == 1){
    dayadjustment = 6; // needed for Sunday Time library is day 1 and Blynk is day 7
  }
  if(t.isWeekdaySelected((weekday() + dayadjustment))){ //Time library starts week on Sunday, Blynk on Monday  
    //Schedule is ACTIVE today 
    if(nowseconds >= startseconds - 31 && nowseconds <= startseconds + 31 ){    // 62s on 60s timer ensures 1 trigger command is sent
      pinMode(Pump, OUTPUT);
      digitalWrite(Pump, LOW);
      Blynk.virtualWrite(V37, 1023);  // turn on virtual LED
      Serial.println("Schedule 3 started");
      terminal.println("Schedule 3 started");
      terminal.println(currentTime);
    }                  
    if(nowseconds >= stopseconds - 31 && nowseconds <= stopseconds + 31 ){   // 62s on 60s timer ensures 1 trigger command is sent
      pinMode(Pump, OUTPUT);
      digitalWrite(Pump, HIGH);
      Blynk.virtualWrite(V37, 1);   // turn OFF virtual LED
      Serial.println("Schedule 3 finished");
      terminal.println("Schedule 3 finished");
      terminal.println(currentTime);
    }
    terminal.flush();               
  }
}

BLYNK_WRITE(V39) {   // Scheduler #4 Time Input widget  
  TimeInputParam t(param);
  unsigned int nowseconds = ((hour() * 3600) + (minute() * 60) + second());
  unsigned int startseconds = (t.getStartHour() * 3600) + (t.getStartMinute() * 60);  
  unsigned int stopseconds = (t.getStopHour() * 3600) + (t.getStopMinute() * 60);
  int dayadjustment = -1;  
  if(weekday() == 1){
    dayadjustment = 6; // needed for Sunday Time library is day 1 and Blynk is day 7
  }
  if(t.isWeekdaySelected((weekday() + dayadjustment))){ //Time library starts week on Sunday, Blynk on Monday  
    //Schedule is ACTIVE today 
    if(nowseconds >= startseconds - 31 && nowseconds <= startseconds + 31 ){    // 62s on 60s timer ensures 1 trigger command is sent
      pinMode(Aero, OUTPUT);
      digitalWrite(Aero, LOW);
      Blynk.virtualWrite(V40, 1023);  // turn on virtual LED
      Serial.println("Schedule 4 started");
      terminal.println("Schedule 4 started");
      terminal.println(currentTime);
    }                  
    if(nowseconds >= stopseconds - 31 && nowseconds <= stopseconds + 31 ){   // 62s on 60s timer ensures 1 trigger command is sent
      pinMode(Aero, OUTPUT);
      digitalWrite(Aero, HIGH);
      Blynk.virtualWrite(V40, 1);   // turn OFF virtual LED
      Serial.println("Schedule 4 finished");
      terminal.println("Schedule 4 finished");
      terminal.println(currentTime);
    }               
  }
}

//-------------------------timer end--------------------
void loop() {
  if(Blynk.connected()){ 
    Blynk.run();        
  }                      
  timer.run();
  ESP.wdtFeed();
  ArduinoOTA.handle();
}

How many Blynk virtual object do you sync?

Thank you, I found an error in the code. It was necessary to place in the void setup()
Blynk.syncVirtual(V30);
Blynk.syncVirtual(V33);
Blynk.syncVirtual(V36);
Blynk.syncVirtual(V39);

2 Likes