nodemcu-firmware/app/dht
Arnim Läuger ebd147b34f DHT11 read sometimes failed with checksum error (#2679)
* DHT11 read sometimes failed with checksum error.

The code assumed DHT11 devices only ever return zero in the temperature and humidity decimal fraction bytes. The datasheet doesn't guarantee this is the case, and by observation I have noticed that indeed the DHT11 may sometimes return another number, usually close to zero. This means that the code would fail with a checksum error, as the fraction bytes were not included when the checksum was calculated. These bytes are now taken into account and also returned as part of the measurement.

This also means that the related dht.read() function is non-functional. If you have a DHT11 device that returns a non-zero decimal part, dht.read() will interpret it as a DHT22 result and return the wrong measurement. For this reason dht.read() should be retired. This patch does not address this issue.
2019-02-23 22:03:21 +01:00
..
Makefile trailing spaces cleanup (#2659) 2019-02-17 18:26:29 +00:00
dht.c DHT11 read sometimes failed with checksum error (#2679) 2019-02-23 22:03:21 +01:00
dht.h trailing spaces cleanup (#2659) 2019-02-17 18:26:29 +00:00