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

  • @Tiziano,  I have not used the picostation so I can't comment on it. I use the NanoBeam and the Nano M5, which both connect using a standard ethernet cable to the GCS.  The adapter that seems to work the best for me on the UAV is the Amped Wireless ACA1 or the Netis high-power adapter shown in the Sept 14th post above. I haven't had any issues with these either for video or telemetry. What are you using for your ground station? Nano M5 or ??

  • @Patrick, I am using the Alpha  AWUS036NHA  USB adapter on RasPI, it works as soon as you plug in even if is a little blky. I do experience some lack of communication sometimes. I use to send and receive packets at 10 Hz using UDP but sometimes I have holes of one or two seconds. That is not good for sending command.... Did you experience any trouble with your adapter? I was about to try the Picostation (Ubiquiti) as I trust the Ethernet connector much more than the USB. What do you think about? 

  • @Patrick, again thanks for the answers, yes I want to relay the connection to a remote location from the GCS. I have been looking at the web page of Ubiquiti but there is a lot of options for bridging and I don't know which will be the best for this purpose in terms of signal quality and price. I guess I will be using the Nanobeams which you have tested.

  • @Kevin, in that case you might consider using the Nano M5 instead of the dish. It's easier to mount than the dish and less bulky. In the quadcopter picture above, you can see one sitting on the floor at the top of the photo.  The nano has a 60 degree beamwidth so your tracker can have a lot more slop. It's a great choice for flying multirotors since you are typically range limited compared to fixed wing. 

  • @Patrick-- I want all of your toys!  :)  I'm about to start on a tracker that I'm considering mounting on an ArduRover.  I figure I can send the tracker out to the middle of the field while I hang back with a brew. :) 

  • @Sirius, here's a picture of the nanobeam setup on a tracker:

    3702093533?profile=original

    And the wifi adapter mounted on a quadcopter:

    3702093583?profile=original

  • @Sirius, so you want to relay the connection to a remote location from the GCS? If so, yes the Nanobeam will work. It's actually designed for this purpose, not moving UAVs. I think the spec for a dual nanobeam setup is 40km+ depending on the terrain. 

  • @patrick, thanks for the answers Patrick. Do you know if the Ubiquiti NanoBeams could be used as repeaters? 

  • @Kevin, I have two different types, Amped Wireless ACA1 (500mW dual band), and a Netis WF2561 (500mW dual band). These both work very well, but I did have to compile the driver for Linux on the Raspberry PI. Hopefully, the kernel will include these but the latest version of Raspbian did not. The driver code for these is the same, except the ACA1 needed a small modification for it to recognize the adapter.  The Netis has the advantage of being smaller, and is easily mounted on a quadcopter.  Using the Nanobeam with a tracker, you can get many miles range if your tracker is accurate enough and you calibrate it correctly with respect to true-north.  The Nano M5 also works pretty good, and does not need to be as accurately placed, but the range won't be as good compared to the high-gain dish. It just depends on what kind of range you want, but the adapter on the UAV is still the same. In fact, I have found that these adapters were better than the Rocket M5 board when connected to Ubiquity equipment. There are more dropouts with the Rocket M5 mounted on the UAV compared to these standard WiFi adapters.

  • @patrick-- which USB adapter are you using? 

This reply was deleted.