Trying to setup edge detection on a Pi Zero 2W results in an error with the new kernel 6.6:
Note: The code had run for years on previous kernels without problems.
Mar 23 05:57:39 raspberry2 GetSensorData_RFM69[88878]: INFO Set up radio module
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: RFM69 found on CS 0
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: Traceback (most recent call last):
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: File "/usr/local/bin/RaspyRFM2/GetSensorData_RFM69.py", line 110, in <module>
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: rfm = RaspyRFM(1, RFM69)
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: ^^^^^^^^^^^^^^^^^^
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: File "/usr/local/bin/RaspyRFM2/raspyrfm/__init__.py", line 45, in RaspyRFM
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: return rfm69.Rfm69(s[0], s[1])
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: ^^^^^^^^^^^^^^^^^^^^^^^
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: File "/usr/local/bin/RaspyRFM2/raspyrfm/rfm69.py", line 153, in __init__
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: GPIO.add_event_detect(gpio_int, GPIO.RISING, callback=self.__rfm_irq)
Mar 23 05:57:39 raspberry2 raspyrfm2[88878]: RuntimeError: Failed to add edge detection
Mar 23 05:57:39 raspberry2 kernel: export_store: invalid GPIO 25
Mar 23 05:57:39 raspberry2 systemd[1]: raspyrfm2.service: Main process exited, code=exited, status=1/FAILURE
Mar 23 05:57:39 raspberry2 systemd[1]: raspyrfm2.service: Failed with result 'exit-code'.
Mar 23 05:57:39 raspberry2 systemd[1]: Failed to start raspyrfm2.service - RaspyRFM2 Radio Data Receiver.
The call of GPIO.add_event_detect(gpio_int, GPIO.RISING, callback=self.__rfm_irq) (with gpio_int = 25) results in an error message RuntimeError: Failed to add edge detection, the kernel can't export GPIO 25.
Reason: the pin numbering of the gpio has drastically changed, is no longer zero-based. On a Pi Zero 2 W, sudo cat /sys/kernel/debug/gpio | grep '(GPIO' lists as:
Trying to setup edge detection on a Pi Zero 2W results in an error with the new kernel 6.6: Note: The code had run for years on previous kernels without problems.
The call of
GPIO.add_event_detect(gpio_int, GPIO.RISING, callback=self.__rfm_irq)
(withgpio_int = 25
) results in an error message RuntimeError: Failed to add edge detection, the kernel can't export GPIO 25.Reason: the pin numbering of the gpio has drastically changed, is no longer zero-based. On a Pi Zero 2 W,
sudo cat /sys/kernel/debug/gpio | grep '(GPIO'
lists as:This issue is not limited to the Zero 2W, should affect other platforms as well. It is definitely an issue of the underlying library RPi.GPIO.