BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Local server and esp8266

Blynk Token : pKdEF1MNazj_aGhpq0VExG1CMTi5qT0n
[63560] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.0 on ESP8266

[63572] Connecting to blynk-cloud.com:80
Error: Could not read temperature data for sensor No.0
Error: Could not read temperature data for sensor No.1
Error: Could not read temperature data for sensor No.2
Error: Could not read temperature data for sensor No.3
connected
[63772] Invalid auth token

i have add this line with my server into void setup but without result :confused:

#include <FS.h>
#include <DNSServer.h>
#include <WiFiManager.h>
#include <ESP8266WebServer.h>
#include <BlynkSimpleEsp8266.h>
#include <ArduinoJson.h>
const char* host = "www.google.com"; 

/* TIMER */
#include <SimpleTimer.h>
SimpleTimer timer;

/* DS18B20 Temperature Sensor */
#include <OneWire.h>
#include<DallasTemperature.h> 
#define ONE_WIRE_BUS 2 // DS18B20 on arduino pin2 corresponds to D4 on physical board
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);

//BlynkTimer timer;

float temp_0;
float temp_1;
float temp_2;
float temp_3;
unsigned long lst_milis = 0;

const int relay_1 = 16;
const int relay_2 = 5;
const int relay_3 = 4;
const int relay_4 = 0;
const int relay_5 = 14;
const int relay_6 = 12;
const int relay_7 = 13;
const int relay_8 = 3;


#define SET_PIN 0

char blynk_token[40] = "";
bool shouldSaveConfig = false;

void saveConfigCallback () {
  Serial.println("Should save config");
  shouldSaveConfig = true;
}


BLYNK_CONNECTED()  //sygxronizei to esp otan bgei apo to reuma stis leitoyrgies poy eixe stamatisi
{
 Blynk.syncAll();
}


void setup()
{
  //Blynk.config(auth);
 // Blynk.begin(auth, ssid, pass);
 Blynk.config(blynk_token, "192.168.2.7", 8080);
  DS18B20.begin();
  timer.setInterval(1000L,getSendData);
  timer.setInterval(10000L,WiFiStatus);
  
  Serial.begin(115200);
  Serial.println();
  pinMode(SET_PIN, INPUT_PULLUP);
  delay(3000);

  //read configuration from FS json
  Serial.println("mounting FS...");
  if (SPIFFS.begin()) {
    Serial.println("mounted file system");
    if (SPIFFS.exists("/config.json")) {
      //file exists, reading and loading
      Serial.println("reading config file");
      File configFile = SPIFFS.open("/config.json", "r");
      if (configFile) {
        Serial.println("opened config file");
        DynamicJsonDocument jsonBuffer ( 1024 ) ;
        DeserializationError error = deserializeJson ( jsonBuffer, configFile ) ;
        if ( not error )
          {
            serializeJson(jsonBuffer, Serial);
            strcpy(blynk_token, jsonBuffer["blynk_token"]) ;
            Serial.println("\nparsed json");
            Serial.println( blynk_token );
          }
        else  
          Serial.println("failed to load json config");

        configFile.close();
    }
  } else {
    Serial.println("failed to mount FS");
  }

  WiFiManagerParameter custom_blynk_token("blynk", "blynk token", blynk_token, 32);
  WiFiManager wifiManager;
  wifiManager.setSaveConfigCallback(saveConfigCallback);
  wifiManager.addParameter(&custom_blynk_token);

  if (digitalRead(SET_PIN) == LOW) {
    wifiManager.resetSettings();
  }

  if (!wifiManager.autoConnect("Apo_Reptiles_Room")) {
    Serial.println("failed to connect and hit timeout");
    delay(3000);
    ESP.reset();
    delay(5000);
  }

  Serial.println("wifi connected");
  strcpy(blynk_token, custom_blynk_token.getValue());

  //save the custom parameters to FS
  if (shouldSaveConfig) {
    Serial.println("saving config");
    DynamicJsonDocument jsonBuffer ( 1024 ) ;
    jsonBuffer["blynk_token"] = blynk_token;

    File configFile = SPIFFS.open("/config.json", "w");
    if (!configFile) {
      Serial.println("failed to open config file for writing");
    }
    else
      serializeJson(jsonBuffer, configFile);
    configFile.close();
  }
  
  Serial.println();
  Serial.print("local ip : ");
  Serial.println(WiFi.localIP());
  Serial.print("Blynk Token : ");
  Serial.println(blynk_token);
  Blynk.config(blynk_token);
  }
}

