QUERY · ISSUE
Problem with dht library
Hello
Problem with dht library not working properly in subzero temperatures with dht22 module.
reports (-3264.4°C)
it is written here about a domestic problem https://forums.raspberrypi.com/viewtopic.php?t=296097
CANDIDATE · ISSUE
Micropython ESP32 - DHT22 measure fails when there are too many threads
Hi. I have a ESP32 devkit v1 board with micropython installed and I have problems with dht measuring when I am doing more than one thread.
The main purpose with DHT22 which I want implement is this:
- Publish temperature and humidity to MQTT each 30 seconds..
- Publish temperature and humidity to MQTT when a specific MQTT event is received.
I had this working using a thread for each objective but when I add one thread more DHT measure stop working, it throws ETIMEDOUT exception.
What is the problem and how I can fix it?
Thanks!
Indeed! I'm not well-versed enough to suggest a proper solution at this time but I've just been adding the offset value corresponding to -0.1C and then multiplying by -1
I tested the
dhtdriver with a DHT22 and it works OK for me at temperatures less than 0 Celsius.The
dhtdriver here assumes that the top bit of the returned temperature value is a sign bit. But if you are getting values like -3264.4 then it could be that your DHT22 returns a 2's complement signed value.After you do a reading can you print out the buffer, like this:
That will help narrow down the problem.
If it is 2's complement then you have a non-standard DHT22 module and you'll need to use conversion like this: