Thread Tools
Apr 25, 2021, 03:12 AM
Registered User
PetruSoroaga's Avatar
Thread OP
Discussion

Ruby: Digital FPV Video Link (v 3.0)


Hello!
This is a DIY digital FPV link, running on Raspberry Pi for both the TX side and the RX side.
In a nutshell: Using 2 Raspberry Pi boards and wireless network cards you can have a wireless digital video link between your models and the controller, similar to any other video link. Being a digital link (not analog) gives you some advantages like: noise free video feed, ability to send data too (like telemetry and other custom data), have more configurable parameters as it relates to the end to end video link, not just frequency and band; but also parameters like resolution, framerate, resilience and so on; and also enables some exotic scenarios like 3D video, camera switching and so on pretty much out of the box.

Ruby is build from scratch by me and the code is all written in C and C++ with no slow bash scripts.
The hardware setup and wiring is easy to do, see attached pictures.


Some of the features it has:

* Bind multiple models (just like a regular remote control) and switch between them, live;
* Spectator mode;
* Software update on the vehicles over the air. So you just need to upgrade your controller and then you can upgrade your models without having to mess with them or having to take the hardware/SD card out; Controller can also be updated using a USB stick.
* Supports multiple RF bands: 2.4Ghz and 5.8Ghz (433Mhz, 868Mhz and 915Mhz coming soon), the link is set for each model (if you have hardware that supports both frequencies bands); On the ground side you can use up to 4 radio interfaces for link reliability and different bands as needed.
* Detailed info on link quality and video decoding stats;
* Multiple OSD layouts;
* Multiple camera profiles, live switching between them for different flight conditions;
* Lower latency (110ms) than other similar systems (up to a frame less latency);
* Video is more resilient and offers more bandwidth than similar systems, it uses less error correction and video data retransmission when something is lost or there is an interference;
* Bidirectional data link for video, telemetry, commands and custom data feeds. MAVLink and LTM telemetry for now, other protocols are still in progress;
* Telemetry export/import on controller serial ports (so that MAVLink/LTM can be sent to other ground devices or taken from other ground devices and sent to vehicle);
* Extended settings, all settings can be changed on the fly using the OSD and menu (except some RC settings which would be dangerous to change while the vehicle is flying or armed);
* Short start up times;

Still under testing and/or development:

* Full RC link, both using the existing radio link or using custom modules for 433Mhz, 868Mhz and so on, using SPI bus as the connection between Raspberry Pi and the modules;
* Maps;
* Relay (use one more vehicle or ground station as a relay, having one part of the link on 5.8Ghz and the other part on 2.4Ghz. Or any other combination);


What to expect:

In terms of end-to-end latency (glass-to-glass):

115 ms is average for a good setup, on a PiZero (with settings not changed to be optimized for latency; still some improvements to be done https://www.rcgroups.com/forums/show...&postcount=265)

In terms of range:

* On 2.4Ghz, using 200mW of power: about 2-3 km range (solid video); Range is shorter if you are in a city area with a lot of WiFi traffic;
* On 5.8Ghz, using 400mw of power: about 3.5-4 km range (solid video); Range is pretty much the same in city and outside. I guess less 5.8Ghz band noise. This is how far I usually fly, not the range it can have. People regularly fly to 7-8 Km out on omnidirectional antennas only with solid link (see examples below);
This is on 720p, using CP antennas, 2-3db of gain;
Note: I recommend to always use capacitors on the power sources, different values (i.e. 1microF + 10microF + 100microF + 1000microF); And shield the network cards from any noise (using aluminum foil or something else). A lot of displays and display driver boards generate a TON of RF noise.

In terms of link quality:
As good as it gets See here, 100% link quality, no break ups: https://www.rcgroups.com/forums/show...&postcount=762

How to setup/install it:

To simple ways:
A) Download the Raspberry Pi image archive from the link below, unzip it and copy it to 2 SD cards (using Etcher or other tool) and that's all.
Future Use (1.5 an up):
B) If you already have Ruby installed (at least version 1.5), just download the attached zip archive, unzip everything to a USB memory stick and plug it into the controller in any USB port. Then from menu, choose to update the system. Your vehicles: you can update directly over the air, from the controller. Note: All models and model settings will be preserved after an update and will be backward compatible.

