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

  • I use the AWUS036NHR V2 2000mW model....

  • Why the AWUS036NH instead of the AWUS036H? Most of the reviews Ive say the H model has better range than the NH model.

  • Tommy Larsen, this is just funny for anyone who work with RF :) "Power king" meter from Youtube is funny too.

    Even if you don't understand anything in RF technology, you can disassemble your "99W Wi-Fi adapter" and check out datasheet for output amplifier IC.

    2W output from cheap plastic adapter powered by USB - its fantastic for "backtrack DIY WiFi hacking" kids, but for our real tasks (such as HD FPV) its totally useless.

    If you don't believe me, you always can try! This adapter have 2W of output power and fantastic sensitivity (-92 dBm) in 802.11b mode (it's enough for 5 mbit/s FullHD). So you can use short whip antennas (2 dB) on ground and same on your RC model and get 25 km of range! And with small 12 dBi antenna on ground, you will get about 80 km LOS range. What a great solution!

  • Couple working notes on telemetry, if anyone else is trying to setup an RPi OSD:

    • The DJI NAZA GPS module communicates with the main unit via a 115200 baud serial link with a comms format that's now fairly well understood; I'd say it just needs to be interfaced to the RPi via the appropriate hardware (it may be as simple as wiring it straight to the GPIO serial pins if the voltage levels are right). Then a bit of code to pull in the GPS/Compass info and send it down to the ground station.
    • For voltage/current sensing, the 90A RCTimer Voltage & Current Sensor will probably do the job; it presents the measured voltage and current as two 3.3V-level outputs that can be fed into an ADC. The MCP3008 ADC should be able to take that and present it to the RPi; its use is fairly well documented, just needs a little wiring together.
    • Then it's a matter of writing code to poll all of these inputs, package them up and send them down to the ground station in an appropriate format. The ground station can then parse that, perhaps add some logic like a home bearing implementation, and present it onscreen, perhaps via a Python script that coordinates GStreamer to receive the HD video and applies some text overlays.
    • The plus with doing it like this is you can write code to do anything you like with the data, including generating GPS traces and plotting them on a map.
  • Ok, i think you got a fake adapter.

    https://www.youtube.com/watch?v=lm-147XPpSM

  • There is no alfa adapters with more than 0.2W of output power ;) Just measured all of them (original from taiwan)

  • Rocket M5 says also 0.5kg in the datasheet... I'm working on a solution with Alfa 2000mw adapters and Cloverleaf or similar.

  • Uh - That's the weight of the Ubiquiti Rocket M-900 that I'm wondering about =)

  • Great work with this stuff, Patrick. I'm really interested in the penetration of the M-900's, but the product pages listing these have their weight at 0.5kg! Any chance you can tell us the weight of one of these without the case on?

  • Real possible delay is 0.1 - 0.2 sec. 0.5-1-2 sec delay is from wrong tuned software (useless cache etc)

This reply was deleted.