Using navio2 servo rail, MP to activate scripts


I am working on a RPi3b+/Navio2 drone and I would like to activate (from long range) a python script saved on the Pi. I have bi-directional radio telemetry module on the drone and on my laptop and I have Mission Planner set up. I was thinking to use MP’s mission command DO_SET_SERVO on a certain servo rail pin, and then configure that pin to operate as a GPIO (input pin), and have a code (which will always be running) that will listen for PWM input on that pin to initialize a certain python script that is saved on the RPi itself. Is this doable? I am quite new to electronics and such. Thank you very much for your help.

Hi Jon,

I believe this workflow should work. However, we haven’t tested this setup so I can’t be much of a help with it.

You can use any GPIO to read PWM. There’s a library for Raspberry Pi called pigpio – it can sample GPIOs with the resolution of 1 microsecond.

1 Like