RISING and FALLING behave like BOTH
A Python module to control the GPIO on a Raspberry Pi
Brought to you by:
croston
When configuring edge detection using GPIO.add_event_detect(), FALLING and RISING behave like BOTH, i.e. they detect both rising and falling edges. Example code (reproduces the bug with NOOBS 1.3.10/GPIO 0.5.6):
GPIO.setmode(GPIO.BOARD)
GPIO.setup(8, GPIO.IN)
GPIO.add_event_detect(8, GPIO.FALLING, callback=..., bouncetime=100)
This bug is also discussed here: http://www.raspberrypi.org/forums/viewtopic.php?f=32&t=59457
Let me know if I can help and/or provide more info.
Can still reproduce with GPIO 0.5.7.
Can still reproduce with GPIO 0.5.9. I should also clarify: RISING always behaves like BOTH, while FALLING sometimes does, and sometimes doesn't. It produces "runs" of either effective mode, i.e. for a few seconds it works like BOTH, then for the next few seconds it works correctly.
This happens on the B and B+. Am I the only one who noticed this?
On some forums others have the same problem.
BTW, it happens both when using add_event_detect and wait_for_edge.
Last edit: Jörg Zieren 2015-04-23
Interestingly, with RPIO this problem does not happen.
https://pythonhosted.org/RPIO/rpio_py.html
I actually just put in a ticket for this as well, I'm seeing the same thing on version 0.6.0a3
https://sourceforge.net/p/raspberry-gpio-python/tickets/121/
Merged into issue 121