Blynk 2.0 problem connect

Hi
my project always worked with old version of blynk. Now I can no longer connect the new BLYNK.
I attach my code, I have done several tests, I have read some posts, but nothing. wrong in something
HELPPPPP!!!

 #define BLYNK_PRINT Serial

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
#define BLYNK_TEMPLATE_ID "TMPLAoKiD7RF"
#define BLYNK_DEVICE_NAME "Home"
#define BLYNK_AUTH_TOKEN "my token blynk 2.0"

#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <DHT.h> 
#include <DHT_U.h>
#include <Adafruit_Sensor.h>
#include <WidgetRTC.h>
#include <TimeLib.h>
#include <NTPClient.h>
#include <EthernetUdp.h>
#include <EmonLib.h>


//definizione variabili sensore temp e volt watt
#define W5100_CS  10
#define SDCARD_CS 4
#define DHT1PIN 2                //pin sensore giorno dht22
#define DHT2PIN 3                //pin sensore esterno dht22
#define DHT3PIN 5                // pin sensore notte dht22
#define DHT1TYPE DHT22
#define DHT2TYPE DHT22
#define DHT3TYPE DHT22
EnergyMonitor emon1;            //definizione variabili corrente e volt
#define VOLT_CAL 240.5
#define CURRENT_CAL 60.6

 
//definizione temperatura variabili
DHT dht1(DHT1PIN, DHT1TYPE);
DHT dht2(DHT2PIN, DHT2TYPE);
DHT dht3(DHT3PIN, DHT3TYPE);
float humidity1, temp_f1;
float humidity2, temp_f2;
float humidity3, temp_f3;

char auth[] = "my token blynk 2.0";

//sync time ntp
EthernetUDP Udp;
NTPClient timeClient(Udp, "europe.pool.ntp.org", 3600, 60000);
IPAddress server_ip (139, 59, 206, 133); //cloud blynk

// Mac address should be different for each device in your LAN
byte arduino_mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress arduino_ip ( 192, 168, 1, 99);
IPAddress dns_ip     (  8,   8,   8,   8);
IPAddress gateway_ip ( 192, 168, 1, 254);
IPAddress subnet_mask(255, 255, 255, 000);
EthernetServer server = EthernetServer(80);





BLYNK_CONNECTED() {
   rtc.begin();
}


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

  
  
  pinMode(SDCARD_CS, OUTPUT);
  digitalWrite(SDCARD_CS, HIGH);
  
  

       
  Blynk.begin(auth, "blynk-cloud.com", 80, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
  
 

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

 

} ```

sorry

i can’t post the whole code it tells me i’m a new user and i can’t

Please edit your post, and add triple backticks ``` before and after your whole sketch.

Despite @John93 giving you the backticks to copy paste you have used your own ticks. I have edited your post this time.

If you do not format your code properly next time, the moderator can remove your code from the post.

blynk-cloud.com is the url for the Legacy servers, which have now been decommissioned. The correct url for Blynk IoT is blynk.cloud

Pete.

tried, but it doesn’t work,
i have tried port 8080, not work . my app is always offline

What version of the Blynk library are you using?
What does your serial monitor show?

(Copy the text and post it with triple backticks in the same way as when you post code).

Pete.

0��8H��>PU~�Bj2H�Ms�8.��mw���s���mw���\)��R������<&��8.��8&��mw�8*�s��8&��s��w�8&�YS��s�c�yS�>s�qc��8&��H��<F��<&��\*��s��s�\(�
]z��H��h�

serial monitor output
what is it

Wrong baud rate.

Pete.

Have you tried

Blynk.begin(auth);

?

[0] Using static IP
[1560] IP:192.168.1.99
[1561] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.8 on Arduino Mega


[1570] Connecting to blynk-cloud.com:80

loop connecting to…
i tried port 80 e port 8080 not working

You should update the library to the latest version (1.1.0).

I’m guessing that you have Blynk for Chinese installed. If you do then you need to delete that library.

Pete.

because even deleting the 0.5.8 library it doesn’t accept me the 1.1 version
I still have 0.5.8, is there a way to manually delete the library

ok ok , function
thanks

it works in part,i can continue in this post or open another one.
I have problems with temperature and humidity, in old version it’s ok , in new value 0

Posting your whole sketch might help.

Well, in the code from post #1 you don’t have any routine for reading the temperature or humidity from your sensors and sending it to Blynk, and you don’t have any time sent up to call this nonexistent routine.

Presumably you chopped this code out of your sketch to simplify it and forgot to re-insert it?

Pete.

yes my code is not complete, if I can I attach it in full

#define BLYNK_PRINT Serial

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
#define BLYNK_TEMPLATE_ID "TMPLAoKiD7RF"
#define BLYNK_DEVICE_NAME "Home"
#define BLYNK_AUTH_TOKEN "**************************************"

#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <DHT.h> 
#include <DHT_U.h>
#include <Adafruit_Sensor.h>
#include <WidgetRTC.h>
#include <TimeLib.h>
#include <NTPClient.h>
#include <EthernetUdp.h>
#include <EmonLib.h>


//definizione variabili sensore temp e volt watt
#define W5100_CS  10
#define SDCARD_CS 4
#define DHT1PIN 2                //pin sensore giorno dht22
#define DHT2PIN 3                //pin sensore esterno dht22
#define DHT3PIN 5                // pin sensore notte dht22
#define DHT1TYPE DHT22
#define DHT2TYPE DHT22
#define DHT3TYPE DHT22
EnergyMonitor emon1;            //definizione variabili corrente e volt
#define VOLT_CAL 240.5
#define CURRENT_CAL 60.6

 
//definizione temperatura variabili
DHT dht1(DHT1PIN, DHT1TYPE);
DHT dht2(DHT2PIN, DHT2TYPE);
DHT dht3(DHT3PIN, DHT3TYPE);
float humidity1, temp_f1;
float humidity2, temp_f2;
float humidity3, temp_f3;

char auth[] = "****************************";

//sync time ntp
EthernetUDP Udp;
NTPClient timeClient(Udp, "europe.pool.ntp.org", 3600, 60000);
IPAddress server_ip (139, 59, 206, 133); //cloud blynk

// Mac address should be different for each device in your LAN
byte arduino_mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress arduino_ip ( 192, 168, 1, 99);
IPAddress dns_ip     (  8,   8,   8,   8);
IPAddress gateway_ip ( 192, 168, 1, 254);
IPAddress subnet_mask(255, 255, 255, 000);
EthernetServer server = EthernetServer(80);

BlynkTimer timer;
WidgetRTC rtc;
WidgetLCD lcd(V52); //lcd supporto blynk app

// Digital clock display 
void clockDisplay()
{
 
  String currentTime = String(hour()) + ":" + minute() + ":" + second();
  String currentDate = String(day()) + " " + month() + " " + year();
  Serial.print("Current time: ");
  Serial.print(currentTime);
  Serial.print(" ");
  Serial.print(currentDate);
  Serial.println();

  // Send time to the App
  Blynk.virtualWrite(V50, currentTime  );
  // Send date to the App
  Blynk.virtualWrite(V51,  currentDate );
}

//definizione pulsanti virtuali per ifttt

BLYNK_WRITE(V10) //soggiorno Tetto
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(22, LOW); // Set GPIO 22 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(22, HIGH);  // Set  Pin 22 HIGH
          Blynk.virtualWrite(V10, LOW);// Set  Virtual Pin 10 LOW
           });  // END Timer Function

}
}

BLYNK_WRITE(V11) //soggiorno applique
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(34, LOW); // Set GPIO 34 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(34, HIGH);  // Set  Pin 34 HIGH
          Blynk.virtualWrite(V11, LOW);// Set  Virtual Pin 11 LOW
           });  // END Timer Function

}
}           

BLYNK_WRITE(V12) //cucina soffusa
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(24, LOW); // Set GPIO 24 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(24, HIGH);  // Set  Pin 24 HIGH
          Blynk.virtualWrite(V12, LOW);// Set  Virtual Pin 12 LOW
           });  // END Timer Function

}
}

BLYNK_WRITE(V13)  //Cucina tetto
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(25, LOW); // Set GPIO 25 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(25, HIGH);  // Set  Pin 25 HIGH
          Blynk.virtualWrite(V13, LOW);// Set  Virtual Pin 13 LOW
           });  // END Timer Function

}
}

BLYNK_WRITE(V14) //Bagno piccolo
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(26, LOW); // Set GPIO 26 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(26, HIGH);  // Set  Pin 26 HIGH
          Blynk.virtualWrite(V14, LOW);// Set  Virtual Pin 14 LOW
           });  // END Timer Function

}
}

BLYNK_WRITE(V15) //Corridoio
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(27, LOW); // Set GPIO 27 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(27, HIGH);  // Set  Pin 27 HIGH
          Blynk.virtualWrite(V15, LOW);// Set  Virtual Pin 15 LOW
           });  // END Timer Function

}
}

BLYNK_WRITE(V16) // Stanza 2
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(28, LOW); // Set GPIO 28 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(28, HIGH);  // Set  Pin 28 HIGH
          Blynk.virtualWrite(V16, LOW);// Set  Virtual Pin 16 LOW
           });  // END Timer Function

}
}

