Skip to content

Error: libgpiod.so.2: cannot open shared object file: No such file or directory #29

@phazebroek

Description

@phazebroek

Hi,

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions