1

I'm trying to connect WiFi at home in my esp32 but in the serial monitor shows a looping connecting to WiFi but never connect. look this image

The link that I followed.

To my application. I want to connect a DHT11 sensor and to communicated with node-red. Unfortunately, My esp32 doesn't connect with WiFi.

    // Projeto Curto Circuito – ESP32: DHT11 Teste
#include <WiFi.h>
#include "DHT.h" // Inclui a biblioteca DHT
#define DHTPIN 14 // Define que OUT será conectado em D14 
#define DHTTYPE DHT11 // Define o modelo de sensor como DHT 22  // DHT irá interpretar os valores de leitura do pino de acordo com o tipo de sensor 
DHT dht(DHTPIN, DHTTYPE);
char* ssid = "Filipe";
const char* password =  "1234512345";
void setup()
{
  
 Serial.begin(9600); // Taxa de transmissão 9600 dBs
WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.println("Connecting to WiFi..");
  }
  Serial.println("Connected to the WiFi network");
 dht.begin(); // Taxa de transmissão do sensor
 
}
 void loop()
{
 delay(2000); // Intervalo de 2 segundos entre as leituras // Indica a Umidade (%)
 float h = dht.readHumidity(); 
 float t = dht.readTemperature();
 Serial.print("Umidade: ");
 Serial.print(h);
 Serial.println(" %\t");
 Serial.println("");
 Serial.print("Temperatura: ");
 Serial.print(t);
 Serial.println(" *C ");
  Serial.println("");
}

I hope somebody can help me. I'll be so glad with your contribution.

4
  • run the WiFiClient example code in the arduino IDE – jsotola Oct 20 '20 at 17:33
  • Hello @jsotola, I Tried but it was not possible to connect with WiFi. Look this image – Filipe Barbosa Veras Oct 20 '20 at 17:46
  • 2
    your picture shows a baud rate mismatch – jsotola Oct 20 '20 at 19:41
  • Hello everyone, I did a test in another laptop and it worked. I didn't know what happened with my laptop . Look this new image I needed to change the number Serial.begin to 9600. Now everything is working. Thanks for your help and have a nice week. – Filipe Barbosa Veras Oct 20 '20 at 21:41
0

Solution from the original poster :

Hello everyone, I did a test in another laptop and it worked. I didn't know what happened with my laptop . Look this new image I needed to change the number Serial.begin to 9600. Now everything is working. Thanks for your help and have a nice week.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.