Comments on: Raspberry Pi: DHT11/DHT22 Temperature and Humidity (Python) https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Wed, 25 Jun 2025 02:21:04 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Rossen https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/#comment-1060740 Wed, 25 Jun 2025 02:21:04 +0000 https://randomnerdtutorials.com/?p=134396#comment-1060740 In reply to Rossen.

Problem solved in Adafruit-Blinka 8.61.2. I just ununstall 8.60.0 andre-run the install again

]]>
By: Rossen https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/#comment-1059080 Thu, 19 Jun 2025 14:00:59 +0000 https://randomnerdtutorials.com/?p=134396#comment-1059080 Hi,
I few months ago I had working script, but my SD card has gone. Now I’m trying to reproduce again. Everything is the same, but the script fails with:

(env) termometer@raspberrypi:~/dht22 $ python3 dht_basic.py
Traceback (most recent call last):
File “/home/termometer/dht22/dht_basic.py”, line 5, in
import board
File “/home/termometer/dht22/env/lib/python3.11/site-packages/board.py”, line 21, in
from adafruit_blinka.agnostic import board_id, detector
ModuleNotFoundError: No module named ‘adafruit_blinka’

The dht library is installed as the recmmended:

(env) termometer@raspberrypi:~/dht22 $ python3 -m pip install adafruit-circuitpython-dht
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: adafruit-circuitpython-dht in ./env/lib/python3.11/site-packages (4.0.9)
Requirement already satisfied: Adafruit-Blinka in ./env/lib/python3.11/site-packages (from adafruit-circuitpython-dht) (8.60.0)
Requirement already satisfied: Adafruit-PlatformDetect>=3.70.1 in ./env/lib/python3.11/site-packages (from Adafruit-Blinka->adafruit-circuitpython-dht) (3.80.0)
Requirement already satisfied: Adafruit-PureIO>=1.1.7 in ./env/lib/python3.11/site-packages (from Adafruit-Blinka->adafruit-circuitpython-dht) (1.1.11)
Requirement already satisfied: RPi.GPIO in ./env/lib/python3.11/site-packages (from Adafruit-Blinka->adafruit-circuitpython-dht) (0.7.1)
Requirement already satisfied: rpi_ws281x>=4.0.0 in ./env/lib/python3.11/site-packages (from Adafruit-Blinka->adafruit-circuitpython-dht) (5.0.0)
Requirement already satisfied: sysv_ipc>=1.1.0 in ./env/lib/python3.11/site-packages (from Adafruit-Blinka->adafruit-circuitpython-dht) (1.1.0)
Requirement already satisfied: pyftdi>=0.40.0 in ./env/lib/python3.11/site-packages (from Adafruit-Blinka->adafruit-circuitpython-dht) (0.56.0)
Requirement already satisfied: binho-host-adapter>=0.1.6 in ./env/lib/python3.11/site-packages (from Adafruit-Blinka->adafruit-circuitpython-dht) (0.1.6)
Requirement already satisfied: adafruit-circuitpython-typing in ./env/lib/python3.11/site-packages (from Adafruit-Blinka->adafruit-circuitpython-dht) (1.12.1)
Requirement already satisfied: lgpio>=0.2.2.0 in ./env/lib/python3.11/site-packages (from Adafruit-Blinka->adafruit-circuitpython-dht) (0.2.2.0)
Requirement already satisfied: pyserial in ./env/lib/python3.11/site-packages (from binho-host-adapter>=0.1.6->Adafruit-Blinka->adafruit-circuitpython-dht) (3.5)
Requirement already satisfied: pyusb!=1.2.0,>=1.0.0 in ./env/lib/python3.11/site-packages (from pyftdi>=0.40.0->Adafruit-Blinka->adafruit-circuitpython-dht) (1.3.1)
Requirement already satisfied: adafruit-circuitpython-busdevice in ./env/lib/python3.11/site-packages (from adafruit-circuitpython-typing->Adafruit-Blinka->adafruit-circuitpython-dht) (5.2.13)
Requirement already satisfied: adafruit-circuitpython-requests in ./env/lib/python3.11/site-packages (from adafruit-circuitpython-typing->Adafruit-Blinka->adafruit-circuitpython-dht) (4.1.13)
Requirement already satisfied: typing_extensions~=4.0 in ./env/lib/python3.11/site-packages (from adafruit-circuitpython-typing->Adafruit-Blinka->adafruit-circuitpython-dht) (4.14.0)
Requirement already satisfied: Adafruit-Circuitpython-ConnectionManager in ./env/lib/python3.11/site-packages (from adafruit-circuitpython-requests->adafruit-circuitpython-typing->Adafruit-Blinka->adafruit-circuitpython-dht) (3.1.5)

]]>
By: Rem Collier https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/#comment-996527 Thu, 02 Jan 2025 07:54:24 +0000 https://randomnerdtutorials.com/?p=134396#comment-996527 In reply to Roger.

