Read the DHT sensor with lgpio instead of Adafruit bitbang.

Userspace pulse timing misses DHT22 edges on Raspberry Pi OS, which produced empty readings. Log the real failure reason and clarify that PIN is BCM GPIO numbering.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-17 22:58:30 +08:00
co-authored by Cursor
parent f061673880
commit 7da6ced1c4
5 changed files with 313 additions and 38 deletions
+3 -1
View File
@@ -3,7 +3,9 @@
# The hardware type - valid values are: 11 (DHT11 sensor), 22 (DHT22 sensor), and 2302 (AM2302 sensor)
DHT=22
# The pin number used on the Raspberry Pi board
# BCM GPIO number for the DHT data wire (not the physical header pin number).
# GPIO 4 is physical pin 7, the same pin as the original C code (wiringPi pin 7).
# GPIO 4 is also the Pi's default 1-Wire pin; disable 1-Wire or use another GPIO if it conflicts.
PIN=4
[software]