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

DHT22 formerly working, now returns errors
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

DHT22 formerly working, now returns errors

by bitnoggin on Sat May 23, 2020 9:16 pm

Hi Guys,

I have a DHT22 connected to a Raspberry Pi 1 running Raspbian (jessie), and python 2.7.9

This is a project which combines the sensor with a relay connected to line voltage, and controlling a dehumidifier.

I have poor records from when I did this project, so I'm sorry I don't have purchase dates, but I'm certain I bought the sensor from Adafruit; I've bought other sensors since, and you are the only ones from whom I buy them. I think I first constructed this project sometime in 2017.

The device as constructed has been running without trouble for at least a couple years. Now, when the controlling script is executed, errors are returned which point to the DHT. The device can still be activated with a manual on or off command, but cannot be triggered by the sensor.

I'm using the following library for the sensor, which I downloaded from Adafruit at the time of purchase:

Adafruit_DHT-1.3.1-py2.7-linux-armv6l.egg

The errors generated are as follows:

Traceback (most recent call last):
File "./dehumidifier.auto", line 69, in <module>
humidity, temperature = dht.read_retry(dht.DHT22, sensorPin)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_DHT-1.3.1-py2.7-linux-armv6l.egg/Adafruit_DHT/common.py", line 90, in read_retry
File "/usr/local/lib/python2.7/dist-packages/Adafruit_DHT-1.3.1-py2.7-linux-armv6l.egg/Adafruit_DHT/common.py", line 76, in read
File "/usr/local/lib/python2.7/dist-packages/Adafruit_DHT-1.3.1-py2.7-linux-armv6l.egg/Adafruit_DHT/common.py", line 59, in get_platform
RuntimeError: Unknown platform.

My first thought was maybe a new version of the driver might be needed, but I can't find a new driver (or even the old one) on your site.

I tend to forget many of the details of these projects, so many months after construction. So I'm hoping I've given enough info you might be able to point me to a relatively simple fix.

Any help will be appreciated. Thank you.

bitnoggin
 
Posts: 1
Joined: Sat May 23, 2020 8:56 pm

Re: DHT22 formerly working, now returns errors

by brooney on Mon Jul 27, 2020 6:37 am

not help I am afraid, but similar has happened to me. This morning everything was working fine, restarted the program and the adafruit_DHT no longer works, you have unknown, my shows my raspberry Pi as a beaglebone_black

Traceback (most recent call last):
File "/home/pi/Desktop/planter.py", line 94, in <module>
hum, temp = dht.read(t,pin)
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)

I f i find any answers will post here, if you happened to figure it out let me know ;-)

brooney
 
Posts: 2
Joined: Sun Feb 04, 2018 11:24 pm

Re: DHT22 formerly working, now returns errors

by brooney on Mon Jul 27, 2020 7:40 am

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.)

brooney
 
Posts: 2
Joined: Sun Feb 04, 2018 11:24 pm

Re: DHT22 formerly working, now returns errors

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

brooney wrote: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.)

How to "hotwire" platform_get()? And with what? I'm in same boat

Found it and patched it. For those looking for it,
/usr/local/lib/p...3/dist.../ada.../platform_detect.py

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

Re: DHT22 formerly working, now returns errors

by osoblanco84 on Thu Aug 13, 2020 12:51 am

What did you do im trying to fix it myself but i cant edit the lib file and not sure what yall are changing.

osoblanco84
 
Posts: 5
Joined: Thu Aug 13, 2020 12:50 am

Please be positive and constructive with your questions and comments.