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
+1 -1
View File
@@ -103,7 +103,7 @@ def validate_pin(pin):
if dhtpin <= 0:
logging.warning('Invalid GPIO pin number: %s', pin)
sys.exit(3)
logging.info('using pin #%d', dhtpin)
logging.info('using BCM GPIO pin #%d', dhtpin)
return dhtpin