Hi everyone,
I just got back to OMG after a couple of years of not playing around with home automation.
I got my old nodemcu, that was still all wired up, downloaded the current version and uploaded the sketch via the Arduino IDE. I started with a fresh install of the IDE and used all the libraries included in OMG.
Everything compiles and uploads fine. Wiring is correct. However, I get the βE: Failed to read from DHT sensor!β error in the serial monitor.
I tried using a different sketch and it reads the DHT just fine.
#include "DHT.h"
#define DHT_TYPE DHT22
const int DHT_PIN = 5;
DHT dht(DHT_PIN, DHT_TYPE);
void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() {
float h = dht.readHumidity();
float t = dht.readTemperature();
Serial.println(t);
Serial.println(h);
delay(5000);
}
Output as expected:
21:39:33.867 β 23.30
21:39:33.867 β 38.90
I did not change anything in the config_DHT.h. In the User_config.h I just uncommented the ZsensorDHT and the ZsensorADC and put in my Wifi Credentials. ADC woks fine (with a photoresistor) but DHT always fails to read.
Can anyone point me in the right direction? Since it works with the test sketch, I really donβt know where to look. I did update the DHT lib in the meantime to the current version, but that has not helped either.
Thanks!