DHT22 not found

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
ohnomrbill
 
Posts: 46
Joined: Sat Jan 30, 2016 5:03 pm

DHT22 not found

Post by ohnomrbill »

Upgraded to circuitpython and DHT22 stopped working. Error message: DHT sensor not found, check wiring

Version.sh follows:
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLT000B1114BBBK1616]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
UBOOT: Loaded Overlay:[BB-HDMI-TDA998x-00A0]
kernel:[4.19.94-ti-r42]
nodejs:[v10.15.2]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20200722.0-0~buster+20200722]
pkg:[bb-wl18xx-firmware]:[1.20200702.0-0~buster+20200702]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.5-git20200715.0-0~buster+20200716]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[ 55.801451] remoteproc remoteproc0: wkup_m3 is available
[ 55.821468] remoteproc remoteproc0: powering up wkup_m3
[ 55.821498] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 55.821781] remoteproc remoteproc0: remote processor wkup_m3 is now up
[ 59.067926] remoteproc remoteproc1: 4a334000.pru is available
[ 59.082608] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[ 59.067926] remoteproc remoteproc1: 4a334000.pru is available
[ 59.068111] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[ 59.082608] remoteproc remoteproc2: 4a338000.pru is available
[ 59.082760] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[ 0.949342] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 0.962565] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: DHT22 not found

Post by drewfustini »

Could you please post a photo of the wiring?

Thanks,
drew

User avatar
ohnomrbill
 
Posts: 46
Joined: Sat Jan 30, 2016 5:03 pm

Re: DHT22 not found

Post by ohnomrbill »

py code:
import board
import time
import adafruit_dht
import datetime

#pin = 'P8_11' GPIO_45
dhtDevice = adafruit_dht.DHT22(board.P8_11)
#get time stamp which is GMT
timestamp = datetime.datetime.now().strftime('%Y-%m-%d/%H:%M:%S')

# location zipcode
loc = '75214'
temp_f=0.
humidity=0.
print ('X={}_{}_{}_{}'.format(timestamp,temp_f, humidity, loc))

i=1
#try five times to get a reading
while (i!=5):
try:
temp_f=(dhtDevice.temperature*1.8)+32
humidity=dhtDevice.humidity
print("Temp: {:.1f} F Humidity: {}% ".format(temp_f, humidity))
break
except RuntimeError as error:
print(error.args[0])
i=i+1
time.sleep(2.0)
#
Attachments
2020-07-31_06-37-28.jpg
2020-07-31_06-37-28.jpg (881.41 KiB) Viewed 1393 times

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: DHT22 not found

Post by drewfustini »

Thanks for posting the photo.

I'm waiting for a DHT22 to arrive so I can reproduce the issue and find a solution.

User avatar
ohnomrbill
 
Posts: 46
Joined: Sat Jan 30, 2016 5:03 pm

Re: DHT22 not found

Post by ohnomrbill »

thank you....

User avatar
ohnomrbill
 
Posts: 46
Joined: Sat Jan 30, 2016 5:03 pm

Re: DHT22 not found

Post by ohnomrbill »

any update?

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: DHT22 not found

Post by drewfustini »

Hi, sorry for the delay, I finally have to part and should be able to try it out this evening. Thank you for your patience.

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: DHT22 not found

Post by drewfustini »

I have been able to reproduce the same issue you are experiencing. I have not yet been able to determine why the CircuitPython DHT22 library does not work on the BeagleBone Black.

However, the deprecated Python library does work:
https://github.com/adafruit/Adafruit_Python_DHT

Could you please give this a try?

Code: Select all

sudo apt-get install build-essential python-dev
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT
sudo python3 ./setup.py install
cd examples/
sudo python3 ./AdafruitDHT.py 22 P8_11
Here are the results I get:

Code: Select all

debian@beaglebone:~/Adafruit_Python_DHT/examples$ sudo python3 ./AdafruitDHT.py 22 P8_11
Temp=28.0*  Humidity=53.2%

User avatar
ohnomrbill
 
Posts: 46
Joined: Sat Jan 30, 2016 5:03 pm

Re: DHT22 not found

Post by ohnomrbill »

thank you... will test as soon as I can get a free moment... Will post results.

User avatar
ohnomrbill
 
Posts: 46
Joined: Sat Jan 30, 2016 5:03 pm

Re: DHT22 not found

Post by ohnomrbill »

ImportError: cannot import name 'Beaglebone_Black_Driver' from 'Adafruit_DHT' (/usr/local/lib/python3.7/dist-packages/Adafruit_DHT/__init__.py)

when running "python3 ./AdafruitDHT.py 22 P8_11" under su.

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: DHT22 not found

Post by drewfustini »

Did the setup run ok?

Could you paste the entire output of running the commands?

User avatar
ohnomrbill
 
Posts: 46
Joined: Sat Jan 30, 2016 5:03 pm

Re: DHT22 not found

Post by ohnomrbill »

reran install, since I had logged off:

root@BBB-B2:/usr/src/AM2302/Adafruit_Python_DHT# python3 ./setup.py install
running install
running bdist_egg
running egg_info
writing Adafruit_DHT.egg-info/PKG-INFO
writing dependency_links to Adafruit_DHT.egg-info/dependency_links.txt
writing top-level names to Adafruit_DHT.egg-info/top_level.txt
reading manifest file 'Adafruit_DHT.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Adafruit_DHT.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
running build_ext
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-3.7/Adafruit_DHT/common.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-3.7/Adafruit_DHT/Test.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-3.7/Adafruit_DHT/Beaglebone_Black_Driver.cpython-37m-arm-linux-gnueabihf.so -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-3.7/Adafruit_DHT/Raspberry_Pi_2.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-3.7/Adafruit_DHT/Beaglebone_Black.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-3.7/Adafruit_DHT/__init__.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-3.7/Adafruit_DHT/Raspberry_Pi.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-3.7/Adafruit_DHT/platform_detect.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/common.py to common.cpython-37.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Test.py to Test.cpython-37.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Raspberry_Pi_2.py to Raspberry_Pi_2.cpython-37.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Beaglebone_Black.py to Beaglebone_Black.cpython-37.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Raspberry_Pi.py to Raspberry_Pi.cpython-37.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/platform_detect.py to platform_detect.cpython-37.pyc
creating stub loader for Adafruit_DHT/Beaglebone_Black_Driver.cpython-37m-arm-linux-gnueabihf.so
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Beaglebone_Black_Driver.py to Beaglebone_Black_Driver.cpython-37.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
writing build/bdist.linux-armv7l/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
Adafruit_DHT.__pycache__.Beaglebone_Black_Driver.cpython-37: module references __file__
creating 'dist/Adafruit_DHT-1.4.0-py3.7-linux-armv7l.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing Adafruit_DHT-1.4.0-py3.7-linux-armv7l.egg
removing '/usr/local/lib/python3.7/dist-packages/Adafruit_DHT-1.4.0-py3.7-linux-armv7l.egg' (and everything under it)
creating /usr/local/lib/python3.7/dist-packages/Adafruit_DHT-1.4.0-py3.7-linux-armv7l.egg
Extracting Adafruit_DHT-1.4.0-py3.7-linux-armv7l.egg to /usr/local/lib/python3.7/dist-packages
Adafruit-DHT 1.4.0 is already the active version in easy-install.pth

Installed /usr/local/lib/python3.7/dist-packages/Adafruit_DHT-1.4.0-py3.7-linux-armv7l.egg
Processing dependencies for Adafruit-DHT==1.4.0
Finished processing dependencies for Adafruit-DHT==1.4.0

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: DHT22 not found

Post by drewfustini »

Thanks, that is odd that it reports no errors but the script does not run.
Could you run this and paste the full output?

Code: Select all

cd examples/
sudo python3 ./AdafruitDHT.py 22 P8_11
thanks,
drew

User avatar
ohnomrbill
 
Posts: 46
Joined: Sat Jan 30, 2016 5:03 pm

Re: DHT22 not found

Post by ohnomrbill »

root@BBB-B2:/usr/src/AM2302/Adafruit_Python_DHT/examples# python3 ./AdafruitDHT.py 22 P8_11
Traceback (most recent call last):
File "./AdafruitDHT.py", line 41, in <module>
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
File "/usr/local/lib/python3.7/dist-packages/Adafruit_DHT/common.py", line 94, in read_retry
humidity, temperature = read(sensor, pin, platform)
File "/usr/local/lib/python3.7/dist-packages/Adafruit_DHT/common.py", line 80, in read
platform = get_platform()
File "/usr/local/lib/python3.7/dist-packages/Adafruit_DHT/common.py", line 60, in get_platform
from . import Beaglebone_Black
File "/usr/local/lib/python3.7/dist-packages/Adafruit_DHT/Beaglebone_Black.py", line 24, in <module>
from . import Beaglebone_Black_Driver as driver
ImportError: cannot import name 'Beaglebone_Black_Driver' from 'Adafruit_DHT' (/usr/local/lib/python3.7/dist-packages/Adafruit_DHT/__init__.py)

User avatar
ohnomrbill
 
Posts: 46
Joined: Sat Jan 30, 2016 5:03 pm

Re: DHT22 not found

Post by ohnomrbill »

Problem Fixed...
Started with a clean debian image, update, then upgrade. Installed archived version of DHT package. Successful run of example..

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”