Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DHT22 not working on Raspberry Pi wh #65

Open
QS3445 opened this issue Mar 5, 2021 · 8 comments
Open

DHT22 not working on Raspberry Pi wh #65

QS3445 opened this issue Mar 5, 2021 · 8 comments

Comments

@QS3445
Copy link

QS3445 commented Mar 5, 2021

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
Copy link

@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:

# you can pass DHT22 use_pulseio=False if you wouldn't like to use pulseio.

# This may be necessary on a Linux single board computer like the Raspberry Pi,

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
Copy link
Author

QS3445 commented Mar 5, 2021

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
Copy link
Author

QS3445 commented Mar 6, 2021

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
Copy link

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
Copy link

SunSDSE commented May 20, 2021

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
Copy link

JavanXD commented Aug 14, 2021

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 (#73) because in your issue it is not clear if the cause is because you are running the python script with sudo.

@ccvaillant1992
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants