Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

No longer can read from DHT22
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

No longer can read from DHT22

by Radnor302 on Thu Jul 30, 2020 8:19 am

Hello to all!

I have a DHT22 connected to a RPi that WAS working....

I did an update / upgrade on the Pi and now cannot read the sensor.

Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "test.py", line 11, in <module>
    humidity, temp = get_inside_temp()
  File "test.py", line 7, in get_inside_temp
    localH, localT = 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)


TIA for the help

Radnor302
 
Posts: 5
Joined: Thu Jul 30, 2020 8:14 am

Re: No longer can read from DHT22

by mikeysklar on Thu Jul 30, 2020 4:13 pm

I've seen another post on the forums that after a Pi was upgraded the platform_get() code is not returning a different chipset for the CPU hardware.

if it helps it looks like I ran a apt-get update / upgrade and it changed my CPUinfo to show that I have Hardware : BCM2711 I kinda hotwired platform_get() to treat that as a raspberry pi 3 and now it is working.... (I know this is a poor answer and poor solution but it fixed it.)


viewtopic.php?f=19&t=165722&p=821443&hilit=dht22+was+working#p821443

I would first try to run the following command to make sure you have the latest pip utilities and then re-install the DHT library.

Code: Select all | TOGGLE FULL SIZE
sudo python3 -m pip install --upgrade pip setuptools wheel


Code: Select all | TOGGLE FULL SIZE
sudo pip3 install Adafruit_DHT


I think this is most likely resolved, but only the OS has been upgraded not necessarily pip and the DHT library.

mikeysklar
 
Posts: 1644
Joined: Mon Aug 01, 2016 8:10 pm

Re: No longer can read from DHT22

by Radnor302 on Thu Jul 30, 2020 5:08 pm

Adafruit is at 1.4.0

How to go about patching the return value for the CPU???

cat /proc/device-tree/model
Raspberry Pi 4 Model B Rev 1.2


Hardware : BCM2711
Revision : c03112
Serial :
Model : Raspberry Pi 4 Model B Rev 1.2

Radnor302
 
Posts: 5
Joined: Thu Jul 30, 2020 8:14 am

Re: No longer can read from DHT22

by Radnor302 on Thu Jul 30, 2020 6:19 pm

found it and patched it

Radnor302
 
Posts: 5
Joined: Thu Jul 30, 2020 8:14 am

Re: No longer can read from DHT22

by mikeysklar on Thu Jul 30, 2020 8:34 pm

Cool - What was your solution?

mikeysklar
 
Posts: 1644
Joined: Mon Aug 01, 2016 8:10 pm

Re: No longer can read from DHT22

by Radnor302 on Thu Jul 30, 2020 10:07 pm


Radnor302
 
Posts: 5
Joined: Thu Jul 30, 2020 8:14 am

Please be positive and constructive with your questions and comments.