Bikram
Bikram

Reputation: 98

Beaglebone GPIO "RuntimeError: Failed to add edge detection"

I am getting "RuntimeError: Failed to add edge detection" when trying to run the following on a BeagleBone running Ubuntu 13.10

import Adafruit_BBIO.GPIO as GPIO
def onGPIOEvent(channel):
    print "event detected!"
GPIO.setup("P9_28", GPIO.IN)
GPIO.add_event_detect("P9_28", GPIO.RISING, callback=onGPIOEvent, bouncetime=300)

Please help.

Upvotes: 2

Views: 1903

Answers (2)

Bikram
Bikram

Reputation: 98

Figured out the problem. I had to run this with sudo privilege..

Upvotes: 2

Kelei
Kelei

Reputation: 11

The pin P9_28 does NOT have a GPIO option to it. Try another pin such as P9_30 and see if you still get the same error.

Upvotes: -1

Related Questions