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

Lgpio doesn't work with gpiod 0.2 #1115

Open
Dennis-89 opened this issue Jan 28, 2024 · 1 comment
Open

Lgpio doesn't work with gpiod 0.2 #1115

Dennis-89 opened this issue Jan 28, 2024 · 1 comment

Comments

@Dennis-89
Copy link

Hello,

Operating system:
PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)"
NAME="Raspbian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm

Python version:
Python 3.11.2

Pi model:
Raspberry Pi 4 Model B Rev 1.1

GPIO Zero version:
2.0

Pin factory used:
LGPIOFactory

lgpio version:
Name: lgpio
Version: 0.0.0.2
Summary: Linux SBC GPIO module
Home-page: http://abyz.me.uk/lg/py_lgpio.html
Author: joan
Author-email: joan@abyz.me.uk
Maintainer: joan
Maintainer-email: joan@abyz.me.uk
License: unlicense.org
Download-URL: http://abyz.me.uk/lg/lg.zip
Keywords: linux,sbc,gpio

from gpiozero.pins.lgpio import LGPIOFactory
from gpiozero import DigitalInputDevice

def main():
    factory = LGPIOFactory(chip=0) 
    device = DigitalInputDevice(5, pull_up=True, pin_factory=factory)


if __name__ == '__main__':
    main()

Error in Terminal:

Traceback (most recent call last):
  File "/home/dennis/test/venv/lib/python3.11/site-packages/gpiozero/pins/lgpio.py", line 31, in <module>
    lgpio.SET_PULL_NONE
AttributeError: module 'lgpio' has no attribute 'SET_PULL_NONE'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dennis/test/test.py", line 1, in <module>
    from gpiozero.pins.lgpio import LGPIOFactory
  File "/home/dennis/test/venv/lib/python3.11/site-packages/gpiozero/pins/lgpio.py", line 33, in <module>
    lgpio.SET_PULL_NONE = lgpio.SET_BIAS_DISABLE
                          ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'lgpio' has no attribute 'SET_BIAS_DISABLE'
(venv) dennis@raspberrypi:~/test $ nano test.py

I found this information:
https://bugs.launchpad.net/ubuntu/+source/gpiozero/+bug/2019310

It would be greate, if you could fix this.

Thanks a lot!

@lurch
Copy link
Contributor

lurch commented Feb 5, 2024

Duplicate of #1038 (and it sounds like the temporary workaround is to not run things inside a venv).

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