Error: libgpiod.so.2: cannot open shared object file: No such file or directory
See original GitHub issueHi,
I’m running the example as demonstrated here: https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/python-setup#
I was using the deprecated library (https://github.com/adafruit/Adafruit_Python_DHT) initially with the exact same setup and it is working. So I’m certain the sensor is working.
I have updated my script to import the new library, made some changes as per example but when I’m running the script I get the following error.
I’m fairly new to python, so any help would be welcome to resolve this.
PS. GPIO_PIN_NR
is declared as GPIO_PIN_NR = board.D4
because I have connected the data wire of the DHT11 sensor to GPIO pin 4.
Console output:
(.env) pi@raspberrypi:~/dht-sensor-reader $ python3 temp.py
/home/pi/dht-sensor-service/.env/lib/python3.7/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 directory
Traceback (most recent call last):
File "temp.py", line 19, in <module>
dhtSensor = adafruit_dht.DHT11(GPIO_PIN_NR)
File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_dht.py", line 246, in __init__
super().__init__(True, pin, 18000)
File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_dht.py", line 66, in __init__
self.pulse_in = PulseIn(self._pin, 81, True)
File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 64, in __init__
message = self._wait_receive_msg()
File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 80, in _wait_receive_msg
raise RuntimeError("Timed out waiting for PulseIn message")
RuntimeError: Timed out waiting for PulseIn message
The full script can be found here: https://gitlab.com/dht-sensor/dht-sensor-reader/blob/feature/adafruit_lib/temp.py The DHT11 is instantiated at line 19. The values are read at 62,63
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
run
sudo apt-get install libgpiod2
I can’t find that library in my raspbian installation. I have run update, upgrade, dist-upgrade but can’t find it.
my OS version
When I try to search for it, I get nothing. When I search for
What am I missing? can I install it from another source?