Using APSync to Build a Long Range Digital Video Link

In this post I will detail how to configure a digital video link using APSync on a Raspberry Pi, a Micohard radio, and a Runcam camera.


APSync is a great new project that aims to standardize companion computer development. The way it works is by providing a software image for a variety of computers (Raspberry Pi, Intel Edison, and NVidia TX1). It comes with a number of features, including video manager and dataflash logger. Telemetry is also passed through the digital link, so the a lot of extra hardware like the telemetry radio, OSD, and analog video transmitters are done away with. 

We need to turn off the hotspot in order use the Microhard link. 

nmcli connection modify WiFiAP connection.autoconnect no

We also need to modify the apsync/start_cmavnode/cmavnode.conf file to broadcast to the new gateway address. Change it so it looks like this:







Now we need to change the gstreamer command to pipe the video from the Runcam to the network. This is located in the apsync/start_cherrypy/start_udp_stream file. Comment out the old one and replace it with this. 

gst-launch-1.0 v4l2src device=/dev/video2 ! videoscale ! video/x-raw,width=640,height=480,framerate=30/1 ! queue ! videoconvert ! omxh264enc ! queue ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=$STREAM_TO_IP port=$STREAM_TO_PORT sync=false

This works with a Mobius and a Runcam, but the Runcam has a slightly lower latency. 

Record the Raspberry Pi IP address by entering ifconfig.

Restart everything and open a webpage on your GCS. Navigate to the Raspberry Pi address, port 8000. Mine is You should be presented with the APSync Configuration webpage. Click 'Start Streaming to GCS' to enable the video stream. The last step is to capture that stream and to display it on the GCS. 

gst-launch-1.0 udpsrc port=5600, buffer-size=0  ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! queue ! decodebin ! autovideosink sync=false

If a video window does not appear within a few seconds , type in cat /tmp/streaming.stderr.

Now open Mission Planner and connect over UDP on port 14550. Congratulations, you should now have a digital link for video and telemetry!

This project demonstrates the usefulness of APSync, and I look forward to its continued development.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


This reply was deleted.