I'm trying to read sensor data from a DHT22 on a Raspberry Pi Zero W with the latest Raspberry Pi OS (32 bit). I've installed the adafruit libraries according to the tutorials I could find, but it looks like the libraries are linked to an older version of libgpiod than what the latest Trixie OS provides.
libgpiod2 is not installable via apt:
I have libgpiod3 installed and libgpiod.so.3 is available:
Any ideas how this can be resolved?
Code:
pi@zero:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 13 (trixie)"NAME="Raspbian GNU/Linux"VERSION_ID="13"VERSION="13 (trixie)"VERSION_CODENAME=trixieDEBIAN_VERSION_FULL=13.1ID=raspbianID_LIKE=debianHOME_URL="http://www.raspbian.org/"SUPPORT_URL="http://www.raspbian.org/RaspbianForums"BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"Code:
pi@zero:~ $ uname -aLinux zero 6.12.47+rpt-rpi-v6 #1 Raspbian 1:6.12.47-1+rpt1 (2025-09-16) armv6l GNU/LinuxCode:
pi@zero:~ $ source app/venv/bin/activate(venv) pi@zero:~ $ Code:
(venv) pi@zero:~ $ python3 -m pip install --upgrade --force-reinstall gpiod adafruit-blinka adafruit-circuitpython-dht Adafruit-PlatformDetect (lots of output but everything was successful)Code:
(venv) pi@zero:~ $ python3Python 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 14.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> >>> >>> import board>>> import adafruit_dht>>> sensor = adafruit_dht.DHT22(board.D4)/home/pi/app/venv/lib/python3.13/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein: error while loading shared libraries: libgpiod.so.2: cannot open shared object file: No such file or directoryTraceback (most recent call last): File "<python-input-4>", line 1, in <module> sensor = adafruit_dht.DHT22(board.D4) File "/home/pi/app/venv/lib/python3.13/site-packages/adafruit_dht.py", line 300, in __init__ super().__init__(False, pin, 1000, use_pulseio) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/app/venv/lib/python3.13/site-packages/adafruit_dht.py", line 82, in __init__ self.pulse_in = PulseIn(self._pin, maxlen=self._max_pulses, idle_state=True) ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/app/venv/lib/python3.13/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 89, in __init__ message = self._wait_receive_msg(timeout=0.25) File "/home/pi/app/venv/lib/python3.13/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 107, in _wait_receive_msg raise RuntimeError( "Timed out waiting for PulseIn message. Make sure libgpiod is installed." )RuntimeError: Timed out waiting for PulseIn message. Make sure libgpiod is installed.libgpiod2 is not installable via apt:
Code:
(venv) pi@zero:~ $ sudo apt install libgpiodlibgpiod3 libgpiod-dev libgpiod-doc I have libgpiod3 installed and libgpiod.so.3 is available:
Code:
/usr/lib/arm-linux-gnueabihf/libgpiod.so.3Any ideas how this can be resolved?
Statistics: Posted by Lemur117 — Thu Oct 30, 2025 6:51 pm — Replies 0 — Views 32