Wifibroadcast - low budget analog-like HD transmission with OSD

Hi,

i was offered a Navio2 for testing Wifibroadcast in combination with Navio2. Thanks to the team from Emlid. In return i want to show you, how you could build a low budget HD system, that has very low latency (currently around 150ms from cam to screen) and also has the characteristics of an analog video transmission.

The main credits should go to befi from befinitiv, who started this project and developed the wifibroadcast code. You can find a description of the system here:

As you can read all the information on his webpage, i will just do a short summary for the lazy people that do not like to read. All text is copyright by befi:

The system uses a raspberry with the raspi cam on the TX side and a raspberry with one or multiple usb wifi dongles on the rx side. As a wifi dongle TP-Link WN722N are a good choice, as they have a good sensitivity and are quite cheap (~10$). As for the TX you can also use the Wn722N which have around 100mW or you can use higher power usb dongles like the Alfa AWUS036NHA with up to 500mW if that is allowed in your country.

As the Raspberrys have pretty good software support for video encoding, hardware accelerated video playback and hardware accelerated graphics drawing it was possible to combine all those and put them into one system, which resulted in a low latency HD video system with additional telemetry transmission.

The telemetry can be used for either controlling a tracker or for supplying data for a ground station osd like in this video:

This is a preview of the osd i just implemented recently. It uses mavlink from Navio2 with a Raspberry 3, transmits the data over wifibroadcast to a Raspberry 2. On the ground you can use a display with HDMI input or a video goggle, like the Headplay HD, to enjoy the high quality HD stream. You can as well use the analog output of the raspi to display the video in video goggles that only have an analog input (this i have not tested yet, but it should be possible).

In the coming days i will supply instructions on how to install the system and what hardware is needed to set it all up. I will not be online the next 4 days but maybe on sunday i will be able to update this post with more information.

Feel free to comment on this if you like it.

Some more videos of an older Version of the OSD recorded by schalonsus (note that the recording was done on the ground raspberry, so its really what you would see on your screen):

The OSD by the way works with Mavlink, LTM and Frsky. The Hardware used in the Video is TP-Link WN722N as TX and 2x the same as RX.

5 Likes

Awesome - Iā€™ve been looking at wifibroadcast for a while now - great to hear youā€™ve got it up and running with Navio2!

My big want with WifiBoradcast was (and is) 5Ghz support - Iā€™ve yet to get hold a decent card in the UK with drivers that have monitor mode support OOTB. Admittedly, Iā€™ve not looked so hard this last couple of weeks - other commitments have taken over my time - but any insight you have would be greatly appreciated.

Looking forward to updates!

The ALFA AWUS051NH v2 card recommended by Befi is readily available in the UK and works out of the box on the Pi.

I have had it running on the Navio2 on the bench and am just having a go at an aerial test rig (albeit using a stand-alone Pi A+ until I am sure that I have all the wrinkles sorted).

Peter

Just to add to my postā€¦ the second part of my project is to implement an antenna tracker using the Mavlink downlink going into Mavproxy on a ground-side Pi, which will be the WFB RX and drive the tracker. Still waiting on some bits before I can complete this, but I am using CSL-300 with twin antenna (one a regular circular polarised, the other a panel on the tracker).

Once I get stuff working a bit better I will post up details (including a new Mavproxy module that will do the tracking).

Peter

1 Like

Rangaid

Iā€™v been following on another forumā€¦thanks

I already implemented a tracker that uses mavlink:

There also is a 3d printable case for it:

The Tracker uses a slipring for continious 360Ā° rotation. The only problem iā€™m still struggling is how to get HDMI through the slipring. Actually the only possible solution would be to use another raspi to relay the image from the tracker to a second raspi on the ground that is connected to the video gogglesā€¦ Maybe iā€™ll find a better solution. I also thought about a 180Ā° degree tracker if you just fly in one direction. There you could just use the cable.

5Ghz is possible, but its not as stable as 2.4Ghz. I tried it with two CSL300 (careful, there are multiple dongles by that name) but the range was horrible, like 50m or so. Not sure why it was so bad. I did not use the diversity feature though, that might add additional range. On 5Ghz you definitely need one of thos alfa high power dongles for good range. On 2.4G you can already achieve like 1.5km easily with the 10$ TP-Link WN722N and stock antennas. With alfa on 2.4G 4-7km was already confirmed.

Thats why iā€™m currently working on a 868Mhz RC system, so i can use the 2.4G link.

1 Like

Maybe you could do it like the ghettostation tracker does. It uses two 180Ā° servos, one for tilt, one for pan and flips the antenna over, if the pan servo reaches the end of its movement range. You will have a short loss of video, but with fast servos it is no problem. It would not work with the design of your open360tracker as it is now, because you need 180Ā° tilt travel.

Awesome project!

1 Like

What you describe there is already known as ā€œWischmob-Transformationā€ in our german forum. Someone made a video to show how it works:

The problem is this only works with light antennas and if the cable of the antenna is not so rigid. It might work with USB-Cables as they are quite bendable. Thanks for bringing that back to my mind, i already thought about exactly that to use with the USB dongles but just forgot about this. Will investigate if that works. It should even be possible to directly implement the logic on the ground pi so you just have to solder an adapter board to connect the servos to the raspi directly. Would make a nice small compact ground station with tracker.

Edit: Just had a look at how the ghettostation tracker does it. Its slightly different to the wischmob transformation. The wishmob transmormation takes less time to adjust the antenna when its at limit. But the wishmob mechanics are not so stable as the ones from ghettostation. Will check what works best of both.

1 Like

I forked the OSD part of wifibroadcast and added some features like specifying the battery cell count and wifibroadcast port number at run time. Check it out

