3+km HD FPV system using commodity hardware

Hi

Over the last couple of months I have been working on a project that might be of interest to you: https://befinitiv.wordpress.com/wifibroadcast-analog-like-transmission-of-live-video-data/

Basically it is a digital transmission of video data that mimics the (advantageous) properties of an analog link. Although I use cheap WIFI dongles this is not one of the many "I took a raspberry and transmitted my video over WIFI"-projects.

The difference is that I use the cards in injection mode. This allows to send and receive arbitrary WIFI packets. What advantages does this give?

- No association: A receiver always receives data as long as he is in range

- Unidirectional data flow: Normal WIFI uses acknowledgement frames and thus requires a two-way communication channel. Using my project gives the possibility to have an asymmetrical link (->different antenna types for RX and TX)

- Error tolerant: Normal WIFI throws away erroneous frames although they could have contained usable data. My project uses every data it gets.

For FPV usage this means:

- No stalling image feeds as with the other WIFI FPV projects

- No risk of disassociation (which equals to blindness)

- Graceful degradation of camera image instead of stalling (or worse: disassociation) when you are getting out of range

The project is still beta but already usable. On the TX and RX side you can use any linux machine you like. I use on both sides Raspberrys which works just fine. I also ported the whole stack to Android. If I have bystanders I just give them my tablet for joining the FPV fun :)

Using this system I was able to archive a range of 3km without any antenna tracking stuff. At that distance there was still enough power for some more km. But my line of sight was limited to 3km...

In the end, what does it cost? Not much. You just need:

2x Raspberry A+

2x 8€ wifi dongles

1x Raspberry camera

1x Some kind of cheap display

Happy to hear your thoughts/rebuild reports :)

See you,

