Hi there, need a help with my esp32 dht11 connection...The error showing as below

More information required.

Pete.

1 Like

i’m using esp32 with dht11 sensor and having error with wifi connection.

Code?
Connections used?

Pete.

[Unformatted code removed by moderator]

WiFi WPA2

Please edit your post to add triple backticks before and after your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

#define BLYNK_PRINT Serial

int pin = 21;

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = “aEbPaAkgsFwWICcd0dQ-ZSOEpAC8BLG6”;

// Your WiFi credentials.
// Set password to “” for open networks.
char ssid[] = “eduroam-2G”;
char pass[] = “*********”;

void setup() {
pinMode(pin, OUTPUT);
pinMode(pin, HIGH);
Serial.begin(115200);

delay(10);
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, pass);
int wifi_ctr = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println(“WiFi connected”);

Blynk.begin(“Your auth token key”, ssid, pass);

}

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

There’s an EDIT button at the bottom of the post, and I was hoping that you would have do as I requested and actually dated it.
I’ve deleted the code from your previous post.

Pete.

Done editing it

You’ve included your actual Auth token earlier, and stored it as a variable named auth
Is this what you’re using in this connection string, or something else?

Pete.

1 Like

I don’t see any code related to DHT11
what pins are you using to connect DHT11 data ??

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <DHT.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "8ydYe91_SqXfyPmWjiGALbQTCIXT1CKy";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "eduroam-2G";
char pass[] = "******";

#define DHTPIN 0          // D15
 
// Uncomment whatever type you're using!
#define DHTTYPE DHT11     // DHT 11
//#define DHTTYPE DHT22   // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21   // DHT 21, AM2301
 
DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;
 
// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendSensor()
{
  float h = dht.readHumidity();
  float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
 
  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V5, t);
  Blynk.virtualWrite(V6, h);
}

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

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(172,18,91,37), 8080);
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

So what’s happening here?
You’ve posted two totally different pieces of code, with no explanation as to which one related to your serial monitor output.

Some words would help with people’s understanding of what it is that you’re doing.

Pete.

1 Like

don’t use GPIO 0 from ESP32
use from GPIO13 to 33

sorry the earliest one is for the LED…

The latest one is for the dht 11 and still the same error is happening.
The connection is taking more than 5 mins…

2019-07-28_183232

So which pin I should include ?
example of the code ?

The main issue here is the internet connection


I am using GPIO 13

  //*********************** Initialize DHTP11 SENSOR ****************************//
  //dht.begin();
  dht.setup(dhtPin, DHTesp::DHT11); // Connect DHT sensor to GPIO 13

Your issue is not internet connection, but ESP32 reset due to GPIO 0