void loop() {
  Blynk.run();
  timer.run(); // Initiates SimpleTimer
}


/***************************************************
 * Send Sensor data to Blynk
 **************************************************/
void getSendData(){
    unsigned long cur_millis = millis();
    if (cur_millis - lst_milis >= 2000)         //if 2 seconds since last mesurement 
        {
        lst_milis = cur_millis;
        DS18B20.requestTemperatures(); 
               
           temp_0 = DS18B20.getTempCByIndex(0); // Sensor 1 will capture Temp in Celcius
           temp_1 = DS18B20.getTempCByIndex(1); // Sensor 2 will capture Temp in Celcius
           temp_2 = DS18B20.getTempCByIndex(2); // Sensor 3 will capture Temp in Celcius  
           temp_3 = DS18B20.getTempCByIndex(2); // Sensor 3 will capture Temp in Celcius   

          if(temp_0 != -127){
            Serial.println(temp_0);
            Blynk.virtualWrite(21 , temp_0);    //virtual pin 1
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.0");
          }

          if(temp_1 != -127){
            Serial.println(temp_1);
            Blynk.virtualWrite(22 , temp_1);    //virtual pin 2
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.1");
            }

            if(temp_2 != -127){
            Serial.println(temp_2);
            Blynk.virtualWrite(23, temp_2);    //virtual pin 3
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.2");
           }
           if(temp_3 != -127){
            Serial.println(temp_3);
            Blynk.virtualWrite(24, temp_3);    //virtual pin 4
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.3");
           }
        }
    }



void WiFiStatus()
{
  WiFiClient client;
  if (client.connect(host, 80))
  {
        Serial.println("connected");
        client.stop();
     
    }
    else {
     Serial.println("connection failed!"); 
  digitalWrite(relay_1, HIGH); // Και εδω δηλωνεις οτι θα ξεκιναει κλειστο
  digitalWrite(relay_2, HIGH);
  digitalWrite(relay_3, HIGH);
  digitalWrite(relay_4, HIGH); 
  digitalWrite(relay_5, HIGH);
  digitalWrite(relay_6, HIGH);
  digitalWrite(relay_7, HIGH);
  digitalWrite(relay_8, HIGH); 
     client.stop();
    
   }
} 


    BLYNK_WRITE(V16)
{
  int pinData = param.asInt();
  digitalWrite(16, pinData);
}

BLYNK_WRITE(V5)
{
  int pinData = param.asInt();
  digitalWrite(5, pinData);
}

BLYNK_WRITE(V4)
{
  int pinData = param.asInt();
  digitalWrite(4, pinData);
}

BLYNK_WRITE(V0)
{
  int pinData = param.asInt();
  digitalWrite(0, pinData);
}

BLYNK_WRITE(V14)
{
  int pinData = param.asInt();
  digitalWrite(14, pinData);
}

BLYNK_WRITE(V12)
{
  int pinData = param.asInt();
  digitalWrite(12, pinData);
}

BLYNK_WRITE(V13)
{
  int pinData = param.asInt();
  digitalWrite(13, pinData);
}