befinitiv.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

    • I haven't gotten anywhere with wifibroadcast or the OSD idea, but I've added simple wifibroadcast support to this script I'm using for streaming video to an Oculus Rift: https://github.com/balrog-kun/fpv-stream-to-vr  it lets you change some of the parameters in run time with key presses, could also have the OSD code added there and some wifibroadcast-specific key shortcuts if deemed useful.

      balrog-kun/fpv-stream-to-vr
      Utilities for streaming an FPV stream to the Oculus Rift DK2 or other VR goggles - balrog-kun/fpv-stream-to-vr
    • Hey, exactly what I was planning to work on ! I already have the system working with two CSL adapters, I still need to do some range test, and maybe improve the latency which is currently about 250ms. Good antennas should be a part of the solution :) 

      Anyway, I could help you if you want !

      QGroundControl might be a good start point for the OSD part ?

  • Result!  I've got a 5.8ghz setup working now with great range - I've flown out to 750m with zero visual drops so don't know what the eventual range is, but it's certainly good enough for line of sight flying - I was struggling to get more than 80m before so it's a relief to get this working.  The devil is in the details, in particular the transmitter power and the receiver antennas.  I've used:

     1 x Alfa AWUS051NH V2

     2 x CSL 300Mbit USB WLAN Adapter

     2 x ImmersionRC RHCP Spironet 5.8ghz Antennas

     1 x ImmersionRC RHCP Spironet 5.8ghz Patch Antenna

    The Alfa AWUS051NH is the transmitter.  It has a single RP-SMA plug to which I've attached one of the rhcp spironet helical antennas (see photos).  The Alfa dongles seem to be popular with hacking/war-driving because they seem to specialise in fuzzing large amplifiers onto the front of standard wifi chips to boost the output.  They seem to be quite poor at designing the sensitive circuitry for receiving which is possibly why others have found that using alfa as the receiver produces poor results.  It's very important to get the v2 - the v1 of this dongle had the 5ghz antenna onboard which was useless.

    The CSLs are used for receiving in diversity.  I plug one spironet helical into one side of one adaptor and keep the standard rubber ducky in the other side, and for the other adaptor I use the patch antenna on one side and again keep the standard rubber ducky in the other side (see photos).

    It's also important to keep the antennas (particularly tx) well out of the way of any other bits, which is why I've mounted the tx antenna as high and central as possible.

    I haven't done any kind of tuning yet so hope to get even better results after a bit of work.  The patch antenna for example is designed to operate at exactly 5.8ghz and has a band of frequencies either side that it still works at but with less effectiveness.  I'm operating down at channel 149 which is 5.745ghz, so perhaps by going up to channel 161 (5.805 ghz) it might give a bit better result.  I haven't played with rates or power yet either (I've got it currently set to 18M rate and 30db power), and I'm sure that adding a second helical and patch to the receiver dongles will get further benefits - particularly with the patches which have a narrow receiving angle, you could stagger the angles to get a better coverage.

    Thanks again to befinitiv for his cool idea, this definitely has potential.  Please excuse the inside of my quad - it looks like a bedroom cupboard where you have to push everything in with your foot and quickly close the door.

    DSC01805-small.JPG

    DSC01809-small.JPG

    DSC01810-small.JPG

    • Fantastic, was leaning towards this setup and I'm glad someone has real world experience in it, great work mate

      • Cheers hope it's useful to others.  How have you got on, which adaptors did you go for in the end and what sort of results did you get?

    • I've had very little time for fun lately but I tried another range test yesterday.  I set a waypoint mission for 1.5km straight out over some fields (and a hill with trees) and then back again and set it off.  I started to get a bit of break up around 1km but still perfectly useable, then lost it at 1.2km when the by now little dot disappeared behind the treeline and the hill.  I also lost RC signal at this point, so after a few buttock clenching minutes it was a huge relief to see the tiny dot reappear over the treeline.  Thanks Randy for awesome autonomous flight code :)

      I'd say the 1.2km was probably nearing the edge of the useable range but I'll do another test at higher altitude to avoid the treeline horizon sometime.

      • Quick update, I have no time for flying at the moment but did one quick flight tonight.  I did the same 1.5km mission as before but increased altitude to 100m to keep it over the hill/horizon.  Interestingly the helical antenna reached out to about 650m, much better than I expected.  The patch antenna was still going strong at 1.5km when the auto mission turned back home.  It was getting some drops from about 1.2km but recovers immediately and I was still getting perfectly strong video at 1.5km.

        This is still at 18m rate, 720p.  I'll change the bitrates and framerates higher and lower when I have time and see what the ranges are like for the different configurations.

        One thing I've noticed is that the video tx sometimes stopped.  Restarting the rx doesn't make any difference because it's the tx side that's stopped, and unlike with traditional associated/adhoc wifi you can't connect to the raspberry over ssh to restart it, so there's nothing you can do until you can physically reset the raspberry, which is a pain.  It seems to be a bug in the kernel dongle driver so probably worth trying updated drivers.

        Also, when running rx in software diversity mode, if one interface disappears (like if it accidentally gets unplugged), the rx program bombs out.  It would be great if it could continue with a single interface.

    • Just a few more details about the setup.  Note that this combination of dongles works out of the box with any of the raspberry OS images and should work with any of the model a/b/2 hardware.  No kernel or firmware hacks are necessary.  Just use this script on the tx side (I simply call it from /etc/rc.local, possibly a more elegant init script could be devised)

      !/bin/sh
      /sbin/ifconfig wlan0 down
      /sbin/iw dev wlan0 set monitor otherbss fcsfail
      /sbin/ifconfig wlan0 up
      /sbin/iw reg set BO
      /sbin/iwconfig wlan0 rate 18M fixed
      /sbin/iwconfig wlan0 txpower 30 fixed
      /sbin/iw dev wlan0 set txpower fixed 30mBm
      /sbin/iwconfig wlan0 channel 149

      /usr/bin/raspivid -ih -t 0 -w 1296 -h 730 -fps 30 -b 2000000 -n -g 30 -pf high -o - | /usr/local/bin/tx -b 8 -r 2 wlan0 >/var/log/raspitx.log 2>&1

      On the rx side, I use this script:

      #!/bin/sh

      /usr/bin/sudo /sbin/ifconfig wlan0 down
      /usr/bin/sudo /sbin/iw dev wlan0 set monitor otherbss fcsfail
      /usr/bin/sudo /sbin/ifconfig wlan0 up
      /usr/bin/sudo /sbin/iw reg set BO
      /usr/bin/sudo /sbin/iwconfig wlan0 rate 18M fixed
      /usr/bin/sudo /sbin/iwconfig wlan0 channel 149

      /usr/bin/sudo /sbin/ifconfig wlan1 down
      /usr/bin/sudo /sbin/iw dev wlan1 set monitor otherbss fcsfail
      /usr/bin/sudo /sbin/ifconfig wlan1 up
      /usr/bin/sudo /sbin/iw reg set BO
      /usr/bin/sudo /sbin/iwconfig wlan1 rate 18M fixed
      /usr/bin/sudo /sbin/iwconfig wlan1 channel 149

      /usr/bin/sudo /usr/local/bin/rx -b 8 wlan0 wlan1 | gst-launch-1.0 -v fdsrc ! h264parse ! avdec_h264 ! autovideosink sync=false

      These values were quite randomly chosen and I haven't done much tuning/experimentation yet.  The rate is set to 18M before I got the alfa dongle because I was trying somehow to increase the range of just using the CSL adaptors, and receiver sensitivity is heavily dependent on rate - the slower the rate, the greater the range.  The raspberry is running in a binned full sensor mode but only using 30fps, it should run up to 49fps which will decrease latency.  I've decreased the bit compression stream rate (2mb) to fit into the decreased wifi rate.  Decreasing key frame frequency, blocks and retransmits will no doubt help latency at the expense of reliability.

      • Hi Fnoop,

        Have you tried using the Alfa Long-Range Dual-Band AC1200 as the rx and Alfa AWUS051NH as the tx? 
        I haven't been able to get access to the CSL 300Mbit USB WLAN Adapter in the US 

        • Hiya, I've only tried CSL on the rx side, but as far as I understand any 5.8ghz wifi card/dongle should work on the rx side - it's the tx side that you need the higher power and the packet injection.  I did read that the Alfa cards tend to be really bad at rx so probably best avoided.  Let us know how you get on :)

          ps I think I read that AC adapters don't work in monitor/injection mode, only N adapters.

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…