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

  • @ T Stock

     

    Thanks, and much appreciate the “great work”!  It’s taken a while to get to this point with everything consistent, stable, and relatively user friendly.  On the jello; I’ve actually done quite a bit of ground testing, walking the quad 100’ or more outside of my office with my screen capture running, video is perfectly smooth..  As soon as the quad is throttled up the jello begins… L  I had a VERY similar situation with my go-pro on the same quad, as soon as I moved it to my smaller, better balanced Flip FPV frame with 9” props the jello was all but gone!  I’m sure I would see a similar result with the RPI Camera.  Another problem with the RPI camera is that it is tiny and has no mass, making it more susceptible to high frequency vibrations.  I need to come up with a heavy block to hard mount the little RPI cam, and then properly isolate the heavy block, see if that helps.   I’ve also noticed that all these CMOS cameras with the rolling shutter tend to do better with smaller props spinning at a higher speed.  My test platform, has 10” props and 800Kv motors.  Have considered moving everything over to the Flip frame with the 9” props and 980kv motors, as this did help with my gopro as previously described..

     

  • I should preface that by saying "great work!" to you and the other HD FPV pioneers on this thread!!
  • I'm not sure that is jello effect in your video Patrick, it looks like video frame tearing, where the compressor doesn't have enough time to do the entire frame. This could be tested by running the system at the same distance but with motor off, ie by walking or driving the copter away, then panning around.
  • Patrick, that looks great. Would there be any real benefit to using the Ubiquiti bullet m5 on the quad side as well? What are you using to antenna track? Pololu?

  • Youtube link to my field test wasn't working, so reposting:

    https://www.youtube.com/watch?v=Z1BdnYNYrqA&feature=youtube_gda...

    My first real field test, live stream from my NexNeo quad; feeding to my Intel NUC ground station with netcat and mplayer; have the mission planner HUD over video stream to give you an idea of latency via  correlation of artificial horizon/video stream.  Latency tends to stay around 150-200ms.  Quad side = RPI video feed via Ethernet to Ubiquiti Wispstation M5 with CPI antenna to ground station with Ubiquiti Bullet M5 HP and immersian RC 13dpi CPI patch on antenna tracker.  Signal was pretty solid out to 1000ft' with -73db to -69db signal strenght ; and that was with a very poorly aligned antenna tracker.  Hadn't seen much in the way of actual field testing from anyone, so hope you enjoy!

    YouTube
  • Camera Pi

    raspivid -t 0 -w 1366 -h 768 -fps 60 -vf -hf -b 6000000 -o - | nc 192.168.1.105 5001

    Mplayer / Netcat Receiver Windows 8.1 64bit - Intel NUC - This is the batch file I setup...

    @echo off

    C:\Users\Patrick\Desktop\UAVVidApps\NETCAT\netcat-win32-1.12\nc.exe -L -p 5001 | C:\Users\Patrick\Desktop\UAVVidApps\MPLAYER\mplayer-svn-36251\mplayer.exe -fps 31 -cache 512

  • I know the video is pretty jerky, but you can see that the video correlates very well with the artificial horizon in the HUD; my screen capture is only running at about 13fps, the video/HUD movement on my monitor is perfectly smooth!  I get a glitch every know and then, but no more often than my standard analog feed... 

  • 3692913203?profile=originalMplayer and Netcat did the trick!  Here's a shot from some latency testing I did back in October, seems to stay right around 150-200ms, a little tricky to get a clean shot of both screens, but I've got a few..

  • Developer
    Glad to help :) 150ms is great, please let us know how you got it so fast on the end :)
    Phil
  • @ Philip - Thanks for getting me going in the right direction with this post, couldn't have done it without the help!

This reply was deleted.