Python3 on Beaglebone Green can't find DHT22

75 Views Asked by At

Please, I a need push in the right direction!

I am aware that this issue is based on older components, still, I won't give up (yet). I can't get python to read the DHT22. Here is what happened:

Setup:

  • BBG, running a Debain 11 (bullseye)
  • DHT22 (AM2302) (one with a Grove connector, and one regular one with just wires)
  • Python 3.9.2, with adafruit-circuitpython-dht, libgpiod2, etc. all in place

I followed the most actual tutorials I could find and were able to install all requirements as described at learn.adafruit.com.

Still, it comes down the situation posted here.

>>> dht22=adafruit_dht.DHT22(board.P9_22, False)
>>> dht22.temperature


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/dist-packages/adafruit_dht.py", line 273, in temperature
    self.measure()
  File "/usr/local/lib/python3.9/dist-packages/adafruit_dht.py", line 225, in measure
    raise RuntimeError("DHT sensor not found, check wiring")
RuntimeError: DHT sensor not found, check wiring
  • So, I checked the Sensors using a Seeeduino v1.4 and some Arduino code and can confirm they both work fine.
  • I checked the wiring by consulting the BBG specs to make sure, P9_22 is the right pin.
  • I tried different USB power supplies.
  • I checked that around 3.3V is reaching the sensor.

Still, python raises the same error. What could I do??

Thank you!

0

There are 0 best solutions below