Connecting to blynk.cloud:8

Before creating the topic

  1. Search forum for similar topics
  2. Check http://docs.blynk.cc and http://help.blynk.cc/
  3. Add details :
    • Hardware model + communication type. For example: Arduino UNO with Ethernet Shield
    • Smartphone OS (iOS or Android) + version
    • Blynk server or local server
    • Blynk Library version
    • Add your sketch code. :point_up:Code should be formatted as example below.

Simply paste your code between ``` If you don’t format your code, your topic can be deleted by moderators.

#define BLYNK_TEMPLATE_ID           "TMPLp7fzGVmp"
#define BLYNK_DEVICE_NAME           "ENERGY METER"
#define BLYNK_AUTH_TOKEN            "qcrXqjrjKG800vzCWIb_bHMm4_zPExbg"
#define BLYNK_PRINT Serial
 
#include "EmonLib.h"   //https://github.com/openenergymonitor/EmonLib
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
 
EnergyMonitor emon;

#define vCalibration 106.8
#define currCalibration 0.52
BlynkTimer timer;
 
char auth[] = BLYNK_AUTH_TOKEN;
 
char ssid[] = "Azhagar Surya";
char pass[] = "surya4623";
 
float kWh = 0;
unsigned long lastmillis = millis();
 
void myTimerEvent() {
    emon.calcVI(20, 2000);
    Serial.print("Vrms: ");
    Serial.print(emon.Vrms, 2);
    Serial.print("V");
    Blynk.virtualWrite(V0, emon.Vrms);
    Serial.print("\tIrms: ");
    Serial.print(emon.Irms, 4);
    Serial.print("A");
    Blynk.virtualWrite(V1, emon.Irms);
    Serial.print("\tPower: ");
    Serial.print(emon.apparentPower, 4);
    Serial.print("W");
    Blynk.virtualWrite(V2, emon.apparentPower);
    Serial.print("\tkWh: ");
    kWh = kWh + emon.apparentPower*(millis()-lastmillis)/3600000000.0;
    Serial.print(kWh, 4);
    Serial.println("kWh");
    lastmillis = millis();
    Blynk.virtualWrite(V3, kWh);
}
 
void setup() {
  Serial.begin(9600);
  emon.voltage(35, vCalibration, 1.7); // Voltage: input pin, calibration, phase_shift
  emon.current(34, currCalibration); // Current: input pin, calibration.
 // Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8080);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(5000L, myTimerEvent);
}
 
void loop() {
  Blynk.run();
  timer.run();
}

And what exactly is your question?

Pete.

Why my code is not connecting to blynk cloud?

It shows like this

Have you tried a simpler Blynk sketch?

Pete.

How to do that sir?
Are you asking this?

Yes, or one of the simpler examples.

Pete.

Port :8 in serial console looks wrong.

Can you explain what I should do now sir?

Try a simpler sketch.

It looks to me like the serial output is being stopped part way through the connection, so where is should say “Connecting to Blynk.cloud:80” the output is being truncated.
This may be caused by the libraries you have included, the pins you’ve chosen, something odd in your sketch etc. That’s why you should try a simple Blynk sketch first.

Pete.

ok sir

I have used simple blynk sketch and it shows like this an its not connecting

Have you tried rebooting your router?

Pete.