Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5315

Python • Re: Gpiod 'get_line' Error

$
0
0
How did you install gpiod? From the errors you are seeing it looks to me like you have a recent gpiod installed, so v2.

I have the latest gpiod (2.1.3) installed from PyPI with pip:

Code:

$ pip listPackage    Version---------- -------colorzero  2.0gpiod      2.1.3lgpio      0.2.2.0pip        23.0.1setuptools 66.1.1wheel      0.38.4

Code:

>>> gpiod.__version__'2.1.3'>>> 
The API has changed for v2.

Take a look at the examples, which shoe how to request lines for different purposes. For a Pi5 the usual GPIOs are on gpiochip4, instead of gpiochip0.

And you can generate documentation locally using

Code:

python -m pydoc -p 1234
and pointing a browser at http://localhost:1234/gpiod.html

Statistics: Posted by warthog618 — Mon May 06, 2024 12:05 pm



Viewing all articles
Browse latest Browse all 5315

Trending Articles