Closed tomiisp closed 6 years ago
It may fix the problem, but I think it's not the right answer. I think we must find out why delay(10us) caused the error, right?
I tried to apply this and it didn't help, the number of errors increased. The adafruit library is working fine for me. https://github.com/adafruit/DHT-sensor-library
I think the confirm function, which split us to pieces of 10us, causes deviation.
Again, no root cause, but increasing the delayMicroseconds to 20 did solve my problem as well.
Please test 1.0.9
DHT22 with ESP8266 producing in my case a lot of repeating read errors (sample rate 5sec), error rate was about 9:1 (error:success). Little looking in code and here seems was that issue:
changing delayMicroseconds(10); to delayMicroseconds(20); fix this problem, 0 errors after 2hours of testing