I thought I share some details on my current software setup with Navio 2:
The hardware:
The drone: A custom built quad with Navio 2, RPi 3, RPi Camera v1.3, Huawei e8278 modem
See here for more details: Navio 2 build and first flights!
Server: Free azure website, running windows, IIS, C#, ASP.Net
Ground Station: Normal Windows 10 PC.
First, to get it all connected the ground station need its own public internet IP. This is not always so easy. When using my laptop outside, I use a 4G modem with a special “APN” that is specific to my mobile provider. This APN gives me a unique internet IP that is not shared with others.
In my setup I’ve written a simple Python3 script that runs on the RPi at startup. It is never ending and periodically makes a HTTP query to a webserver (running on Azure). The webserver holds a queue of commands that the drone receives, like starting and stopping Arducopter, GStreamer, take a still photo etc. The scripts also make a HTTP query to the onboard modem for GSM connection details. I found out that most Huawai modems have a web API that you can call to get a XML document with connection details. This data is uploaded to the webserver. The drone is also able to upload photos to the server.
On the Ground Station PC I’m running a small C# program that is in contact with the webserver. It is able to upload commands to the webserver and enables me to easily start and stop functions with a simple button. The program gets the Ground station IP from the webserver, and use that to send the correct command for starting GStreamer so that the drone streams directly to the PC.
To start it all, I simply start the local control program, and turn on the drone. After about 10sec, they are connected and I start Arducopter with a click, then I can start the video with another click.
With Rpi3 and Navio2 I’m able to get really good and glitch free video, and the video latency is around 200ms with a 4G connection.
I’m happy to share the code, but at the moment I have not added any password protection on the drone or webserver, so anyone that knows the address of my webserver, could take over my drone
Once I’ve added some security to it I’ll publish the code if anyone is interested.
The GStreamer parameters I’m using:
High _lastVideoMode = "raspivid -n -t 0 -rot 180 -w 960 -h 720 -fps 30 -b 2000000 -co 60 -sh 30 -sa 10 -o - | gst-launch-1.0 -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=" + _localAddress + " port=5000";
Med _lastVideoMode = "raspivid -n -t 0 -rot 180 -w 640 -h 480 -fps 30 -b 600000 -co 60 -sh 40 -sa 10 -o - | gst-launch-1.0 -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=" + _localAddress + " port=5000";
Low _lastVideoMode = "raspivid -n -t 0 -rot 180 -w 320 -h 240 -fps 30 -b 250000 -co 60 -sh 50 -sa 10 -o - | gst-launch-1.0 -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=" + _localAddress + " port=5000";
More details will follow!