BLYNK_WRITE(V17) //Bagno Grande
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(29, LOW); // Set GPIO 29 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(29, HIGH);  // Set  Pin 29 HIGH
          Blynk.virtualWrite(V17, LOW);// Set  Virtual Pin 17 LOW
           });  // END Timer Function

}
}

BLYNK_WRITE(V18) //Stanza 1
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(30, LOW); // Set GPIO 30 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(30, HIGH);  // Set  Pin 30 HIGH
          Blynk.virtualWrite(V18, LOW);// Set  Virtual Pin 18 LOW
           });  // END Timer Function

}
}

BLYNK_WRITE(V19) // Letto Soffusa
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(31, LOW); // Set GPIO 31 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(31, HIGH);  // Set  Pin 31 HIGH
          Blynk.virtualWrite(V19, LOW);// Set  Virtual Pin 19 LOW
           });  // END Timer Function

}
}


BLYNK_WRITE(V20) //Letto Tetto
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(32, LOW); // Set GPIO 32 LOW
     timer.setTimeout(100L, []() {  // Run after 0.5 seconds second
          digitalWrite(32, HIGH);  // Set  Pin 32 HIGH
          Blynk.virtualWrite(V20, LOW);// Set  Virtual Pin 20 LOW
           });  // END Timer Function

}
}


BLYNK_WRITE(V21)  //music room
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(33, LOW); // Set GPIO 33 LOW
     timer.setTimeout(3400L, []() {  // Run after 2.4 seconds second
          digitalWrite(33, HIGH);  // Set  Pin 33 HIGH
          Blynk.virtualWrite(V21, LOW);// Set  Virtual Pin 21 LOW
           });  // END Timer Function

}
}


BLYNK_WRITE(V22)  //interruttore camino 
{   
  int value = param.asInt(); // Get value as integer
  
  if (value == 1)
  {
     digitalWrite(35, LOW); // Set GPIO 34 LOW
  } else {
    digitalWrite(35,HIGH);
      Blynk.virtualWrite(V22, LOW);// Set  Virtual Pin 22 LOW
           }  
}

BLYNK_WRITE(V90) { //switch mode
  Blynk.virtualWrite(V90,LOW);
  Serial.println("invio1");
          Blynk.email("**************", "*** HELP!!!!! ***", "Ho di bisogno , chiama !!!!");
        timer.setTimeout(6000L,[](){
          Serial.println("invio2");
        Blynk.email("***************", "*** HELP!!!!! ***", "Ho di bisogno , chiama !!!!");  
        });
     
 }



BLYNK_CONNECTED() {
   rtc.begin();
}


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

  dht1.begin();
  dht2.begin();
  dht3.begin();

  emon1.voltage(0, VOLT_CAL, 1.7);  // Voltage: input pin, calibration, phase_shift
  emon1.current(1, CURRENT_CAL);       // Current: input pin, calibration.
  
  
  
  pinMode(SDCARD_CS, OUTPUT);
  digitalWrite(SDCARD_CS, HIGH);
  
  pinMode(22,OUTPUT); //Luce soggiorno LED
  digitalWrite(22, HIGH); 
  
  pinMode(23,OUTPUT); //Luce soggiorno LED
  digitalWrite(23,HIGH);
 
  
  pinMode(24,OUTPUT); //Luce cucina soffusa
  digitalWrite(24,HIGH);
  
  pinMode(25,OUTPUT); //Luce cucina 
  digitalWrite(25,HIGH);
  
  pinMode(26,OUTPUT); //Luce bagno zona giorno 
  digitalWrite(26,HIGH);
  
  pinMode(27,OUTPUT); //Luce Corridoio
  digitalWrite(27,HIGH);
  
  pinMode(28,OUTPUT); //Luce Stanza 2
  digitalWrite(28,HIGH);
  
  pinMode(29,OUTPUT); //Luce Bagno Zona Notte
  digitalWrite(29,HIGH);
 
  pinMode(30,OUTPUT); //Luce Stanza 1
  digitalWrite(30,HIGH);
  
  pinMode(31,OUTPUT); //Luce camera letto soffusa
  digitalWrite(31,HIGH);
  
  pinMode(32,OUTPUT); //Luce camera letto normale
  digitalWrite(32,HIGH);
  
  pinMode(33,OUTPUT); //Music Room
  digitalWrite(33,HIGH);
  
  pinMode(34,OUTPUT); //Luce Soggiorno Tetto
  digitalWrite(34,HIGH);
  
  pinMode(35,OUTPUT); //luce camino
  digitalWrite(35,HIGH);
  
  pinMode(36,OUTPUT);
  digitalWrite(36,HIGH);
  
  pinMode(37,OUTPUT);
  digitalWrite(37,HIGH);

  pinMode(40,INPUT);
  digitalWrite(40,LOW);

       
  Blynk.begin(auth, "blynk-cloud.com", 80, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
  
  timer.setInterval(1000L, clockDisplay);
  setSyncInterval(10*60);

//WidgetLCD su supporto blynk

  lcd.clear(); //Use it to clear the LCD Widget
  lcd.print(0, 0, "********");
  lcd.print(3, 1, "********");
}


