You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a clean Raspberry Pi OS install (version: 2021-03-04-raspbian-buster) on a Raspberry Zero WH. You can download the image or you can check the used install instructions here.
I installed the following two packages: sudo pip3 install adafruit-circuitpython-dht && sudo apt-get install libgpiod2
PoC:
importloggingimportadafruit_dhtimporttimeimportboardimportdigitaliologger=logging.getLogger('HoneyPi.read_dht')
if__name__=='__main__':
try:
SENSOR_PIN=digitalio.Pin(4) # change GPIO pindht=adafruit_dht.DHT22(SENSOR_PIN, use_pulseio=True)
timer=0whiletimer<=10:
try:
temperature=dht.temperaturetemperature_f=temperature* (9/5) +32humidity=dht.humidityprint("Temp: {:.1f} F / {:.1f} °C Humidity: {}% ".format(temperature_f, temperature, humidity))
break# break while if it workedexceptRuntimeErroraserror:
# Errors happen fairly often, DHT's are hard to read, just keep goingprint(error.args[0])
time.sleep(2.0)
timer=timer+2iftimer>10: # end reachedprint("Loop finished. Error.")
except (KeyboardInterrupt, SystemExit):
passexceptRuntimeErroraserror:
logger.error("RuntimeError in DHT measurement: "+error.args[0])
exceptExceptionase:
logger.exception("Unhandled Exception in DHT measurement")
pi@HoneyPi:~/HoneyPi/rpi-scripts $ sudo -u root python3 read_dht.py
RuntimeError in DHT measurement: Timed out waiting for PulseIn message. Make sure libgpiod is installed.
pi@HoneyPi:~/HoneyPi/rpi-scripts $ sudo -u pi python3 read_dht.py
Temp: 78.3 F / 25.7 °C Humidity: 66.2%
Notes:
yes, root user is part of gpio group (sudo usermod -aG gpio root)
I noticed that I am not the only one affected by this issue:
I have been using the Adafruit_DHT library for a long time but because you stopped fixing issues such as this I've migrated to your new library. Unfortunately it turns out that you do not fix issues for Raspi Zero. What I am supposed to use now? Please fix this issue.
The text was updated successfully, but these errors were encountered:
I am using a clean Raspberry Pi OS install (version: 2021-03-04-raspbian-buster) on a Raspberry Zero WH. You can download the image or you can check the used install instructions here.
I installed the following two packages:
sudo pip3 install adafruit-circuitpython-dht && sudo apt-get install libgpiod2
PoC:
(full script)
Console:
Notes:
yes, root user is part of gpio group (
sudo usermod -aG gpio root
)I noticed that I am not the only one affected by this issue:
I have been using the Adafruit_DHT library for a long time but because you stopped fixing issues such as this I've migrated to your new library. Unfortunately it turns out that you do not fix issues for Raspi Zero. What I am supposed to use now? Please fix this issue.
The text was updated successfully, but these errors were encountered: