Developer

FPV setup with raspberry Pi

3689553118?profile=original

After much chasing, and testing, I have found this to be an efficient way of getting low latency high quality HD video out of an Aircraft. The latency is around 0.4 seconds at worst which would be OK for an FPV with an APM doing the hard work.

I will continue to search for methods to drop the latency down further, but this is a lot better than the 6-12 seconds I was getting on my first attempts.

Any comment (with useful instructions) would be appreciated.

For the wireless link, I am using two UBIQUITY ROCKET M 900 with Australian ACMA approved firmware, at the base station, I am using a tracking (yet to built the tracker...) 1.5 meter long X and Y polarised Yagi, and on the plane, two RF Design flexible strip antennas, placed at right angles to each other.

but how you do that bit is up to you.....

the critical bit is getting the Raspberry Pi's to chat to each other.

I have tried to make this as user friendly as possible... good luck.

 

Setting up IP video for Raspberry Pi 1080p video (FPV)

 

You will need 2 B model Raspberry Pi's and 1 Pi Camera. (Element 14, or RS components)

Preparing your Raspberry Pi for first boot…

 

Follow the instructions at http://www.raspberrypi.org/wp-content/uploads/2012/04/quick-start-guide-v2_1.pdf

Install the prepared SD card in the Pi and boot.

Setting up your Pi

Connect the Pi to your router with a network cable.

On Start-up it will resize the FAT partition and present you with a menu.

Set your language, and keyboard layout.

Select Raspbian… then click install.

After this has extracted (will take a while….) it will reboot into the configuration screen (again will take a while for this first boot.)

The important things to change here are

  1. Enable the camera
  2. In advance options…..
    1. Set the host name (camera, for the camera end, receiver, for the viewing end)
    2. Memory split, set the memory for the GPU to 256
    3. Enable SSH ( will come in handy later, as you may need to talk to the Pi in the air.....

Then finish and reboot.

First login

Username: pi

Password: raspberry

Setting up the required programs for video streaming

 

Install the dependencies by running the following in a terminal:

sudo apt-get install mplayer netcat

cd /opt/vc/src/hello_pi

make –C libs/ilclient

make –C libs/vgfont

cd /opt/vc/src/hello_pi/hello_video

make

cd ~

Now repeat this for the other Pi….

 

Streaming…

First set up the receiver….

Ensure the receiver is connected to your network and run

ifconfig

after you press enter, you can find your ip Address.  Note this down.

Then run the following.

mkfifo buffer

nc -p 5001 -l > buffer | /opt/vc/src/hello_pi/hello_video/hello_video.bin buffer

the Pi will now wait for the feed.

On the Camera Pi

Ensure camera is connected to the Pi

Ensure Pi is connected to the network (you can confirm this with ifconfig)

(see instructions at http://www.raspberrypi.org/camera for how to connect the camera)

 

 

In the following command, replace the ip address with the one you just noted down.

raspivid -t 0 -fps 15 -o - | nc 192.168.1.85 5001

if all goes well you should be streaming 1080P video at 15fps with less than 0.5seconds of delay..

now add your wireless bridge between the two, and away you go J

This information has come from the Raspberry Pi foundation website, and other sources, tested and proven by myself..

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • @Sirius, I have a very similar setup to the link you have posted (project (http://uavmatrix.com/Blog/38 ). But I am using a Ubiquity NanoBeam (5.8ghz). This is a high-gain dish antenna mounted to a tracker. On the UAV it's a high-power (500mW) WiFi usb adapter plugged into rasperry PI.  With this setup I can get 15km range. I have not used the 900mhz equipment, but it should work, however you may still need a tracker to get long range.

  • @Sirius, it's possible to send the PPM signal over the wifi link, however this is not the normal configuration. To do it, you would need to encode the PPM, insert it in the data uplink stream, and then decode it in the Raspberry PI, and then send it to the flight controller. I don't know if anybody is actually doing this. There are USB dongles available that encode the PPM on a PC, but you would need to write some code to run on the Raspberry PI to generate the PPM stream on the UAV.  I don't know if anybody has a codebase that will do this, but you might try a google search. 

    The setup I use has two radios, one for the video/telemetry and one from the control radio. For the video link I use 5.8ghz wifi, and the radio is 2.4 ghz. To extend the range, I use a wifi-booster attached to the back of my radio. I get 5+ miles range with both the 5.8ghz and 2.4ghz.  

    If you want to use a single uplink/downlink, you have to make sure the PPM signal is very reliable over your data stream, and that you don't get dropouts. The decoder would also have to be smart, because if there is a dropout, it would need to remember the last 'valid' signal sent, and simulate a failsafe so that the UAV would initiate it's failsafe routine. This is a bit of work and would require a fair amount of testing. For this reason, I just use two links, and use a booster and it works very well out to at least 5 miles. 

  • Hi there, regarding the hardware aspects, I Have two questions:

    Instead of using a RC receiver to send signals to the PPM input of the Navio you send these signals directly from the Raspberry Pi?

    Instead of using a 3DR Radio to send signals to the Telemetry input of the Navio you send these signals directly from the Raspberry Pi?

    Through what ports/connections of the Navio you send the telemetry and PPM signals?

  • Cut out the PI 

    Here is the video:https://www.youtube.com/watch?v=RdHIohydwYE

  • @Christian, that's awesome. Great idea.

  • Hi Patrick,

    might be of interesst for you: We now have an Android App working.

    As everyone has a smartphone nowadays, that is a cheap way to build some DIY fullHD Goggles.

    http://www.rcgroups.com/forums/showthread.php?t=2281169

    Kind regards Christian

  • @Richard Hale,  I have telemetry working, but I am using a Serial-to-Ethernet adapter. My plans are to replace it with the Rasperry PI mavlink using UDP. This is the preferred method over TCP/IP. 

  • hi very interested in this blog

    im doing similar project on my skywalker x8

    with m5 wisp and nanostation but will be changing to the r5ac lite rockets for increased bandwidth.

    mx27 video encoder unit

    but struggling with udp telemetry link to apm planner 2.

    have you this working ????

     

  • Looks Great Patrick!

  • Here's a photos of my rig (Hobby King Go Discover), with the Raspberry PI and the Rocket M5 transmitter. This is a full HD setup. I'll be posting a blog in the next few days on how to do the complete build using the PI and GStreamer on  windows PC.

    3689618661?profile=original

This reply was deleted.