Pinpong irq not working

Hello,
I have used the pinpong lib to turn on and off the IO and that works good.
Now I trying to use a Lora module sx1278 and would like to use the interrupt to know when a new message is received.

I found this example and have tried to use that on GP22 and GP16:

I get following error:
Traceback (most recent call last):
File “/root/interrupt.py”, line 20, in
btn.irq(trigger=Pin.IRQ_FALLING, handler=btn_falling_handler)
File “/usr/lib/python3.9/site-packages/pinpong/board.py”, line 339, in irq
self.obj.irq(trigger, handler)
File “/usr/lib/python3.9/site-packages/pinpong/board.py”, line 266, in irq
self.board.res"irq"
File “/usr/lib/python3.9/site-packages/pinpong/extension/milkvDuo.py”, line 144, in irq
gpio_fd = os.open(“/sys/class/gpio/gpio508/value”, os.O_RDONLY)
FileNotFoundError: [Errno 2] No such file or directory: ‘/sys/class/gpio/gpio508/value’

I have checked and I do not have any gpio508.

Not sure if I have missed something important or if this is expected?

Usually, what you’re showing means you haven’t switched the pin to the right mode.

In my case, the snippet you referenced here doesn’t produce error messages.
Moreover, it immediately reported

--falling---
pin =  0

Which pins are you using in your code, and what are their pin multiplexing settings?
Can check with duo-pinmux -r and change with duo-pinmux -w:

[root@milkv-duo]~# for pinID in 16 25; do duo-pinmux -r "GP$pinID"; done;
GP16 function:
[ ] SPINOR_MISO
[ ] SPINAND_MISO
[v] GP16

register: 0x300103c
value: 3
GP25 function:
[v] GP25
[ ] IIS1_DI
[ ] IIS2_DO
[ ] IIS1_DO

register: 0x300112c
value: 3

Thanks for the answer @hannahKobain :slight_smile:
You are correct that the example code works, I did not even try to use GP0 that the example was using :blush:
But I still have issues with using the other GPIOs

Yes, I using pinmux as you describe to secure the pin functionality.

[root@milkv-duo]~# for pinID in 0 1 16 22; do duo-pinmux -r “GP$pinID”; done;
GP0 function:
JTAG_TDI
UART1_TX
UART2_TX
[v] GP0
IIC0_SCL
WG0_D0
DBG_10

register: 0x300104c
value: 3
GP1 function:
JTAG_TDO
UART1_RX
UART2_RX
[v] GP1
IIC0_SDA
WG0_D1
WG1_D0
DBG_11

register: 0x3001050
value: 3
GP16 function:
SPINOR_MISO
SPINAND_MISO
[v] GP16

register: 0x300103c
value: 3
GP22 function:
PWR_SEQ2
[v] GP22

register: 0x3001068
value: 3

When using GP0 as in the example the gpio508 is created so I don’t get the error message anymore after that.
But… I have not tested all GPIOs but I only getting it to work on GP0. When changing “btn = Pin(Pin.D0, Pin.IN)” to let say “btn = Pin(Pin.D1, Pin.IN)” it is still using GP0 for the interrupt and not GP1 but [print("pin = ", pin] prints “pin = 1”.

So I only getting irq to working on GP0 and when trying to use another GPIO it is still using GP0 to listen for an interrupt signal.

I don’t know but I guess it has something to do with the creation of gpio508 and gpio508 configruation?