d2r2 / go-dht

Golang library to interact with DHT11/DHT22/DHT12 temperature and humidity sensors from Raspberry PI.
MIT License
133 stars 52 forks source link

The driver would suddenly fatally exit after ten or more hours. #10

Closed peiqinzhao closed 6 years ago

peiqinzhao commented 6 years ago

Hi. I tried to use the driver to detect the temperature in the indoor environment for days. However, it would always suddenly throw a fatal message after collecting the temperature data for ten or more hours. Is there anyway for ignoring this kind of outlier?

d2r2 commented 6 years ago

@hbgxsm95, did you finally found the root cause of this issue?

peiqinzhao commented 6 years ago

Nope. I set the retry times as 10. Maybe because this number is too small. I set it as 50 and after half days, everything still goes normal.

d2r2 commented 6 years ago

Right, reading this sequential bits with milliseconds in between in Linux user space is not precise in regards of time periods, so relatively small retry count could exhaust. Please, let me know in some later time about stability of sensor reading :)

peiqinzhao commented 6 years ago

Sure I would love to.

d2r2 commented 5 years ago

Hi @hbgxsm95. It seems I found and fixed root cause of issue, that lead to fatal exit after long application run. Issue described in #13 and fixed in #14 (fix already merged to master). Sorry for missing this from the beginning, I hope it will be useful for you. Thanks!