Hi,

I am following the tutorial – I had to use thr pulseio=False fix to get it working, but now I get: “A Full Buffer was not returned”. I am using a DHT11 sensor…

Any Ideas?

Many thanks,

Rem

]]>
By: Faris https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/#comment-915891 Fri, 17 May 2024 09:36:14 +0000 https://randomnerdtutorials.com/?p=134396#comment-915891 Hi Sara,
I went through all your steps but always fail at running the skript. All errors returned are about failed imports because no such modul exsist. I am a complete beginner and don´t know how to solve the problem.

I would be happy with some help

Best Regards
Faris

]]>
By: Dieter Beer https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/#comment-892489 Sun, 18 Feb 2024 16:37:26 +0000 https://randomnerdtutorials.com/?p=134396#comment-892489 In reply to Sara Santos.

Hi Sara, I use a Pi 3B+ with OS 64bit from 2023-12-05. I did a complete new installation. Kind regards Dieter

]]>
By: Sara Santos https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/#comment-892453 Sun, 18 Feb 2024 11:30:30 +0000 https://randomnerdtutorials.com/?p=134396#comment-892453 In reply to Baps.

Hi.
Can you tell me which Raspberry Pi and which OS are you using?
We didn’t need to run that on our setup.

Regards,
Sara

]]>
By: Baps https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/#comment-892402 Sun, 18 Feb 2024 03:40:01 +0000 https://randomnerdtutorials.com/?p=134396#comment-892402 it additionally needed:
(myenv) pi@raspberrypi:~/Desktop/dht_test $ python3 -m pip install RPi.GPIO

else showing error:
ModuleNotFoundError: No module named ‘RPi’

]]>
By: Dieter Beer https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/#comment-891594 Thu, 15 Feb 2024 16:34:02 +0000 https://randomnerdtutorials.com/?p=134396#comment-891594 In reply to Sara Santos.

Hi Sara, thanks for your support. The re-installation of the gpio lib solved the problem. As a work around I upfront your hint modified the sketch in that way that it worked without the ‚import board‘ statement. Thanks again ! Dieter

]]>
By: Sara Santos https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/#comment-891492 Thu, 15 Feb 2024 10:39:49 +0000 https://randomnerdtutorials.com/?p=134396#comment-891492 In reply to Dieter Beer.

Hi.
I’m not sure about that error message.
I didn’t face that issue with my setup.
Taking a look at this discussion: https://github.com/adafruit/Adafruit_CircuitPython_DHT/issues/29
It is suggested to run the following command:
sudo apt-get install libgpiod2

Let me know if this solves the issue.
Regards,
Sara

]]>
By: Dieter Beer https://randomnerdtutorials.com/raspberry-pi-dht11-dht22-python/#comment-890021 Sun, 11 Feb 2024 09:08:24 +0000 https://randomnerdtutorials.com/?p=134396#comment-890021 Hi Sara, the sketch doesn’t work on my Pi 3b+, latest 64-bit OS. Here the error log:
myenv) kdbeer@raspberrypi:~/mu_code/DHT11 $ python DHT11_basic.py

/home/kdbeer/mu_code/DHT11/myenv/lib/python3.9/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64: error while loading shared libraries: libgpiod.so.2: cannot open shared object file: No such file or directory

Traceback (most recent call last):
File “/home/kdbeer/mu_code/DHT11/DHT11_basic.py”, line 11, in
sensor = adafruit_dht.DHT11(board.D4)
File “/home/kdbeer/mu_code/DHT11/myenv/lib/python3.9/site-packages/adafruit_dht.py”, line 294, in init
super().init(True, pin, 18000, use_pulseio)
File “/home/kdbeer/mu_code/DHT11/myenv/lib/python3.9/site-packages/adafruit_dht.py”, line 86, in init
self.pulse_in = PulseIn(self._pin, maxlen=self._max_pulses, idle_state=True)
File “/home/kdbeer/mu_code/DHT11/myenv/lib/python3.9/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py”, line 89, in init
message = self._wait_receive_msg(timeout=0.25)
File “/home/kdbeer/mu_code/DHT11/myenv/lib/python3.9/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py”, line 107, in _wait_receive_msg
raise RuntimeError(
RuntimeError: Timed out waiting for PulseIn message. Make sure libgpiod is installed.
can you give me hint how to solve it ?

Thanks for helping !

]]>