adafruit / Adafruit_CircuitPython_DHT

CircuitPython support for DHT11 and DHT22 type temperature/humidity devices
MIT License
179 stars 62 forks source link

DHT22 not working on Raspberry Pi wh #65

Open QS3445 opened 3 years ago

QS3445 commented 3 years ago

Hope this is the right place to post this.. I'm a newby trying to setup a DHT 22 with rpwh, i am trying the dht_simpletest.py to see if my DHT 22 is reading ok, but getting this error...any thoughts on what going on.. Thanks

pi@raspberrypi:~ $ sudo python3 dht_simpletest.py Traceback (most recent call last): File "dht_simpletest.py", line 9, in dhtDevice = adafruit_dht.DHT22(board.D4) File "/usr/local/lib/python3.7/dist-packages/adafruit_dht.py", line 275, in init super().init(False, pin, 1000, use_pulseio) File "/usr/local/lib/python3.7/dist-packages/adafruit_dht.py", line 56, in init self.pulse_in = PulseIn(self._pin, 81, True) File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 73, in init message = self._wait_receive_msg(timeout=0.25) File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 92, in _wait_receive_msg "Timed out waiting for PulseIn message. Make sure libgpiod is installed." RuntimeError: Timed out waiting for PulseIn message. Make sure libgpiod is installed.

I checked python3, adafruit_dht.py, and Libgpiod are all installed !!

Would be thankful for any fix suggestions..

Thanks QS3445

jposada202020 commented 3 years ago

@QS3445 not sure but it seems that you are using PulseIn with the RP. you may need to setup your script to not to use it. This is mentioned in the note: https://github.com/adafruit/Adafruit_CircuitPython_DHT/blob/ceb883d09587612d2f96037f54c93805e4175db3/examples/dht_simpletest.py#L11 https://github.com/adafruit/Adafruit_CircuitPython_DHT/blob/ceb883d09587612d2f96037f54c93805e4175db3/examples/dht_simpletest.py#L12 I am assuming that you install Adafuit Blinka library to use the board pin definition, is that right? Is this board a ZERO W? is so I have been very unlucky using the zero with the DHT.

QS3445 commented 3 years ago

Ok ..thanks i'll try without using the PulseIn

Yes the Adafruit Blinka library is installed, i am using the Pi Zero WH

I let you know how it goes later... Thank you

QS3445

QS3445 commented 3 years ago

I got a response now...that DHT senor not found

pi@raspberrypi:~ $ sudo python3 dht_simpletest.py DHT sensor not found, check wiring DHT sensor not found, check wiring DHT sensor not found, check wiring DHT sensor not found, check wiring DHT sensor not found, check wiring ^Z [1]+ Stopped sudo python3 dht_simpletest.py pi@raspberrypi:~ $

wiring looks good to me, i have VCC to P2, GND to P6, and DAT to P7

So i don't know what can be wrong with the wiring... any ideas anyone ?

razerraz commented 3 years ago

I'm facing the exact same issue with an antique (but working perfectly) pi one rev B, and DHT22. Dht reading from old adafruit library works most of the time, even if it goes bad now and then. I've tried enabling or disabling pulseio, libgpiod is installed and sysv_ipc as well. If the plan is to lean on pulseio, it may be another bug to report directly on blinka repo since it goes very bad heating all cpu process when a PulseIn is enabled on any pin. Can provide more info on demand

SunSDSE commented 3 years ago

I have the exact same issue but with a Raspberry Pi 3.
All my code worked fine with the old Adafruit_DHT library which is now "DEPRECATED" I have 6 sensors wired and were working fine, before the attempted use with this new one.

Just for grins, I decided to test all my pins using the attached code. I can't find any with this new library.

Is the Raspberry Pi 3 supported?

JavanXD commented 2 years ago

For me the DHT22 is working on my Raspberry Pi Zero WH but only if I run the python3 script without sudo. I also need to use use_pulseio=True. I created a seperate issue (https://github.com/adafruit/Adafruit_CircuitPython_DHT/issues/73) because in your issue it is not clear if the cause is because you are running the python script with sudo.

ccvaillant1992 commented 2 years ago

I have the same error @QS3445 has, DHT sensor not found, check wiring. I am using a Raspberry Pi 4 Model B.

Does anyone know how to resolve this error?

vrudikov commented 5 months ago

I have the same error @QS3445 has, DHT sensor not found, check wiring. I am using a Raspberry Pi 4 Model B.

Does anyone know how to resolve this error?

Please show your code. I had the same. I think I have a solution for you