-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It desn't work with ESP8266 #6
Comments
Uninitialized variable. In DHT.cpp, line 147. Change... |
Did that actually work? Didn't work for me....... |
dears, |
@peterodro try adding Serial.println(DHT22); and see if it prints a 2. The latest esp8266 SDK has trouble with uninitialized variables even though it's supposed to set them to zero. The DHT_MODEL_t enum in DHT.h is uninitialized. It should begin with AUTO_DETECT = 0 to get around the bug. If those 2 var inits don't work, make sure it's not something else like I/O pins or hardware. |
i'm sure about correct connection. |
@peterodro It should be dht.setup(pin, DHT::DHT22); For hardware, if you're powering it at 3.3V you may need a pullup resistor if the signal line is low idle. You can also change the pinMode() in readSensor() to use INPUT_PULLUP instead of INPUT, which is a little easier. |
@CuriousTech so auto detection not working in this lib, but problem solved without changing lib. |
@peterodro It looks like you're probably including 2 different DHT libraries and getting some conflicts. There's another one defining DHT22 as a different value. |
When compiled for ESP8266, this library functions return some strange readings like:
Temperature: 3080214.00 *C
Humidity: 404527.00 %
The text was updated successfully, but these errors were encountered: