1

I have an AM2302 from Adafruit. I have followed the directions on ModMyPi. Which consisted of cloning https://github.com/adafruit/Adafruit_Python_DHT.git via git. Installing build-essential and python-dev then running sudo python setup.py install. When I test the connection with the library I get Failed to get reading. Try again!. I have tried different GPIOs as well as both 3.3V pins. Each time I get the same result. I am not seeing anything relevant in the logs other then I am opening 'gpiomem device'.

pi@dapi:~/Projects/TempSensor/Adafruit_Python_DHT/examples $ sudo ./AdafruitDHT.py 2302 4
Failed to get reading. Try again!

I edited simpletest.py to reflect the proper sensor and pin and I receive the same result.

pi@dapi:~/Projects/TempSensor/Adafruit_Python_DHT/examples $ sudo python simpletest.py
Failed to get reading. Try again!
2

Try different software. There are plenty of choices if you google.

E.g. my DHT11/21/22/33/44 code.

To build

gcc -Wall -pthread -o DHTXXD test_DHTXXD.c DHTXXD.c -lpigpiod_if2

To start the daemom

sudo pigpiod

To run

./DHTXXD -g4 -i3 # connected to (Broadcom numbering) GPIO 4, every 3 seconds

DHTXXD returns three values. A status, the temperature, and the humidity. The status is one of the following. 0 (good) indicates a successful read. The other values indicate a read failure and the last good read of temperature and humidity will be returned.

GOOD         0
BAD_CHECKSUM 1
BAD_DATA     2
TIMEOUT      3
  • Still not receiving anything. pi@dapi:~/Projects/TempSensor/Adafruit_Python_DHT $ ./DHTXXD -g2 -i3 3 0.0 0.0 – Unfundednut Sep 15 '16 at 12:12
  • @MrStatic Which GPIO are you using? My pigpio only uses Broadcom numbering so 2 refers to GPIO2 which is connected to pin 3. It's not the best choice as it has hard-wired 1k8 pull-ups to 3V3 fitted. For GPIO numbering see pinout.xyz (pin 1 is at the SD card end). – joan Sep 15 '16 at 13:32
  • I have tried on 4 and 22. Both result in 0.0 0.0. – Unfundednut Sep 15 '16 at 23:18
  • Either the sensors are faulty or you are not connecting them properly. A close-up photo added to your question showing the connections would help. – joan Sep 16 '16 at 8:11
  • Here are two photos. This was my more recent attempt so I moved to 26. – Unfundednut Sep 16 '16 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.