Quantcast
Viewing all articles
Browse latest Browse all 14040

RPi.GPIO RuntimeError: Failed to add edge detection

I ran a python script on a Raspberrypi 4 on Raspbian Bookworm for quite a while. Since the latest update of bookworm the following code fragment fails at the last line

import RPi.GPIO as GPIOCLOCK_PIN = 27PULSE_PIN = 22BOUNCE_TIME = 30GPIO.setmode(GPIO.BCM)GPIO.setwarnings(False)GPIO.setup(CLOCK_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)GPIO.setup(PULSE_PIN, GPIO.OUT, initial=self.sqwave)GPIO.add_event_detect(CLOCK_PIN, GPIO.FALLING, callback=self.isr, bouncetime=BOUNCE_TIME)

with this error:

RuntimeError: Failed to add edge detection

The code is run in a service as root. Unfortunately i have no idea what can cause the error. Pin 27 should not have another function than gpio and user root should have all access rights.

I found hints that this can be caused when script is run as normal user, but is run as root. Pin has no dual function, so it should also not be a configuration issue.

Any hints what can cause this error?


Viewing all articles
Browse latest Browse all 14040

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>