According to “https://docs.emlid.com/navio2/dev/pinout/”, IO17 and IO18 pins on UART are available. i am trying to install a turn-off switch using IO17 as shown below.
In addition, i am using the following python script on RPI4-8GB with navio2 and latest image as shown below to utilizer IO17 for ON/OFF switch.
In the end regardless if the button is physically connected to IO17 via UART or not, running the python script immediately shuts down the RPI. Please help me understand the following below.
- what is correct way to utilizes free gpio 17 and gpio 18 that are available on UART?
- Are there any setting that needs to changed in navio2 or in GCS (Mission Planner) before these free pins can be used?
- Where do i find the documentation on how to use free GPIO pins available on Navio2 UART Connector?
- Why does RPI shutdown as result of executing the provided python script?
- How do i fix this shutdown problem ?
i look forward to your feedback/answers. Thank you
I’d recommend using the PWM outputs for such a purpose. You can operate the servo rail pins the same way as GPIO as described in Navio2 docs.
i perfectly understand that its a option but i am using those PWN outputs for few other things. i would rather utilize IO17 or IO18 for OFF Switch via UART as its available. i look forward to hear more on this. thanks
The number of IO17 GPIO should be 14 instead of 11. You can check the full list of pin numbers in this docs entry.
Please try changing the pin number to 14 in your script.
I tried changing to pin 14 in script and it did not work. it gave me the following error.
in addition, according to you documentation,
You need to specify RELAY_PIN parameter in Full Parameter List in Mission Planner or in Parameters in QGC. Use the following table for this
How do we change our Full Parameter List in Mission Planner to match this?
We would greatly appreciate it if you could please clarify on how we could use these free GPIO pins.
Please and thank you.
I am having similar problem :
I used: (https://docs.emlid.com/navio2/dev/pwm-output/)
echo N > /sys/class/gpio/export
where, N= 500+header_pin_number-1
-it says this should allow us to control those pins.
pigpio - pigs utility like: (https://elinux.org/RPi_GPIO_Code_Samples#Shell)
pigs modes 4 w # set gpio4 as output (write)
pigs modes 17 w # set gpio17 as output (write)
pigs modes 23 r # set gpio23 as input (read)
pigs modes 24 0 # set gpio24 as ALT0
For this, it needs pigpio library installed and some other steps available on internet. However inorder to start running these commands it needs “sudo pigpiod” enabled.
- I set pin to output and set it to 1 to see if it worked. Its still not outputting 5V.
–> I am probably missing same thing as you. Those RELAY_PIN stuffs on mission planner.
If anyone could help, that would be awesome. Thanks
i understand your frustration because its not clear anywhere how gpio stuff is setup specially for navio2. i did found a temporary work around for this that might work for you as well. Please follow steps below in sequence
- update Wiring Pi to 2.52 using the link below.
- use the command “gpio readall” to get an idea of physical pins on pi vs wpi pins.
use the “gpio mode wPi# in/out/alt0” to change mode. for example physical pin 11 on pi corresponds to 0 on wPi so then command will be “gpio mode 0 in”.
you can also change the value(V) using this command “gpio write 0 1” and that should change V = 1 on physical pin 11.
lastly, the link below provides more information on how to use other commands. i hope this helps until emlid/navio2 people can provide some answers.
I appreciate your help. I will try it out.
Thanks for your patience!
To set up a RELAY_PIN parameter in the Mission Planner, you should be able to change its Option to the pin number. In this case, you will need to insert 14. More details on relay configurations you can find in Mission Planner docs.
I’m afraid I can’t be of much help with the script specifics. However, you can refer to the Navio2 docs for all information about the relay configuration.
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.