Navio2 using servo rail as GPIO with python RPI.GPIO library

Hi all,
I am using a navio2 board attached to my Pi3 and I’m wanting to use the servo rail as Gpio ports, I can export them through the method explained in the docs (echo 501 > /sys/class/gpio/export) and that works fine and I can use them through terminal but I am wanting to control these pins with a python program so I can use wait_for_edge().
When I use the RPI.GPIO library though I can’t find which pin number I should use with the configuration that library uses, as using the 501 pins like below:

Causes: ValueError: The channel sent is invalid on a Raspberry Pi
And the only mode for pins I can find seem to be BCM or BOARD which don’t support the Navio2 pin numbering method
Is there some other mode I should use to manage the servo rail within Python or is another library better suited?

Thanks for any help

Hi Max,

Thanks for your patience!

Pin 501 is the pin of the RCIO kernel module and not the native Raspberry Pi’s GPIO. This message appears because the numbers for GPIO ports on the servo rail are out of range for this library.

You can use the sysfs interface to work with the servo rail pins as GPIO. As I understand, the wait_for_edge() function blocks the execution of your program until an edge is detected. Instead, you can use the edge attribute in the sysfs interface to request interrupts to change the state of the processor.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.