Page 1 of 1

RPi.GPIO_NP add_event_detect() broken

Posted: Sun Feb 25, 2018 6:07 pm
by birdie
Hello,
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)))
    time.sleep(1)


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?

Thanks
Birdie

Re: RPi.GPIO_NP add_event_detect() broken

Posted: Fri Mar 09, 2018 8:50 am
by auto3000
Hello,

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.