Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 6 months ago.
DHT CRC calculation error
Wim,
I have seen that the DHT code sometimes gets CRC errors. After looking at the code for some time, I discovered that the last bit in the 40 bit input stream does not get read. This bit is the LSb of the CRC byte and thus, this bit is always 0. This would explain why some readings are good (Hum + Temp = even number) and others bad (odd number).
I do not know if the error is in the very first bit read from the 40 bit stream or the last bit.
Regards,
...kevin
Question relating to:
5 Answers
10 years, 3 months ago.
I saw the same problem and think it's fixed in this repo. https://mbed.org/teams/components/code/DHT/ Would you mind testing and reporting back?
10 years, 8 months ago.
hi to all i use this lib for DHT11, but sumetimes i have this Err 6, do you have idea where is the problem? do you fix it?
best regards Antonio
11 years, 4 months ago.
Hi Wim,
I have tried to use your lib for DHT11 but it still generates Err 7 and sometimes Err 6. The meaningful data only comes out at the first measurement. Do you have any update in your lib til now? What is the bug in your code?
Thanks, AnhNT,
8 years, 7 months ago.
There are 2-errors for DHT22. First, line 81 (_DHTtype == 11) ? wait_ms(18) : wait(1); should be (_DHTtype == 11) ? wait_ms(18) : wait_ms(1);. Second is the value returned form CalcTemperature(), CalcHumidity() have no the fractional part.
Hi,
I am using a FRDM-K64F and the code from the repository does no work (I keep getting Err 6); The modification suggested by Antonio Buonanno (using 40 instead of 41 in the size of the bits) makes it a little bit more stable, but the issue is still around. Does anyone have an answers for that?
posted by Clovis Fritzen 26 Jun 2014I saw the same problem and think it's fixed in this repo. Would you mind testing and reporting back? https://mbed.org/teams/components/code/DHT/
posted by Sam Grove 16 Aug 2014