You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating system: Raspbian Bookworm, with kernel 6.6.20+rpt-rpi-v8
Python version: 3.11
Pi model: Pi 4 Model B
GPIO Zero version: 2.0.1
Pin factory used: RPi.GPIO 0.7.1
The basic snippet below
importgpiozerogpiozero.Button(26) # or any other pin number
fails with error
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: File "/root/ha-alarm-raspy2mqtt-venv/lib/python3.11/site-packages/gpiozero/devices.py", line 108, in __call__
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: self = super().__call__(*args, **kwargs)
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: File "/root/ha-alarm-raspy2mqtt-venv/lib/python3.11/site-packages/gpiozero/input_devices.py", line 412, in __init__
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: super().__init__(
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: File "/root/ha-alarm-raspy2mqtt-venv/lib/python3.11/site-packages/gpiozero/mixins.py", line 417, in __init__
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: super().__init__(*args, **kwargs)
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: File "/root/ha-alarm-raspy2mqtt-venv/lib/python3.11/site-packages/gpiozero/input_devices.py", line 168, in __init__
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: self.pin.when_changed = self._pin_changed
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: ^^^^^^^^^^^^^^^^^^^^^
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: File "/root/ha-alarm-raspy2mqtt-venv/lib/python3.11/site-packages/gpiozero/pins/__init__.py", line 471, in <lambda>
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: lambda self, value: self._set_when_changed(value),
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: File "/root/ha-alarm-raspy2mqtt-venv/lib/python3.11/site-packages/gpiozero/pins/pi.py", line 639, in _set_when_changed
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: self._enable_event_detect()
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: File "/root/ha-alarm-raspy2mqtt-venv/lib/python3.11/site-packages/gpiozero/pins/rpigpio.py", line 220, in _enable_event_detect
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: GPIO.add_event_detect(
Mar 29 00:30:28 raspberrypi-ha-alarm python3[1574]: RuntimeError: Failed to add edge detection
A few points:
there are already SIMILAR (but confused IMHO) issues open on this topic. I spent time reading them with no much success, so opening this one that, I hope, will help others
Searching online my understanding is that in latest Linux kernel the sysfs interface for GPIOs has been removed, and most of the GPIO factory libraries are still trying to use it, like RPI.GPIO.
I already managed to work-around the problem by using pigpio library as GPIO factory.
My suggestion: change documentation to clearly state that at this point in time, if you are on Bookworm and using a recent Linux kernel (would be nice to find out the exact Linux version since the sysfs deprecation), you MUST switch to pigpio library.
The text was updated successfully, but these errors were encountered:
Operating system: Raspbian Bookworm, with kernel 6.6.20+rpt-rpi-v8
Python version: 3.11
Pi model: Pi 4 Model B
GPIO Zero version: 2.0.1
Pin factory used: RPi.GPIO 0.7.1
The basic snippet below
fails with error
A few points:
there are already SIMILAR (but confused IMHO) issues open on this topic. I spent time reading them with no much success, so opening this one that, I hope, will help others
Searching online my understanding is that in latest Linux kernel the sysfs interface for GPIOs has been removed, and most of the GPIO factory libraries are still trying to use it, like RPI.GPIO.
I already managed to work-around the problem by using pigpio library as GPIO factory.
My suggestion: change documentation to clearly state that at this point in time, if you are on Bookworm and using a recent Linux kernel (would be nice to find out the exact Linux version since the sysfs deprecation), you MUST switch to pigpio library.
The text was updated successfully, but these errors were encountered: