Power & Source of Big Ideas

RPi.GPIO_NP add_event_detect() broken

Moderators: chensy, FATechsupport

i just tried the python library RPi.GPIO_NP.

Adressing the PINs is working:

Code: Select all

while True:
    print("12: {}".format(GPIO.input(12)))
    print("22: {}".format(GPIO.input(22)))

But getting the interrups, always registering pin number 11 (Linux GPIO 0), instead of given pin number:

Code: Select all

GPIO.add_event_detect(12, GPIO.BOTH, callback=measure, bouncetime=200)
GPIO.add_event_detect(22, GPIO.FALLING, callback = isr, bouncetime = 200)

- Event detection is then only working, if i connect my button to pin 11.
- Both callbacks are then triggered on pin 11.

Code: Select all

root@neo2:~# ls /sys/class/gpio/
export  gpio0  gpiochip0  gpiochip352  unexport
shows that gpio0 is exported

I think it is an issue in the RPi.GPIO_NP library. Can you fix it?


What nanopi image or RPi.GPIO_NP library are you using ?

add_event_detect() is not implemented on provided RPi.GPIO_NP by friendlyarm images. There are numerous posts in this forum about this issue.

For info, you may want to build RPi.GPIO_NP from this repo https://github.com/auto3000/RPi.GPIO_NP.

Good luck.

Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 8 guests