Menu

#118 GPIO.add_event_detect gives runtime error

Fixed
None
High
Defect
2016-01-04
2015-11-29
No

Hi Ben,

I don't know whether you're aware of this, but it seems that when running in non-sudo mode RPi.GPIO frequently gives RuntimeError: Failed to add edge detection. It doesn't happen if you sudo the python script and it seems to be common to both python2 and python3. Seems to be with the latest versions of Raspbian Jessie on BCM2835 platforms, not seen it yet on a Pi2. If there's anything else you need to know, let me know.

Cheers, Neil

Related

Tickets: #118

Discussion

  • Ben Croston

    Ben Croston - 2016-01-01
    • status: New --> Started
     
  • Ben Croston

    Ben Croston - 2016-01-01

    This is caused by the time udev takes to change the permissions/owenership on /sys/class/gpio/ files for unprivileged users. At the moment, there is an arbitury delay of 50ms to wait for this to happen - this does not seem to be the right approach.

     
  • Matthew Lewis

    Matthew Lewis - 2016-01-01

    Just encountered this error - my experience is that it works then fails then works then fails etc. Works 100% of the time when running as root. I tryied putting a delay of 100ms between initialisation and invoking add_event_detect but still get the error every other invocation.

     
  • Ben Croston

    Ben Croston - 2016-01-01

    Fix is in source code library (available for testing by manually installing development version). Will be in next release.

     
    • Neil Matthews

      Neil Matthews - 2016-01-01

      Thanks, Ben & Happy New Year.

      On 01/01/2016 18:03, Ben Croston wrote:

      Fix is in source code library (available for testing by manually
      installing development version). Will be in next release.


      [tickets:#118]
      http://sourceforge.net/p/raspberry-gpio-python/tickets/118/
      GPIO.add_event_detect gives runtime error

      Status: Started
      Created: Sun Nov 29, 2015 12:43 AM UTC by Neil Matthews
      Last Updated: Fri Jan 01, 2016 05:48 PM UTC
      Owner: Ben Croston

      Hi Ben,

      I don't know whether you're aware of this, but it seems that when
      running in non-sudo mode RPi.GPIO frequently gives RuntimeError:
      Failed to add edge detection. It doesn't happen if you sudo the python
      script and it seems to be common to both python2 and python3. Seems to
      be with the latest versions of Raspbian Jessie on BCM2835 platforms,
      not seen it yet on a Pi2. If there's anything else you need to know,
      let me know.

      Cheers, Neil


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/raspberry-gpio-python/tickets/118/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      Neil Matthews in Impington, Cambridge, UK


      This email has been checked for viruses by Avast antivirus software.
      https://www.avast.com/antivirus

       

      Related

      Tickets: #118

  • Ben Croston

    Ben Croston - 2016-01-03
    • status: Started --> Fixed
     
    • Neil Matthews

      Neil Matthews - 2016-01-04

      Hi Ben,

      Any idea how long before it appears in the archives? Apt-get update &
      apt-get upgrade still says that 0.6.0a3 is the latest.

      Cheers,

      Neil

      On 03/01/2016 15:54, Ben Croston wrote:

      • status: Started --> Fixed

      [tickets:#118]
      http://sourceforge.net/p/raspberry-gpio-python/tickets/118/
      GPIO.add_event_detect gives runtime error

      Status: Fixed
      Created: Sun Nov 29, 2015 12:43 AM UTC by Neil Matthews
      Last Updated: Fri Jan 01, 2016 06:03 PM UTC
      Owner: Ben Croston

      Hi Ben,

      I don't know whether you're aware of this, but it seems that when
      running in non-sudo mode RPi.GPIO frequently gives RuntimeError:
      Failed to add edge detection. It doesn't happen if you sudo the python
      script and it seems to be common to both python2 and python3. Seems to
      be with the latest versions of Raspbian Jessie on BCM2835 platforms,
      not seen it yet on a Pi2. If there's anything else you need to know,
      let me know.

      Cheers, Neil


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/raspberry-gpio-python/tickets/118/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      Neil Matthews in Impington, Cambridge, UK


      This email has been checked for viruses by Avast antivirus software.
      https://www.avast.com/antivirus

       

      Related

      Tickets: #118

  • Ben Croston

    Ben Croston - 2016-01-04

    Neil,

    I haven't got a clue when it will be available in the archives. I asked the Foundation to update it at 6pm (ish) last night. In the past, I have known as fast as a 1 hour turnaround and as slow as a 1 week turnaround. You can always pester them on Twitter!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.