0

我正在使用带有 Raspberry Pi Zero W V1.1 的 DHT22 温度和湿度传感器来记录温度和湿度。我使用 Python 和 Adafruit 库(https://github.com/adafruit/Adafruit_CircuitPython_DHT),即使我能够读取数据,我也会遇到很多读取错误。举个例子,这是在几分钟的日志记录中报告的错误日志(每 2 秒读取一次):

2021/09/14 00:00:32 A full buffer was not returned. Try again.
2021/09/14 00:00:48 A full buffer was not returned. Try again.
2021/09/14 00:01:09 A full buffer was not returned. Try again.
2021/09/14 00:01:16 A full buffer was not returned. Try again.
2021/09/14 00:01:41 A full buffer was not returned. Try again.
2021/09/14 00:01:41 A full buffer was not returned. Try again.
2021/09/14 00:01:41 A full buffer was not returned. Try again.
2021/09/14 00:01:55 A full buffer was not returned. Try again.
2021/09/14 00:02:04 A full buffer was not returned. Try again.
2021/09/14 00:02:25 A full buffer was not returned. Try again.
2021/09/14 00:02:34 A full buffer was not returned. Try again.
2021/09/14 00:02:41 A full buffer was not returned. Try again.
2021/09/14 00:02:48 A full buffer was not returned. Try again.
2021/09/14 00:03:09 A full buffer was not returned. Try again.
2021/09/14 00:03:16 A full buffer was not returned. Try again.
2021/09/14 00:03:16 A full buffer was not returned. Try again.
2021/09/14 00:03:32 A full buffer was not returned. Try again.
2021/09/14 00:03:39 A full buffer was not returned. Try again.
2021/09/14 00:04:02 A full buffer was not returned. Try again.
2021/09/14 00:04:16 A full buffer was not returned. Try again.
2021/09/14 00:04:23 A full buffer was not returned. Try again.
2021/09/14 00:04:39 A full buffer was not returned. Try again.
2021/09/14 00:04:39 A full buffer was not returned. Try again.

我搜索了这个问题,发现了很多类似的案例。似乎问题在于 Adafruit 库(https://github.com/adafruit/Adafruit_CircuitPython_DHT)。根据几个人的说法,以前的库(https://github.com/adafruit/Adafruit_Python_DHT)似乎效果更好(但不是 100%),但无论如何现在它已被弃用。

任何人都知道一个图书馆可以无故障地阅读 DHT22 吗?

谢谢 !

4

0 回答 0