El pequeño sketch que pongo más abajo, ha estado funcionando en arduino más de 2 años.
Más tarde lo pase a Esp8266 funcionando 1 año más perfectamente.
Ahora al pasarlo a Esp32, nada más cargar el sketch funciona bien, pero si lo desconecto de la alimentación y lo vuelvo a conectar las lecturas marcan siempre “1”.
Ahora bien si apretó el botón RST del micro vuelve a funcionar.
A ver si alguien tiene una idea de que puede ser.
#include "DHTesp.h"
DHTesp dht1; DHTesp dht2; DHTesp dht3;
float t1 = 0; float h1 = 0;
float t2 = 0; float h2 = 0;
float t3 = 0; float h3 = 0;
void setup(){
Serial.begin(9600);
dht1.setup(14); dht2.setup(27); dht3.setup(26); }
void loop() {
// delay(dht1.getMinimumSamplingPeriod());
delay(3000);
t1 = dht1.getTemperature(); h1 = dht1.getHumidity();
t2 = dht2.getTemperature(); h2 = dht2.getHumidity();
t3 = dht3.getTemperature(); h3 = dht3.getHumidity();
Serial.print("Sensor 1 "); Serial.print(t1, 1); Serial.print("\t"); Serial.print(h1, 0); Serial.print("\t");
Serial.print("Sensor 2 "); Serial.print(t2, 1); Serial.print("\t"); Serial.print(h2, 0); Serial.print("\t");
Serial.print("Sensor 3 "); Serial.print(t3, 1); Serial.print("\t"); Serial.println(h3, 0);
}