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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user