I can't connect my ESP32 to Blynk cloud

  • I have tried all the troubleshooting steps but nothing seems to be working
    • Hardware: ESP32
    • Blynk Library version: 1.3.2

serial monitor output:
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
Beginning Si1145!

my sketch

#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPL2qtpFgvkk"
#define BLYNK_TEMPLATE_NAME "Weather Station"

#include <WiFi.h> // importing all the required libraries
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include "Arduino.h"
#include "DHT.h"
#include "BMP085.h"
#include <Wire.h>

float temperature; 
float humidity;
float pressure;
float altitude;

BMP085 myBarometer; 

char auth[] = "##########";
char ssid[] = "###"; 
char pass[] = "###########"; 

#define DHTPIN 15 
#define DHTTYPE DHT22   

DHT dht(DHTPIN, DHTTYPE); // initialise dht sensor
BlynkTimer timer;

void sendSensor() // function to read sensor values and send them to Blynk
{
  humidity = dht.readHumidity();
  temperature = dht.readTemperature();
  if (isnan(humidity) || isnan(temperature)) 
  {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  pressure = myBarometer.bmp085GetPressure(myBarometer.bmp085ReadUP()); // read pressure value in pascals
  pressure = pressure / 100; // convert millibar to pascals
  altitude = myBarometer.calcAltitude();

  Blynk.virtualWrite(V1, temperature); // send all the values to their respective virtual pins
  Blynk.virtualWrite(V2, humidity);
  Blynk.virtualWrite(V3, pressure);
  Blynk.virtualWrite(V5, altitude);

}

void setup()
{
  Serial.begin(115200);
  Serial.println("Beginning Si1145!");
  myBarometer.init();
  dht.begin();
  delay(1000);
  Blynk.begin(auth, ssid, pass, "blynk.cloud");
  delay(1000);
  timer.setInterval(1000L, sendSensor); // sendSensor function will run every 1000 milliseconds
}

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

1 Like

Try commenting-out these two lines of code and see if your device connects to Blynk.

If it does then reinstate each of the lines in turn to see which one is the culprit.

Pete.

If his idea doesn’t work then you could ad programm from segments (blynk basics - dht sensor) then you shuld be able to detect problem.