Question
Edge detection callback fails silently after upgrading RPi.GPIO to 0.7+
Ash River
0 reputation · 06 Jun 2025, 11:08 UTC
96.4K views0
Context
An existing Python script uses RPi.GPIO edge detection callbacks to monitor a button press on GPIO 17 (BCM). After upgrading the library from 0.6.x to 0.7.1, the callback function no longer executes when the button is pressed, even though the script starts without errors and the pin reads correctly via polling.
Goal
Determine why the falling-edge callback registered with GPIO.add_event_detect() stops firing under RPi.GPIO 0.7+ while the same code worked on 0.6.x.
Constraints and uncertainty
- The script sets
GPIO.setmode(GPIO.BCM)and configures the pin as input with pull-up. - No exception is raised during
add_event_detect()oradd_event_callback(). - Changelogs mention internal threading changes in 0.7 but do not detail callback signature requirements.
- Downgrading restores functionality, confirming the hardware and wiring are correct.
Questions
- Does RPi.GPIO 0.7+ require a different callback signature or explicit thread-safety handling for edge callbacks?
- Is there a documented migration step for
add_event_callbackthat was omitted from the release notes? - Can the callback be made to work without reverting to polling or downgrading the library?