1

OK, This is a little frustrating as I am JUST trying to get the temperature/Humidity readings on my DHT 11 sensor with Raspberry pi 4 and I am unable to do so. Please see below

https://www.electronicwings.com/raspberry-pi/dht11-interfacing-with-raspberry-pi

I get an error asking me to run the same as sudo.

Then after I try to run the program as a sudo user I get the following error repeatedly:

"Failed to get the readin. Try Again"

I even tried changing the sensor to no avail....

There were some posts suggesting a different version as the Adafruit function does not seem support the latest hardware. However there does not seem to be a proper closure to any of the posts. enter image description here I also tried this

https://stackoverflow.com/questions/63232072/cannot-import-name-beaglebone-black-driver-from-adafruit-dht

Any help is appreciated.


Ok So like Dougie suggested I went to the post and downloaded DHT.PY

Reliable temperature/humidity logging with Python and a DHT11

After downloading DHT.Py , I ran the script mentioned in the link above and then when i ran I do not see any error message nor do i see any out put

enter image description here

I also ensured to keep the DHT.Py and the script that i am running in the same folder...(Double checked pins , nothing much to check anyways, there is ground , power and pin 4 (BCM)), SO it is not the circuit or the sensor , so I ma guessing it must be code. I also did sudo pigpiod before I ran all this..

Am i just being plain stupid or is this really an issue ??

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • 1
    The Adafruit code is notoriously unreliable. See https://raspberrypi.stackexchange.com/a/105549/8697 – Milliways Sep 26 '20 at 08:52
  • @Dougie thanks for this but looks like I am still struggling. Please see the edit for the problems that I am facing... – Vikram Suriyanarayanan Sep 27 '20 at 18:36
  • @Milliways , thanks this is the code that I am using now that even Dougie has suggested..No solution in sight... – Vikram Suriyanarayanan Sep 27 '20 at 18:45
  • The pictures are impossible to read. If you want help post TEXT. – Milliways Sep 27 '20 at 22:19
  • Ah, you seem to be using a driver for BeagleBone. Perhaps you can try the Kookye tutorial in this Q&A: "Rpi3 DHT11 sensor": https://raspberrypi.stackexchange.com/questions/96560/rpi3-might-have-been-fried-by-wrongly-connected-dht11-temparature-sensor. Good luck. Cheers. – tlfong01 Sep 28 '20 at 01:06
  • @Milliways I am using the exact same code that you have shared in the link (after ofcourse connecting to the right pin) .. I do not see nay output in the shell all I see is this in the thonny python IDE

    Python 3.7.3 (/usr/bin/python3)

    – Vikram Suriyanarayanan Sep 29 '20 at 02:14