That's all.

If you want to tinker and you are familiar with Raspberry Pi and you have an image that supports the modified network drivers, you can do the install or update like this: download the attached archive; it contains all the binaries you need. Create a folder named "ruby" on /home/pi, copy everything there and replace the .profile file located at /home/root/.profile with the one provided in the zip file. (don't forget to copy also the osdfonts subfolder, as is)
Note: make sure that the binaries you copy in /home/pi/ruby have execution rights. Or just update the rights using the commands: "cd /home/pi/ruby" and "chmod 777 ruby_*"


Hardware:

You need a Raspberry Pi, a camera and a supported network card on the vehicle. Any Raspberry Pi works.
On the controller you need at least a Raspberry Pi 2 (RPI Zero is too slow) a supported network card and a display.
Also, on the controller you need to add 5 buttons as in the picture attached to be able to access the menus and use the user interface. Those GPIO pins are pulled down to ground using internal resistors. All the configurations of the vehicle, the controller and the system is done through the UI.
Optionally you can add 3 LEDs as in the picture attached if you want to get some status from the controller.
Note: The buttons and the LEDs are only required on the ground side. On the vehicle you don't need to add anything (There is a RC link using SPI bus, but it's work on progress).
Here is the mapping:
GPIO 5 - Red LED - shows fatal errors; (optional)
GPIO 6 - Yellow LED - shows temporary recoverable errors; (optional)
GPIO 13 - Green LED - shows running status and radio activity; (optional)
GPIO 23 - Menu/Select Button;
GPIO 24 - Back Button;
GPIO 22 - Plus Button;
GPIO 27 - Minus Button;
GPIO 17 - OSD/Quick action Button 1; (optional)
GPIO 4 - OSD/Quick action Button 2; (optional)
GPIO 19 - If pulled up to 3.3v, forces the system to start as vehicle/relay (optional, needed for pure relay systems, they have no camera)

Best cards to use:
https://www.rcgroups.com/forums/show...&postcount=692


Running:

On first run (after you either installed the baked images to 2 SD cards or just copied the binaries to some existing images) the controller automatically binds to the first vehicle it can find on the default frequency (which is either a 2.4Ghz one or a 5.8Ghz one based on the hardware detected). Then you can search and bind to multiple vehicles.

For now, I prefer not to release the source code as I want to keep a tight control on what goes in. This was build mainly because: I wanted features not available in other systems at the time I started this; and because I like to tinker and felt like there could be some improvements done to existing systems; I wanted a googles all in one solution, using the 5 buttons I can change all the settings on the fly, without having to take the googles off or without having to use a phone.
Now that it's in a pretty robust state after almost a year of development, I feel confident to share it as other people might find it useful too and keep the RC groups spirit of sharing and giving back alive.

Useful links and information:

* Minimum list of components (and cheap ones) to have a system (controller and a vehicle) up and running: https://www.rcgroups.com/forums/show...&postcount=106

* Best cards to use:
https://www.rcgroups.com/forums/show...&postcount=692

* 7 km solid link on 200 mw 5.8 Ghz and omnidirectional antennas (no patches or other high gain antennas): https://www.rcgroups.com/forums/show...&postcount=148

* Link quality: 100%, no lost data:
https://www.rcgroups.com/forums/show...&postcount=762


Downloads:

Note: If Google blocks your download, you need to right click the URL, choose save as and ignore the warning and press on "Keep the file" to download it...

* To download the full Raspberry Pi image with everything already build, to put on SD cards, use the following links:

Latest:

v 3.0:
What's new in 3.0: https://www.rcgroups.com/forums/show...&postcount=765

