The user sees the error message "Error #3 waiting for edge" after wait_for_edge() has been called a large number of times. (Reports indicate somewhere under 1024 times.)
I've read older related closed issues on here ([#38] and [#39]) and Google Code, and it looks like this commit introduced the changes that lead to the C code being unable to open the "/sys/class/gpio/gpio*/value" file for input. open_value_file in event_gpio.c is where the bug surfaces.
I am really rusty with my C code, but I did observe some things.
When the bug occurs, I can fire up a second instance of my code and not see the bug until the requisite number of calls has happened, so the limit is not something at the OS level; it's within a given session of the program that uses the GPIO library.
I tried some simple timing tests. I made each wait_for_edge() call after a delay, and this didn't fix the bug. Similarly, I tried a timeout and retry to re-open the GPIO file, but this didn't help, either.
This was tested against release 0.5.6, but I've tested it in 0.5.5 as well.
I am unable to reproduce the issue in 0.5.4. Anyone else having this issue should try 0.5.4 as well.
I did some further testing. My previous tests have been with python 2.7, which show that v0.5.4 doesn't have the bug, but v0.5.5 and v0.5.6 do. With python 3.2, I can reproduce the bug in version 0.5.4 as well.
I will submit a unit test patch that 1) reproduces the bug in this report, and 2) works with python 2.x and 3.x.
I finished testing versions 0.5.4, 0.5.5, and 0.5.6 against python 2.7 and python 3.2. All combinations exhibit the bug except 0.5.4 x 2.7. For some reason, it works perfectly.
See https://sourceforge.net/p/raspberry-gpio-python/code/merge-requests/1/ for a merge request that adds the ability to test for this issue in your default testing environment.
I might have fixed it in the latest development version - I have just introduced a unit test for lots of edges that passes. Could you test the development version in the source code library to see if it fixes your problems.
I will add your test to the unit test script. Hopefully I will release 0.5.7 in the next few da.
Ben
On 4 September 2014 19:16:20 GMT+01:00, human-being human-being@users.sf.net wrote:
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Related
Tickets:
#38Tickets:
#39Tickets:
#72Cool. Just to be clear, do you mean for me to test in default/tip? Looks like 7/28 was the latest commit there.
In a mini version of the test, it fails before doing edge detection:
I noticed the same error when trying the bleeding edge version in my project. I assumed I deserved what I got for not using a release :)
This should be fixed in release 0.5.7 - please confirm!
I am unable to test because there's a new bug blocking this one, as I reported earlier:
RuntimeError: Conflicting edge detection events already exists for this GPIO channel
If you grab my merge request, it includes a test for this issue. You'll see where it fails.
I'll take another look - thanks for keeping me informed!
Ben Croston
On 15 September 2014 23:53:55 GMT+01:00, human-being human-being@users.sf.net wrote:
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Related
Tickets:
#38Tickets:
#39Tickets:
#72Hello,
I'm wondering if this issue have been addressed and will be fixed on the next version?
I just got my new Raspberry Pi and been having this issue with Version 0.5.7
I'm still experiencing this error in version 0.5.7.
If i try to fall wait_for_edge more than one (like the example below) time i get the error "RuntimeError: Conflicting edge detection events already exists for this GPIO channel".
GPIO.wait_for_edge(24, GPIO.FALLING)
time.sleep(1)
GPIO.wait_for_edge(24, GPIO.RISING)
The 'Conflicting edge' exception is a new issue and I have opened a new ticket here -->
https://sourceforge.net/p/raspberry-gpio-python/tickets/78
I think it's confusing that this is marked Fixed, since the issue in #78 blocks the ability to test #72. You may get fewer queries about #72 if it's re-opened.
A fix for issue 78 is now available. To install it so that you can test:
$ sudo apt-get install python-dev python3-dev
$ sudo apt-get install mercurial
$ sudo apt-get install python-pip python3-pip
$ sudo apt-get remove python-rpi.gpio python3-rpi.gpio
$ sudo pip install -e hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO
$ sudo pip-3.2 install -e hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO
To uninstall it and return to the latest release in Raspbian:
$ sudo pip uninstall RPi.GPIO
$ sudo pip-3.2 uninstall RPi.GPIO
$ sudo apt-get install python-rpi-gpio python3-rpi.gpio