![]() ![]() So I bet this is the reason why the error unknown platform occurs. Here I see there is an If/elif structure def get_platform() that aims to identify the device calling the library, but there is value assignment only for RPi 1, 2 and 3, while RPi 4 is missing. I did a little research on the github repository of Adafruit_Python_DHT library, and I found the script Adafruit_Python_DHT/Adafruit_DHT/common.py. ![]() Humidity, temperature = read(sensor, pin, platform) Humidity, temperature = Adafruit_DHT.read_retry(sensor, pin) Since I have a DHT 22 sensor connected to GPIO pi n° 4,Īnd I get (lab_app) python AdafruitDHT.py 2302 4 Then, I navigate to the directory Adafruit_Python_DHT/examples/, and then, So I installed the library Adafruit_DHT sudo pip3 install Adafruit_DHT I have a Raspberry Pi 4 connected with a DHT22 sensor, and I want to read data from my sensor. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |