Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi 5 - Import error - All GPIO related operation #96

Open
the1bit opened this issue Dec 19, 2023 · 1 comment
Open

Raspberry Pi 5 - Import error - All GPIO related operation #96

the1bit opened this issue Dec 19, 2023 · 1 comment

Comments

@the1bit
Copy link

the1bit commented Dec 19, 2023

Script Command

import time
import adafruit_dht
import board

dht_device = adafruit_dht.DHT11(board.D4)

temperature_c = dht_device.temperature
temperature_f = temperature_c * (9 / 5) + 32
humidity = dht_device.humidity
print("Temp:{:.1f} C / {:.1f} C    Humidity: {}%".format(temperature_c, temperature_f, humidity))

Operating System

6.1.0-rpi7-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

Hardware

Raspberry Pi 5 Model B

Behavior

`ImportError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/user/development/python/dht11/dht11.py", line 2, in
import adafruit_dht
File "/home/user/development/python/dht11/env/lib/python3.11/site-packages/adafruit_dht.py", line 32, in
from digitalio import DigitalInOut, Pull, Direction
File "/home/user/development/python/dht11/env/lib/python3.11/site-packages/digitalio.py", line 27, in
from adafruit_blinka.microcontroller.bcm2712.pin import *
File "/home/user/development/python/dht11/env/lib/python3.11/site-packages/adafruit_blinka/microcontroller/bcm2712/pin.py", line 5, in
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
File "/home/user/development/python/dht11/env/lib/python3.11/site-packages/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py", line 8, in
raise ImportError(
ImportError: libgpiod Python bindings not found, please install and try again! See https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/master/libgpiod.sh`

Description

I want to read data from DHT11 sensor.
(https://pimylifeup.com/raspberry-pi-dht11-sensor/)

I've installed everything on the right way, nevertheless I cannot read any data.

I cannot do any operation on GPIO. Neither sensors nor relays.

Additional information

No response

@tekktrik
Copy link
Member

Hi, the code in this area has changed slightly. does upgrading Blinka help? When you upgrade, you may still be prompted to install libgpiod python bindings; clicking that link will take you to the Installer Script library to install and the specific script you will need to use. The library README in the repository has general installation and usage instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants