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:

[to_14550]

     type=udpbcast

     sim_enable=false

     bcastport=14550

     bcastip=192.168.168.255

     bcastlock=1

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 192.168.168.174:8000. 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.

Views: 2085


Moderator
Comment by Vladimir "Lazy" Khudyakov on April 10, 2017 at 11:34am

Is it possible to do same with Ubiquiti  Bullet?


Developer
Comment by Ryan Beall on April 10, 2017 at 11:44am

Is this using the nVIP2400?

Comment by Kieran on April 10, 2017 at 12:01pm

@Vladimir I have not tested it with any other networking gear, but it should work with Ubiquiti gear.

@Ryan this is using the pDDL2450 Dev Kit.

Comment by Rana on April 10, 2017 at 4:35pm

Thanks for this post. pDDL2450 Dev Kit might be quite costly.

Microhard: pDDL Development Kit

Are you using this one ?

Comment by Ravi on April 10, 2017 at 5:40pm

would it be possible for you to share the image for Raspberry Pi 2 pr Pi 3  configured for microhard modem for Tx side and Rx side.

Comment by Kieran on April 11, 2017 at 12:03pm

@Rana Yes I am using the first image. It is quite costly, and we have heard of potential quality control issues with Microhard. We are going to test out some Ubiquiti radios, although they are quite large.


Developer
Comment by Randy on April 11, 2017 at 6:38pm

Some useful links for people related to ApSync:

wiki: http://ardupilot.org/dev/docs/apsync-intro.html

gitter chat: https://gitter.im/ArduPilot/companion

support discussion: http://discuss.ardupilot.org/c/apsync-companion-computers

If you're a developer interested in helping us develop APSync (it's all open source of course), please join us on the gitter chat above, thanks!

Comment by Jonathan on April 15, 2017 at 10:01am

How much does the development kit cost for the microhard radio?  

Comment by FernRF on April 17, 2017 at 3:48am

APSync might theoretically be used with a two-version version of the software for this project:

http://diydrones.com/profiles/blogs/new-fpv-option-fpv-hat-for-rasp...

We have been working on a two-way version of the software for the FPV HAT but have paused it in order to develop other features. At some point we'll get back to working on the two-way version, but until then, if anybody feels like working on a two-way version, the FPV HAT might be a affordable radio platform for ApSync...

@Kieran: What kind of latency do you get with the Runcam camera streaming via the Pi?

Comment by Kieran on April 18, 2017 at 11:02am

@ Johnathan. The price is $1000 USD. The Ubiquiti Radio might be a cheaper solution.

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2017   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service