BLYNK_WRITE(V3)
{
  int pinData = param.asInt();
  digitalWrite(3, pinData);
}```

This tells you that the device is trying to connect to the Blynk cloud servers, not your local server.
This will ALWAYS happen if you don’t specify the server IP address and port in your Blynk.begin or Blynk.config command.

Your local server Auth token is unique to that local server, it doesn’t exist on the cloud servers, and the cloud server Auth tokens don’t exist on your local server either, which is why you get the “Invalid Auth token” messages.

You should be using Blynk library version 0.6.1 with Blynk Legacy.

Pete.

Thanks you Pete!!! Very detailed answers thanks you again… can toy please tell me what can be add and remove of this code?

#include <FS.h>
#include <DNSServer.h>
#include <WiFiManager.h>
#include <ESP8266WebServer.h>
#include <BlynkSimpleEsp8266.h>
#include <ArduinoJson.h>
const char* host = "www.google.com"; 

/* TIMER */
#include <SimpleTimer.h>
SimpleTimer timer;

/* DS18B20 Temperature Sensor */
#include <OneWire.h>
#include<DallasTemperature.h> 
#define ONE_WIRE_BUS 2 // DS18B20 on arduino pin2 corresponds to D4 on physical board
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);

//BlynkTimer timer;

float temp_0;
float temp_1;
float temp_2;
float temp_3;
unsigned long lst_milis = 0;

const int relay_1 = 16;
const int relay_2 = 5;
const int relay_3 = 4;
const int relay_4 = 0;
const int relay_5 = 14;
const int relay_6 = 12;
const int relay_7 = 13;
const int relay_8 = 3;


#define SET_PIN 0

char blynk_token[40] = "";
bool shouldSaveConfig = false;

void saveConfigCallback () {
  Serial.println("Should save config");
  shouldSaveConfig = true;
}


BLYNK_CONNECTED()  //sygxronizei to esp otan bgei apo to reuma stis leitoyrgies poy eixe stamatisi
{
 Blynk.syncAll();
}


void setup()
{
  DS18B20.begin();
  timer.setInterval(1000L,getSendData);
  timer.setInterval(10000L,WiFiStatus);
  
  Serial.begin(115200);
  Serial.println();
  pinMode(SET_PIN, INPUT_PULLUP);
  delay(3000);

  //read configuration from FS json
  Serial.println("mounting FS...");
  if (SPIFFS.begin()) {
    Serial.println("mounted file system");
    if (SPIFFS.exists("/config.json")) {
      //file exists, reading and loading
      Serial.println("reading config file");
      File configFile = SPIFFS.open("/config.json", "r");
      if (configFile) {
        Serial.println("opened config file");
        DynamicJsonDocument jsonBuffer ( 1024 ) ;
        DeserializationError error = deserializeJson ( jsonBuffer, configFile ) ;
        if ( not error )
          {
            serializeJson(jsonBuffer, Serial);
            strcpy(blynk_token, jsonBuffer["blynk_token"]) ;
            Serial.println("\nparsed json");
            Serial.println( blynk_token );
          }
        else  
          Serial.println("failed to load json config");

        configFile.close();
    }
  } else {
    Serial.println("failed to mount FS");
  }

  WiFiManagerParameter custom_blynk_token("blynk", "blynk token", blynk_token, 32);
  WiFiManager wifiManager;
  wifiManager.setSaveConfigCallback(saveConfigCallback);
  wifiManager.addParameter(&custom_blynk_token);

  if (digitalRead(SET_PIN) == LOW) {
    wifiManager.resetSettings();
  }

  if (!wifiManager.autoConnect("Apo_Reptiles_Room")) {
    Serial.println("failed to connect and hit timeout");
    delay(3000);
    ESP.reset();
    delay(5000);
  }

  Serial.println("wifi connected");
  strcpy(blynk_token, custom_blynk_token.getValue());

  //save the custom parameters to FS
  if (shouldSaveConfig) {
    Serial.println("saving config");
    DynamicJsonDocument jsonBuffer ( 1024 ) ;
    jsonBuffer["blynk_token"] = blynk_token;

    File configFile = SPIFFS.open("/config.json", "w");
    if (!configFile) {
      Serial.println("failed to open config file for writing");
    }
    else
      serializeJson(jsonBuffer, configFile);
    configFile.close();
  }
  
  Serial.println();
  Serial.print("local ip : ");
  Serial.println(WiFi.localIP());
  Serial.print("Blynk Token : ");
  Serial.println(blynk_token);
  Blynk.config(blynk_token);
  }
}

void loop() {
  Blynk.run();
  timer.run(); // Initiates SimpleTimer
}


/***************************************************
 * Send Sensor data to Blynk
 **************************************************/
void getSendData(){
    unsigned long cur_millis = millis();
    if (cur_millis - lst_milis >= 2000)         //if 2 seconds since last mesurement 
        {
        lst_milis = cur_millis;
        DS18B20.requestTemperatures(); 
               
           temp_0 = DS18B20.getTempCByIndex(0); // Sensor 1 will capture Temp in Celcius
           temp_1 = DS18B20.getTempCByIndex(1); // Sensor 2 will capture Temp in Celcius
           temp_2 = DS18B20.getTempCByIndex(2); // Sensor 3 will capture Temp in Celcius  
           temp_3 = DS18B20.getTempCByIndex(2); // Sensor 3 will capture Temp in Celcius   

          if(temp_0 != -127){
            Serial.println(temp_0);
            Blynk.virtualWrite(21 , temp_0);    //virtual pin 1
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.0");
          }

          if(temp_1 != -127){
            Serial.println(temp_1);
            Blynk.virtualWrite(22 , temp_1);    //virtual pin 2
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.1");
            }

            if(temp_2 != -127){
            Serial.println(temp_2);
            Blynk.virtualWrite(23, temp_2);    //virtual pin 3
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.2");
           }
           if(temp_3 != -127){
            Serial.println(temp_3);
            Blynk.virtualWrite(24, temp_3);    //virtual pin 4
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.3");
           }
        }
    }



void WiFiStatus()
{
  WiFiClient client;
  if (client.connect(host, 80))
  {
        Serial.println("connected");
        client.stop();
     
    }
    else {
     Serial.println("connection failed!"); 
  digitalWrite(relay_1, HIGH); // Και εδω δηλωνεις οτι θα ξεκιναει κλειστο
  digitalWrite(relay_2, HIGH);
  digitalWrite(relay_3, HIGH);
  digitalWrite(relay_4, HIGH); 
  digitalWrite(relay_5, HIGH);
  digitalWrite(relay_6, HIGH);
  digitalWrite(relay_7, HIGH);
  digitalWrite(relay_8, HIGH); 
     client.stop();
    
   }
} 


    BLYNK_WRITE(V16)
{
  int pinData = param.asInt();
  digitalWrite(16, pinData);
}

BLYNK_WRITE(V5)
{
  int pinData = param.asInt();
  digitalWrite(5, pinData);
}

BLYNK_WRITE(V4)
{
  int pinData = param.asInt();
  digitalWrite(4, pinData);
}

BLYNK_WRITE(V0)
{
  int pinData = param.asInt();
  digitalWrite(0, pinData);
}

BLYNK_WRITE(V14)
{
  int pinData = param.asInt();
  digitalWrite(14, pinData);
}

BLYNK_WRITE(V12)
{
  int pinData = param.asInt();
  digitalWrite(12, pinData);
}

BLYNK_WRITE(V13)
{
  int pinData = param.asInt();
  digitalWrite(13, pinData);
}

BLYNK_WRITE(V3)
{
  int pinData = param.asInt();
  digitalWrite(3, pinData);
}

I’ve already told you, in post #15….

Pete.

ok pete thanks you…

in 192,168.1.251 replaced with my ip and port 8080 to 9443 such blynk app or not?

Port 8080 is correct.

Pete.

this can not work

 void setup()
{
 Blynk.config(blynk_token, "192.168.2.7", 8080);
  DS18B20.begin();
  timer.setInterval(1000L,getSendData);
  timer.setInterval(10000L,WiFiStatus);
  Serial.begin(115200);```


