chaeplin / PietteTech_DHT-8266

DHT Sensor Library for esp8266
Other
39 stars 9 forks source link

Cannot operate after wire disconnection #29

Closed eos1d3 closed 8 years ago

eos1d3 commented 8 years ago

While testing with previous issue, I accidentally disconnected one of the DHT22 wire. And the DHT_example just hanged.

2: Retrieving information from sensor: Read sensor: OK
Humidity (%): 67.80
Temperature (oC): 32.20
Temperature (oF): 89.96
Temperature (K): 305.35
Dew Point (oC): 25.48
Dew Point Slow (oC): 25.51

3: Retrieving information from sensor: 

I have to reset the cpu for this condition. Further tests show disconnecting and reconnecting any of the 3 wires will hang. And only a few of chances it can continue.

chaeplin commented 8 years ago

This lib doesn't check whether dth is connected or not. I will test more and add a code to check whether duh is disconnected.

chaeplin commented 8 years ago

example added

https://github.com/chaeplin/PietteTech_DHT-8266/commit/8e96548dc9687af9777e3cbc55ed3db845047445

eos1d3 commented 8 years ago

New update to example DHT_esp8266 fixes the reconnection problem. DHT_example needs the same update too.

chaeplin commented 8 years ago

DHT_example has no blocking call in setup, so I think don't need delay or yield.