Full image here: http://www.petrusoroaga.com/articles..._image_3.0.zip
(alternative location: https://www.mediafire.com/file/ni9xi...e_3.0.zip/file)

v 2.5:
What's new in 2.5: https://www.rcgroups.com/forums/show...&postcount=688

Full image here: http://www.petrusoroaga.com/articles..._image_2.5.zip
(alternative location: https://www.mediafire.com/file/euydf...e_2.5.zip/file)

Update only (needs to be applied on both controller and vehicles): http://www.petrusoroaga.com/articles...update_2.5.zip
(alternative location: https://www.mediafire.com/file/tadj9...e_2.5.zip/file)


v 2.4:
What's new in 2.4: https://www.rcgroups.com/forums/show...&postcount=660

Full image: http://www.petrusoroaga.com/articles..._image_2.4.zip
(alternate full image location: https://www.mediafire.com/file/2hon8...e_2.4.zip/file)

Update only: http://www.petrusoroaga.com/articles...update_2.4.zip
(alternate update file location: https://www.mediafire.com/file/p00im...e_2.4.zip/file)


v2.3:

(What's new in 2.3: https://www.rcgroups.com/forums/show...&postcount=580)

Full image: http://www.petrusoroaga.com/articles..._image_2.3.zip
(Alternative location for full image: https://www.mediafire.com/file/g4z1n...e_2.3.zip/file)

* To download just the update (future, 3.0 up), download the attached zip file.

Have fun!
Last edited by PetruSoroaga; Yesterday at 11:02 AM.
Sign up now
to remove ads between posts
Apr 25, 2021, 03:46 AM
Registered User
Looks good, I will stay tuned with interest. Keep up the terrific contribution to a digital alternative to those many fpvers who wanna be free of the analogue shortcomings. Cheers.
Apr 25, 2021, 09:25 PM
Registered User
mmormota's Avatar
Interesting project. Please, upload a video.
Apr 26, 2021, 08:57 AM
Registered User
dmpriso's Avatar
Quote:
A little bit lower latency than other similar systems
Any numbers on that? BTW what is the main source of latency in that setup, how much latency does the wifi add, how much is caused by FEC or retransmissions, how much is caused by encoding and how large is the playout buffer?

That OSD is beautiful btw.
Apr 26, 2021, 09:20 AM
Registered User
PetruSoroaga's Avatar
Thread OP
Quote:
Originally Posted by dmpriso
Any numbers on that? BTW what is the main source of latency in that setup, how much latency does the wifi add, how much is caused by FEC or retransmissions, how much is caused by encoding and how large is the playout buffer?

That OSD is beautiful btw.
No numbers yet, it's just based on the architecture difference in the pipeline with a reduction in latency of up to a frame or more (30ms) and on what I see.
Most of the latency comes from the camera and the GPU encoding. That is, obtaining the H264 source stream. I'm trying to figure something out to reduce even more the end-to-end pipeline. FEC and transmission is a really small part of the whole pipeline. I measured it, at the lowest, to about 10miliseconds/second total(on a Raspberry Pi Zero). So on a FPS basis, it's less than 1 ms/frame.
Petru
Last edited by PetruSoroaga; Apr 26, 2021 at 09:38 AM.
Apr 26, 2021, 09:21 AM
Registered User
A little disappointed that it is still OP-HD based.
Looks good but the boot text has to be turned off as it shows around the edges
and makes the OSD text hard to read.
The over clock and over voltage in the config dates back to the original Ez
with the old 700mhz boards and is no longer needed and not recommended by Pi.
Will give it a road test when finished setting it up and let You know how it does.
( Hard to get 5 buttons during a lock down on a Sunday !! )
Apr 26, 2021, 09:27 AM
Registered User
PetruSoroaga's Avatar
Thread OP
Quote:
Originally Posted by Trebor Link
A little disappointed that it is still OP-HD based.
Looks good but the boot text has to be turned off as it shows around the edges
and makes the OSD text hard to read.
The over clock and over voltage in the config dates back to the original Ez
with the old 700mhz boards and is no longer needed and not recommended by Pi.
Will give it a road test when finished setting it up and let You know how it does.
( Hard to get 5 buttons during a lock down on a Sunday !! )
Not sure I understand the OpenHD reference. The code is 100% written from scratch, except 2 FEC functions I just took from Luigi Rizzo. The attached archive with binaries (from the first post) works on any Raspberry that has the patched network drivers. For the full baked convenient image I just used an existing Raspberry Pi Image that had the most updated modified network drivers from which I deleted everything except the drivers, so maybe there are some OpenHD textual references left somewhere in a config file. It works with any Raspberry Pi image that has the patched network drivers, not just ExWiFi or OPHD image.

Thank you for the boot text tip, I did not noticed it as I'm always using 16:9 screens.
Yes, I did not touched much in the config.txt file as those are pretty much defaults for Raspberry. If there are new values recommended there by Raspberry, I'll update those, thanks for the tip!
Apr 26, 2021, 10:54 AM
Registered User
Ben Nachie's Avatar
Since it requires five buttons, would it be possible for you to code it so it works with this?

https://shop.pimoroni.com/products/button-shim
Apr 26, 2021, 12:11 PM
Registered User
PetruSoroaga's Avatar
Thread OP
Quote:
Originally Posted by Ben Nachie
Since it requires five buttons, would it be possible for you to code it so it works with this?

https://shop.pimoroni.com/products/button-shim
Yes, absolutely, I'll have to buy one to play with, so it might take some time to get delivered, but I'll put it on my To Do list. Seems a little overkill just for the buttons, but the RGB led is handy for various status codes. And now it's 5 buttons, but I was thinking of adding a Left/right one too and one more extra Quick Action button for doing custom actions like RTL, Record/Relay switch and so on.
Apr 26, 2021, 12:31 PM
Registered User
Ben Nachie's Avatar
Quote:
Originally Posted by PetruSoroaga
Yes, absolutely, I'll have to buy one to play with, so it might take some time to get delivered, but I'll put it on my To Do list. Seems a little overkill just for the buttons, but the RGB led is handy for various status codes. And now it's 5 buttons, but I was thinking of adding a Left/right one too and one more extra Quick Action button for doing custom actions like RTL, Record/Relay switch and so on.
Awesome. Thanks!
Apr 26, 2021, 01:13 PM
Registered User
RocketMouse's Avatar
Very nice, but Open HD shows 45km distance already.
Apr 26, 2021, 01:50 PM
Registered User
PetruSoroaga's Avatar
Thread OP
Quote:
Originally Posted by RocketMouse
Very nice, but Open HD shows 45km distance already.
That has nothing to do with the software but the RF side of things. Which is not particular to Open HD or other systems, it's the same hardware. It's still Raspberry Pi and consumer available network cards. The software can only change the way the link is maintained, break-ups, recovery, correction of lost data and to a small extent range by using different coding schemes. But pure long FPV range is mostly dependent on hardware.
As reference, I can fly with a reliable video link out to 4 km, on 400mW with omnidirectional antenna. Theoretically, if I use a patch of let's say 18db gain, I can go out to 32km with a full HD reliable link.
Apr 26, 2021, 02:27 PM
Registered User
RocketMouse's Avatar
That's what I was actually trying to understand, can your project benefit from better compression, better packets maintenance or whatever, that can help to improve quality and range.

The biggest problem of OHD is quite low picture quality in my opinion. When flying low it shows really too much compression artefacts. DJI handles that much better.
Apr 26, 2021, 02:38 PM
Registered User
PetruSoroaga's Avatar
Thread OP
Quote:
Originally Posted by RocketMouse
That's what I was actually trying to understand, can your project benefit from better compression, better packets maintenance or whatever, that can help to improve quality and range.

The biggest problem of OHD is quite low picture quality in my opinion. When flying low it shows really too much compression artefacts. DJI handles that much better.
Yes, you benefit from better link management. In terms of picture quality, it all depends on camera and the GPU which is closed, so not much can be done there. I found that using lower values for brightness, contrast, saturation and sharpness gives a better picture. In terms of compression artefacts, yes, you can improve things a little bit by setting the parameter H264 quantization. Larger values give better image but need higher bandwidth. Still, overall you are still limited by the camera optical sensor. With a DSLR and an HDMI to CSI adaptor, it might be a different situation.
Apr 26, 2021, 02:43 PM
Fly FPV, sleep; repeat
twinturbostang's Avatar
Quote:
Originally Posted by RocketMouse
The biggest problem of OHD is quite low picture quality in my opinion. When flying low it shows really too much compression artefacts. DJI handles that much better.
That might have to do with the amount of bandwidth being used. DJI in 50 Mbit mode is amazing, but uses a huge amount of the band in order to do it.


Quick Reply
Message:

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion CUAV HACK LINK Digital Data Link System for PIXHACK Flight Controller FPV UAV Drone Q skylarkfpv Multirotor Drone Talk 3 Mar 30, 2018 07:06 PM
Idea Digital FPV link, considering designing video/telem/OSD system, need input FalconFour FPV Talk 89 Nov 21, 2011 06:34 PM