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

  • Yes, shipping costs are too high and I wished they had at least one distributor in US. Anyway, which are the similar boards you are referring to?

  • @Tiziano,  I just check the price, 60 euros, but they want 32 euros to ship to the U.S!  I can get similar stuff shipped from china for free.  I might have pulled the trigger at 60 euros, but 92 is a bit much. I think they are gouging on the shipping.

  • I have not estimated the latency but it looks as fast as a PiCamera. Really awesome, also because you can pretty much setup a digital video transmitter for less then 100$ (Pi3 + B101). Auvidea says the Pi3 is limited to 1080p 25fps. Tough I have tested even at 720p 60fps. Here is the reference manual: https://auvidea.com/download/manual/B10x_technical_reference_1.4.pdf.

    The board is compatible with the Jetson too, in case someone want to add even more power to their CV.

    About the range of a normal Raspberry Pi 3: with a Ubiquiti Nanostation M2 I get connection up to 450 meters... pretty good for a lot of applications

  • @Tiziano,   Looks interesting, what's the lacency?  What are the limitations? Works with full 1080p? 

  • Hi everybody, just want to share with you this board from Auvidea (B101): https://auvidea.com/product/70509/. It's a HDMI to CSI-2 adapter, so allows you to plug a GoPro to this very same setup. I tested with Raspberry Pi 3 and GoPro Hero 4 Silver. Works like a charm, even though some limitations apply

  • Oh, and forgot to mention: for those of you wondering how much the Rocket M5 weighs (the new version), it's actually only 42g. The Raspberry Pi 3 is 45g (yes, it's actually heavier!)

    The 2 x antenna, Raspberry Pi, M5 module, ethernet and PoE home made cable weighs ~125g

  • @Patrick 

    Thanks for the reply! I will try this out and see if it solves the problem. 

    Do you know how to record in segmented intervals? I'm just worried if something happens, the whole recording will become corrupted, whereas if it's recorded in say 1 minutes intervals, at most 1 minute of footage will become corrupted. 

  • @Robert,    I use this gstreamer pipeline to record.  But you cannot use the command-line gstreamer because when you stream to a file, to make this work the EOS (end of stream) signal must be sent to make the recording readable.  If you use my stand-alone HUD to stream to your GCS, there is a 'stop' button that solves this problem.

     

    udpsrc port=9000  buffer-size=60000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! tee name=record ! queue ! avdec_h264 ! video/x-raw, format=I420 ! d3dvideosink sync=false record. ! queue ! mp4mux ! filesink location = /temp/fpv.mp4

     

  • I'm still trying to make the pi stream both 1080p, and record it to the usb stick. So far I haven't had luck, but the original idea was to not only record to the usb stick, but have it delete old files once a certain amount of disk space had been occupied e..g record in 30 second intervals, and delete the oldest files once it had reached say 80gb of storage space.

    Anyone got ideas? tee function is pretty useless for this, and I've tried multiple python scripts but it usually gets me nowhere...

  • Finally had time after exams to getting around and finishing the raspberry pi + wifi project

    So it streams 1080p video, and also transmits mavlink data to the groundstation (which I will have as a XiaoMi MiPad 2 yet to get the usb-c to Ethernet adapter). However, on a 4.5ghz hexacore intel based computer, the latency is around 120ms at the best of times.

    The advantage of transmitting via wireless vs using the 3dr radios is that the radios are unencrypted, and easily hackable. Someone could, if they really wanted to, could down your drone if the settings are left at default. Using wireless with WPA2 encryption virtually eliminates this risk.

    Hardware used:

    Raspberry Pi 3 with sony picamera

    Pixhawk

    2 x Rocket M5 with LHCP and RHCP based CP antennas 

    Ignore the mess with the drone wiring, i'll clean it up soon3702269778?profile=original

This reply was deleted.