serial 
```mounting FS...
mounted file system
reading config file
opened config file
{"blynk_token":"pKdEF1MNazj_aGhpq0VExG1CMTi5qT0n"}
parsed json
pKdEF1MNazj_aGhpq0VExG1CMTi5qT0n
*wm:[2] Added Parameter: blynk
*wm:[1] AutoConnect 
*wm:[2] Connecting as wifi client... 
*wm:[2] setSTAConfig static ip not set, skipping 
*wm:[1] Connecting to SAVED AP: SMASUNG
*wm:[1] connectTimeout not set, ESP waitForConnectResult... 
*wm:[2] Connection result: WL_CONNECTED
*wm:[1] AutoConnect: SUCCESS 
*wm:[1] STA IP Address: 192.168.2.8
wifi connected

local ip : 192.168.2.8
Blynk Token : pKdEF1MNazj_aGhpq0VExG1CMTi5qT0n
[6017] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.0 on ESP8266

[6030] Connecting to blynk-cloud.com:80
Error: Could not read temperature data for sensor No.0
Error: Could not read temperature data for sensor No.1
Error: Could not read temperature data for sensor No.2
Error: Could not read temperature data for sensor No.3
[6554] Invalid auth token

OK I have already add this line with 8080 without result… this is set up prelogin window in my app

You’ve added a new Blynk.config command rather than replacing the existing one, and you’re still using library version 1.0.0 instead of 0.6.1

Pete.

i go to the libraries manager and download blynk v0.6.1 and i get this library has already download… but in serial you have right looks like v1.0 … what do you suggest to i do?

i remove new library and i add v0.6.1 … i go to uplaod code again

Delete the library using file manager then install 0.6.1

Pete.

ok i remove the new library… but :sleepy:

mounted file system
reading config file
opened config file
{"blynk_token":"pKdEF1MNazj_aGhpq0VExG1CMTi5qT0n"}
parsed json
pKdEF1MNazj_aGhpq0VExG1CMTi5qT0n
*wm:[2] Added Parameter: blynk
*wm:[1] AutoConnect 
*wm:[2] Connecting as wifi client... 
*wm:[2] setSTAConfig static ip not set, skipping 
*wm:[1] Connecting to SAVED AP: SMASUNG
*wm:[1] connectTimeout not set, ESP waitForConnectResult... 
*wm:[2] Connection result: WL_CONNECTED
*wm:[1] AutoConnect: SUCCESS 
*wm:[1] STA IP Address: 192.168.2.8
wifi connected

local ip : 192.168.2.8
Blynk Token : pKdEF1MNazj_aGhpq0VExG1CMTi5qT0n
[6092] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on ESP8266

[6106] Connecting to blynk-cloud.com:80
Error: Could not read temperature data for sensor No.0
Error: Could not read temperature data for sensor No.1
Error: Could not read temperature data for sensor No.2
Error: Could not read temperature data for sensor No.3
[6452] Invalid auth token

It really would help if you read what I wrote…

Pete.

Sorry Pete before you tell me to add this… sorry if I understand something wrong :confused:

Finally this is my code , what I could do in addition so that it works?

#include <FS.h>
#include <DNSServer.h>
#include <WiFiManager.h>
#include <ESP8266WebServer.h>
#include <BlynkSimpleEsp8266.h>
#include <ArduinoJson.h>
const char* host = "www.google.com"; 

/* TIMER */
#include <SimpleTimer.h>
SimpleTimer timer;

/* DS18B20 Temperature Sensor */
#include <OneWire.h>
#include<DallasTemperature.h> 
#define ONE_WIRE_BUS 2 // DS18B20 on arduino pin2 corresponds to D4 on physical board
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);

//BlynkTimer timer;

float temp_0;
float temp_1;
float temp_2;
float temp_3;
unsigned long lst_milis = 0;

const int relay_1 = 16;
const int relay_2 = 5;
const int relay_3 = 4;
const int relay_4 = 0;
const int relay_5 = 14;
const int relay_6 = 12;
const int relay_7 = 13;
const int relay_8 = 3;


#define SET_PIN 0

char blynk_token[40] = "";
bool shouldSaveConfig = false;

void saveConfigCallback () {
  Serial.println("Should save config");
  shouldSaveConfig = true;
}


BLYNK_CONNECTED()  //sygxronizei to esp otan bgei apo to reuma stis leitoyrgies poy eixe stamatisi
{
 Blynk.syncAll();
}


void setup()
{
 Blynk.config(blynk_token, "192.168.2.7", 8080);
  DS18B20.begin();
  timer.setInterval(1000L,getSendData);
  timer.setInterval(10000L,WiFiStatus);
  Serial.begin(115200);
  Serial.println();
  pinMode(SET_PIN, INPUT_PULLUP);
  delay(3000);

  //read configuration from FS json
  Serial.println("mounting FS...");
  if (SPIFFS.begin()) {
    Serial.println("mounted file system");
    if (SPIFFS.exists("/config.json")) {
      //file exists, reading and loading
      Serial.println("reading config file");
      File configFile = SPIFFS.open("/config.json", "r");
      if (configFile) {
        Serial.println("opened config file");
        DynamicJsonDocument jsonBuffer ( 1024 ) ;
        DeserializationError error = deserializeJson ( jsonBuffer, configFile ) ;
        if ( not error )
          {
            serializeJson(jsonBuffer, Serial);
            strcpy(blynk_token, jsonBuffer["blynk_token"]) ;
            Serial.println("\nparsed json");
            Serial.println( blynk_token );
          }
        else  
          Serial.println("failed to load json config");

        configFile.close();
    }
  } else {
    Serial.println("failed to mount FS");
  }

  WiFiManagerParameter custom_blynk_token("blynk", "blynk token", blynk_token, 32);
  WiFiManager wifiManager;
  wifiManager.setSaveConfigCallback(saveConfigCallback);
  wifiManager.addParameter(&custom_blynk_token);

  if (digitalRead(SET_PIN) == LOW) {
    wifiManager.resetSettings();
  }

  if (!wifiManager.autoConnect("Apo_Reptiles_Room")) {
    Serial.println("failed to connect and hit timeout");
    delay(3000);
    ESP.reset();
    delay(5000);
  }

  Serial.println("wifi connected");
  strcpy(blynk_token, custom_blynk_token.getValue());

  //save the custom parameters to FS
  if (shouldSaveConfig) {
    Serial.println("saving config");
    DynamicJsonDocument jsonBuffer ( 1024 ) ;
    jsonBuffer["blynk_token"] = blynk_token;

    File configFile = SPIFFS.open("/config.json", "w");
    if (!configFile) {
      Serial.println("failed to open config file for writing");
    }
    else
      serializeJson(jsonBuffer, configFile);
    configFile.close();
  }
  
  Serial.println();
  Serial.print("local ip : ");
  Serial.println(WiFi.localIP());
  Serial.print("Blynk Token : ");
  Serial.println(blynk_token);
  Blynk.config(blynk_token);
  }
}

void loop() {
  Blynk.run();
  timer.run(); // Initiates SimpleTimer
}


/***************************************************
 * Send Sensor data to Blynk
 **************************************************/
void getSendData(){
    unsigned long cur_millis = millis();
    if (cur_millis - lst_milis >= 2000)         //if 2 seconds since last mesurement 
        {
        lst_milis = cur_millis;
        DS18B20.requestTemperatures(); 
               
           temp_0 = DS18B20.getTempCByIndex(0); // Sensor 1 will capture Temp in Celcius
           temp_1 = DS18B20.getTempCByIndex(1); // Sensor 2 will capture Temp in Celcius
           temp_2 = DS18B20.getTempCByIndex(2); // Sensor 3 will capture Temp in Celcius  
           temp_3 = DS18B20.getTempCByIndex(2); // Sensor 3 will capture Temp in Celcius   

          if(temp_0 != -127){
            Serial.println(temp_0);
            Blynk.virtualWrite(21 , temp_0);    //virtual pin 1
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.0");
          }

          if(temp_1 != -127){
            Serial.println(temp_1);
            Blynk.virtualWrite(22 , temp_1);    //virtual pin 2
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.1");
            }

            if(temp_2 != -127){
            Serial.println(temp_2);
            Blynk.virtualWrite(23, temp_2);    //virtual pin 3
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.2");
           }
           if(temp_3 != -127){
            Serial.println(temp_3);
            Blynk.virtualWrite(24, temp_3);    //virtual pin 4
          }
          else{
            Serial.println("Error: Could not read temperature data for sensor No.3");
           }
        }
    }



void WiFiStatus()
{
  WiFiClient client;
  if (client.connect(host, 80))
  {
        Serial.println("connected");
        client.stop();
     
    }
    else {
     Serial.println("connection failed!"); 
  digitalWrite(relay_1, HIGH); // Και εδω δηλωνεις οτι θα ξεκιναει κλειστο
  digitalWrite(relay_2, HIGH);
  digitalWrite(relay_3, HIGH);
  digitalWrite(relay_4, HIGH); 
  digitalWrite(relay_5, HIGH);
  digitalWrite(relay_6, HIGH);
  digitalWrite(relay_7, HIGH);
  digitalWrite(relay_8, HIGH); 
     client.stop();
    
   }
} 


    BLYNK_WRITE(V16)
{
  int pinData = param.asInt();
  digitalWrite(16, pinData);
}

BLYNK_WRITE(V5)
{
  int pinData = param.asInt();
  digitalWrite(5, pinData);
}

BLYNK_WRITE(V4)
{
  int pinData = param.asInt();
  digitalWrite(4, pinData);
}

BLYNK_WRITE(V0)
{
  int pinData = param.asInt();
  digitalWrite(0, pinData);
}

BLYNK_WRITE(V14)
{
  int pinData = param.asInt();
  digitalWrite(14, pinData);
}

BLYNK_WRITE(V12)
{
  int pinData = param.asInt();
  digitalWrite(12, pinData);
}

BLYNK_WRITE(V13)
{
  int pinData = param.asInt();
  digitalWrite(13, pinData);
}

BLYNK_WRITE(V3)
{
  int pinData = param.asInt();
  digitalWrite(3, pinData);
}

No, I didn’t.
You already have a `Blynk.config’ line in your sketch, it’s the last command in your void setup.

I quoted that line, and said that.

So, do this….

  1. Remove the Blynk.config command that you added to the top of your void setup.

  2. Edit the existing Blynk.config line at the end of your void setup so that it includes the IP address of your local server, and port 8080.

Pete.

Thanks you Mr. Pete you are the best !! sorry for my misunderstanting and thank you again for your time