Mavlink Data TX
Start loopback device for teletry data

sudo socat PTY,link=/dev/mavlink0,echo=0,raw PTY,link=/dev/mavlink1,echo=0,raw > /dev/null 2>&1 &

Start MavProxy

sudo mavproxy.py --master=udp:127.0.0.1:14551 --out=udpin:0.0.0.0:14550 --out=/dev/mavlink0 --daemon --nowait -a --logfile=/var/log/mavlink.log > /dev/null 2>&1 &

Start ArduCopter

sudo /opt/apm/bin/ArduCopter -A udp:0.0.0.0:14551 -C /dev/ttyAMA0 > /dev/null 2>&1 &

Mavlink Data RX
Start on the same Raspberry Pi

cat /dev/mavlink0 | /home/pi/wifibroadcast_osd/mavlink_osd

Start on a remote WiFiBroadcast RX Raspberry Pi

/home/pi/wifibroadcast/rx -b 8 -r 4 -f 1024 -p 1 wlan0 | /home/pi/wifibroadcast_osd/mavlink_osd

Usage
cat /dev/mavlink0 | ./mavlink_osd [-pchv]

ā€“help -h This help information.
ā€“verbose -v Print information to stdout.
ā€“port -p [0-9] WiFiBroadcast Port for monitoring RX signal.
ā€“cells -c [2-6] Number of battery cells for battery meter.

1 Like

Yes - I looked at that project. It has a couple of cool ideas (that I may borrow), however I am planning 2 x 180 servos (pan & tilt) and having everything controlled from the Pi.

Thanks guys for such interesting idea, going to implement it soon.
Just not sure if the quality of Alfa AWUS051NH v2 is good, so, what about TP-Link WN722N + Alfa APA05 PEN Booster 2.4GHz 800mW on RX and TX sides? Should this combination show us decent image and long enough range? Cheers

Is it possible to combine the TP-Link WN722N (2.4 GHz) with a 2.4 GHz DSSS radio? Or is it problematic?

A question: How do I get the receiver to display the image in SBS mode? I have a VR headset, but it shows up as one image spread across both eyes.

Even the WDN722N only should be able to have a range of ~1km with Stock antennas. Iā€™m quite busy right now so i couldnt do a full range test yet. A guy in our german forum achieved 4-7km with the Alfa dongle. Not sure if its the same as yours though, but he used the 500mW 2.4G Alfa dongle that is recommended by befi.

No its not possible to use it with 2.4G RC Radio. You either need 5G WIFI hardware or an UHF.

There is an app from one of the german guys in the forum that allows to use the smartphone for displaying in VR goggles:

Thank you for this great project.
Disclaimer emlid the last image.
Mavproxy install and works perfect.
wifibroadcast installed with:

`#!/bin/bash

set -e

sudo apt-get update
sudo apt-get -y install vim mercurial libpcap-dev iw usbmount
sudo apt-get -y remove --auto-remove --purge libx11-.*

#install wifibroadcast
cd /home/pi
hg clone https://bitbucket.org/befi/wifibroadcast
cd wifibroadcast
make

#install new firmware
sudo cp ā€œpatches/AR9271/firmware/htc_9271.fwā€ ā€œ/lib/firmwareā€

#patch hello_video
cd /home/pi
hg clone https://bitbucket.org/befi/hello_video
sudo cp hello_video/video.c /opt/vc/src/hello_pi/hello_video/video.c
cd /opt/vc/src/hello_pi/
sudo ./rebuild.sh

#install osd
cd /home/pi
hg clone https://bitbucket.org/befi/frsky_omx_osd
cd frsky_omx_osd
sudo make

#install startup scripts
cd /home/pi
hg clone https://bitbucket.org/befi/wifibroadcast_fpv_scripts
cd wifibroadcast_fpv_scripts
sudo cp systemd/*.service /etc/systemd/system

#enable wifibroadcast, osd and shutdown pin
sudo systemctl enable wbcrxd
sudo systemctl enable wbctxd
sudo systemctl enable osd
sudo systemctl enable shutdown

#enable camera
sudo bash -c ā€˜echo -e ā€œ\ngpu_mem=128\nstart_x=1\nā€ >> /boot/config.txtā€™

#disable sync option for usbmount
sudo sed -i ā€˜s/sync,//gā€™ /etc/usbmount/usbmount.conf

#change hostname
CURRENT_HOSTNAME=sudo cat /etc/hostname | sudo tr -d " \t\n\r"
NEW_HOSTNAME=ā€œwbcā€
if [ $? -eq 0 ]; then
sudo sh -c ā€œecho ā€˜$NEW_HOSTNAMEā€™ > /etc/hostnameā€
sudo sed -i ā€œs/127.0.1.1.*$CURRENT_HOSTNAME/127.0.1.1\t$NEW_HOSTNAME/gā€ /etc/hosts
fi

#always enable HDMI at 720p
sudo bash -c ā€˜echo -e ā€œ\nhdmi_force_hotplug=1\nhdmi_drive=2\nhdmi_group=1\nhdmi_mode=4\nā€ >> /boot/config.txtā€™

#remove script that starts raspi config on first boot
sudo rm -rf /etc/profile.d/raspi-config.sh
`
system will not start.

Please couldā€™s take me a hand to find out my error.

1 Like

Hi @Rangarid,

I was wondering if you got around to putting together instructions on how to combine Navio2 with Wifibroadcastā€¦

In particular, I am wondering as to the steps needed to have a running Wifibroadcast toolchain using the Navio realtime image for Raspberry.

Have you had a chance to publish your procedure?

Thanks a lot for your efforts.