//temp 
  BLYNK_READ(1) 
{ 
temp_f1 = dht1.readTemperature(false);// Read temperature as Celsius
int value=temp_f1*10;
String str;
char result[5];
result[0]=(value/100)+'0';
result[1]=((value/10)%10)+'0';
result[2]='.';
result[3]=(value%10)+'0';
result[4]='\0';
str +=result;
str +="℃";
//char buf[str.length()+1];
char buf[8];
str.toCharArray(buf,sizeof(buf));
Blynk.virtualWrite(1,buf); 
}

//hum
    BLYNK_READ(2) 
 {
humidity1 = dht1.readHumidity();           // Read humidity (percent)
int value=humidity1*10;
String str;
char result[5];
result[0]=(value/100)+'0'; 
result[1]=((value/10)%10)+'0';
result[2]='.';
result[3]=(value%10)+'0';
result[4]='\0';
str +=result;
str +="%";
//char buf[str.length()+1];
char buf[8];
str.toCharArray(buf,sizeof(buf));
Blynk.virtualWrite(2,buf); 
}
 
 BLYNK_READ(3) 
{ 
temp_f2 = dht2.readTemperature(false);// Read temperature as Celsius
int value=temp_f2*10;
String str;
char result[5];
result[0]=(value/100)+'0';
result[1]=((value/10)%10)+'0';
result[2]='.';
result[3]=(value%10)+'0';
result[4]='\0';
str +=result;
str +="℃";
//char buf[str.length()+1];
char buf[8];
str.toCharArray(buf,sizeof(buf));
Blynk.virtualWrite(3,buf); 
}
 
    BLYNK_READ(4) 
 {
humidity2 = dht2.readHumidity();           // Read humidity (percent)
int value=humidity2*10;
String str;
char result[5];
result[0]=(value/100)+'0'; 
result[1]=((value/10)%10)+'0';
result[2]='.';
result[3]=(value%10)+'0';
result[4]='\0';
str +=result;
str +="%";
//char buf[str.length()+1];
char buf[8];
str.toCharArray(buf,sizeof(buf));
Blynk.virtualWrite(4,buf); 
}
 
 BLYNK_READ(5) 
{ 
temp_f3 = dht3.readTemperature(false);// Read temperature as Celsius
int value=temp_f3*10;
String str;
char result[5];
result[0]=(value/100)+'0';
result[1]=((value/10)%10)+'0';
result[2]='.';
result[3]=(value%10)+'0';
result[4]='\0';
str +=result;
str +="℃";
//char buf[str.length()+1];
char buf[8];
str.toCharArray(buf,sizeof(buf));
Blynk.virtualWrite(5,buf); 
}
 
    BLYNK_READ(6) 
 {
humidity3 = dht3.readHumidity();           // Read humidity (percent)
int value=humidity3*10;
String str;
char result[5];
result[0]=(value/100)+'0'; 
result[1]=((value/10)%10)+'0';
result[2]='.';
result[3]=(value%10)+'0';
result[4]='\0';
str +=result;
str +="%";
//char buf[str.length()+1];
char buf[8];
str.toCharArray(buf,sizeof(buf));
Blynk.virtualWrite(6,buf); 
}

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

  //parte Volt, Watt
  emon1.calcVI(20,2000);         // Calculate all. No.of half wavelengths (crossings), time-out
  emon1.serialprint();
  
  float realPower              = emon1.realPower;             //extract Irms into Variable
  float apparentPower          = emon1.apparentPower;             //extract Vrms into Variable
  float powerFactor            = emon1.powerFactor;
  float Vrms                   = emon1.Vrms;
  float Irms                   = emon1.Irms;

  
  Serial.print("Vrms: ");
  Serial.println(Vrms);
    
  Serial.print("Irms: ");
  Serial.println(Irms);

  Serial.print("Potenza Istantanea: ");
  Serial.println(powerFactor);

  Serial.print("Potenza Reale: ");
  Serial.println(realPower);

  Serial.print("Potenza Apparente ");
  Serial.println(apparentPower);

  

  Blynk.virtualWrite(V100, Vrms);
  Blynk.virtualWrite(V101, Irms);
  Blynk.virtualWrite(V102, powerFactor);
  Blynk.virtualWrite(V103, realPower);
  Blynk.virtualWrite(V104, apparentPower);


}

in old version temp and hum it’s ok now in blynk web dashboard sign the incorrect value in the app the value is 0