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

  • Hi Michael,

    It's easiest to configure both rockets on a PC, with both rockets connected to a router.  Once the Rockets are connected, you should be able to unplug your "Air" rocket, connect your RPI (make sure IP is configured correctly on RPI), power up your "Air" rocket, and it should automatically reconnect to your "Ground" rocket and all should be good.  I'll try and get some screen shots posted this evening.

  • yeah - some pics would be handy Patrick.

    did you configure both rockets on a pc/mac/ other 'full size' computer rather than the Rpi.  I'm puzzled why my pi couldn't access the AirOS page.

  • I have my ubiquiti gear setup as a WDS transparent bridge

     

    Air:

    I have the rocket on my quad setup as "Station" with an IP of 192.168.1.80, the RPI on my quad is then connected to my rocket via Ethernet (saves the hassle of connecting RPI via wireless, and GREATLY reduced latency) with a static IP of 192.168.1.105. 

     

    Ground:

    I have the rocket on the ground setup as "Access Point" with an IP of 192.168.1.81.  This is connected to a small 4-port router along with my ground station computer which is setup with a static IP of 192.168.1.104. 

     

    Your best bet is to get your bridge functioning correctly.  Once that is done and you can ping both rockets from your ground station computer you are pretty much set; setup your RPI with a static IP on the same subnet and away you go. 

     

    If you are still having trouble I will capture some screen shots tonight; finally went UHF on my new quad so moved to 2.4ghz ubiquiti gear and need to get this setup tonight so can provide you with some fresh screen shots..

     

     

  • Wondering whether anyone else has had difficulty configuring the Ubiquiti rocket via the AirOS from their Rpi?

    I've set up the ground based rocket using a PC at 192.168.1.20 without a problem. However, as the Rpi will be flown and the second rocket will be connected to it, I presume that the config is best done with these two devices connected.

    I have normal internet access working fine on the Rpi via wifi connection..

    Seems I have also been issued with a defective power cord for the Ubiquiti PoE adapter as well - a separate issue but did obviously contributed to difficulty last night.  This situation did not improve when the cord was swapped with the one used for the 'ground radio' end. 

    The airside rocket will connect to the AirOS if plugged into my PC laptop.  Is there something about Rpi (or linux) that will trip over that particular AirOS website.

    ???

  • Did a range check today with two AWUS036NH radios at ground level and had a great connection all the way at the other side of my flying field which is about 365 meters. Started with 1280x720 15fps at 10 Mbps and the video was glitchy so I lowered the bitrate to 5 Mbps and it was much better. The radio on the Pi side was set for 27 db which is 500 mW.

    Now I just need to figure out how to mount everything on my hexacopter and fly it.

        

  • Just make sure you have common ground all over.

  • You beauty - just what I was hoping to see! Thanks for that, Philip.

  • Developer

    Here is a picture of my test lead... very basic...did the job3701666875?profile=original

  • No dramas - keep the smoke inside!

  • Lovely, thanks for that, Michael!

This reply was deleted.