mirror of
https://github.com/svpcom/wfb-ng.git
synced 2025-03-14 10:33:58 -03:00
Add Quick Start guide for new users (#236)
* Ignore vscode * Fix broken link * Add Quick Start guide for RPi users * Fix warranty info * Typo * Add install script * Update installer * Update README with Ubntu installation instructions
This commit is contained in:
parent
b522dd2844
commit
232a8f655f
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,3 +13,4 @@ drone.key
|
||||
wfb_keygen
|
||||
wfb_ng/conf/site.cfg
|
||||
wfb_ng/conf/local.cfg
|
||||
.vscode/
|
119
README.md
119
README.md
@ -17,30 +17,122 @@ Main features:
|
||||
supports gstreamer (Linux X11, etc). Compatible with any screen resolution. Supports aspect correction for PAL to HD scaling.
|
||||
- Provides IPv4 tunnel for generic usage
|
||||
|
||||
## FAQ
|
||||
Q: What type of data can be transmitted using WFB-NG?
|
||||
> :warning: **Warranty/Disclaimer** <br />
|
||||
> This is free software and comes with no warranty, as stated in parts 15 and 16 of the GPLv3 license. The creators and contributors of the software are not responsible for how it is used.
|
||||
> See [License and Support](https://github.com/svpcom/wifibroadcast/wiki/License-and-Support) for details.
|
||||
|
||||
A: Any UDP with packet size <= 1466. For example x264 inside RTP or Mavlink.
|
||||
## Getting Started
|
||||
|
||||
Q: What are transmission guarancies?
|
||||
For detailed instructions on how to get started read through
|
||||
[PX4-Guide](https://docs.px4.io/main/en/tutorials/video_streaming_wifi_broadcast.html)
|
||||
and follow the [Setup HowTo](https://github.com/svpcom/wifibroadcast/wiki/Setup-HOWTO)
|
||||
|
||||
A: Wifibrodcast use FEC (forward error correction) which can recover 4 lost packets from 12 packets block with default settings. You can tune it (both TX and RX simultaniuosly!) to fit your needs.
|
||||
### Quick start using Raspberry Pi
|
||||
|
||||
Q: Is only Raspberry PI supported?
|
||||
- Under [Releases](https://github.com/svpcom/wifibroadcast/releases) download the latest image file (`*.img.gz`).
|
||||
- Unpack the `*.img` file and flash it to 2-SD Cards.
|
||||
- Plug the WiFi Adapters into the Raspberry Pis
|
||||
- Boot the Pis and ssh into them using the following command (replace `192.168.0.111` with their IP-Address). Password: `raspberry`
|
||||
```
|
||||
ssh pi@192.168.0.111
|
||||
```
|
||||
- On the Pi used as ground station:
|
||||
```
|
||||
sudo systemctl enable wifibroadcast@gs
|
||||
sudo systemctl enable fpv-video
|
||||
sudo systemctl enable osd
|
||||
sudo reboot
|
||||
```
|
||||
|
||||
A: WFB-NG is not tied to any GPU - it operates with UDP packets. But to get RTP stream you need a video encoder (with encode raw data from camera to x264 stream). In my case RPI is only used for video encoding (becase RPI Zero is too slow to do anything else) and all other tasks (including WFB-NG) are done by other board (NanoPI NEO2).
|
||||
- On the Pi used on the drone:
|
||||
```
|
||||
sudo systemctl enable wifibroadcast@drone
|
||||
sudo systemctl enable fpv-camera
|
||||
sudo reboot
|
||||
```
|
||||
- Done! You should be able to see the video from the FPV camera. To monitor the link use the following command on the ground station:
|
||||
```
|
||||
wfb-cli gs
|
||||
```
|
||||
|
||||
Q: What is a difference from original wifibroadcast?
|
||||
### Quick start using Ubuntu Ground Station
|
||||
|
||||
A: Original version of wifibroadcast use a byte-stream as input and splits it to packets of fixed size (1024 by default). If radio packet was lost and this is not corrected by FEC you'll got a hole at random (unexpected) place of stream. This is especially bad if data protocol is not resistent to (was not desired for) such random erasures. So i've rewrite it to use UDP as data source and pack one source UDP packet into one radio packet. Radio packets now have variable size depends on payload size. This is reduces a video latency a lot.
|
||||
- Install patched `RTL8812AU`driver:
|
||||
```
|
||||
sudo apt-get install dkms
|
||||
git clone https://github.com/svpcom/rtl8812au.git
|
||||
cd rtl8812au/
|
||||
sudo ./dkms-install.sh
|
||||
```
|
||||
- Make sure the driver is correctly installed by running the following command. You should see the WiFi card in an `unmanaged` state.
|
||||
```
|
||||
nmcli
|
||||
```
|
||||
- Get the name of the WiFi card by running:
|
||||
```
|
||||
ifconfig
|
||||
```
|
||||
- You should see output similar to:
|
||||
```
|
||||
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 2312
|
||||
ether 0c:91:60:0a:5a:8b txqueuelen 1000 (Ethernet)
|
||||
RX packets 0 bytes 0 (0.0 B)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 0 bytes 0 (0.0 B)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
```
|
||||
- Copy the name of the RTL8812AU WiFi card.
|
||||
- Install wfb-ng. Replace `wifi0`with the previously copied name of the WiFi card.
|
||||
```
|
||||
git clone https://github.com/svpcom/wifibroadcast.git
|
||||
cd wifibroadcast
|
||||
sudo sh install_gs.sh wifi0
|
||||
```
|
||||
- Done! To monitor the link use the following command on the ground station:
|
||||
```
|
||||
wfb-cli gs
|
||||
```
|
||||
|
||||
## Warranty/Disclaimer
|
||||
This is free software and comes with no warranty, as stated in parts 15 and 16 of the GPLv3 license. The creators and contributors of the software are not responsible for how it is used.
|
||||
See [License and Support](https://github.com/svpcom/wifibroadcast/wiki/License-and-Support) for details.
|
||||
|
||||
**Failing to get connection?**
|
||||
|
||||
Make sure the WiFi channel on the ground and on the drone are the same. To check, use:
|
||||
```
|
||||
head /etc/wifibroadcast.cfg
|
||||
```
|
||||
|
||||
You should see output similar to:
|
||||
```
|
||||
[common]
|
||||
wifi_channel = 161 # 161 -- radio channel @5825 MHz, range: 5815–5835 MHz, width 20MHz
|
||||
# 1 -- radio channel @2412 Mhz,
|
||||
# see https://en.wikipedia.org/wiki/List_of_WLAN_channels for reference
|
||||
```
|
||||
Ensure the WiFi channel selected is the same on the ground and on the drone.
|
||||
|
||||
## Support project
|
||||
If you like WFB-ng you can make a donation to `bitcoin:bc1qfvlsvr0ea7tzzydngq5cflf4yypemlacgt6t05`
|
||||
|
||||
---
|
||||
|
||||
|
||||
## FAQ
|
||||
**Q: What type of data can be transmitted using WFB-NG?**
|
||||
|
||||
**A:** Any UDP with packet size <= 1466. For example x264 inside RTP or Mavlink.
|
||||
|
||||
**Q: What are transmission guarancies?**
|
||||
|
||||
**A:** Wifibrodcast use FEC (forward error correction) which can recover 4 lost packets from 12 packets block with default settings. You can tune it (both TX and RX simultaniuosly!) to fit your needs.
|
||||
|
||||
**Q: Is only Raspberry PI supported?**
|
||||
|
||||
**A:** WFB-NG is not tied to any GPU - it operates with UDP packets. But to get RTP stream you need a video encoder (with encode raw data from camera to x264 stream). In my case RPI is only used for video encoding (becase RPI Zero is too slow to do anything else) and all other tasks (including WFB-NG) are done by other board (NanoPI NEO2).
|
||||
|
||||
**Q: What is a difference from original wifibroadcast?**
|
||||
|
||||
**A:** Original version of wifibroadcast use a byte-stream as input and splits it to packets of fixed size (1024 by default). If radio packet was lost and this is not corrected by FEC you'll got a hole at random (unexpected) place of stream. This is especially bad if data protocol is not resistent to (was not desired for) such random erasures. So i've rewrite it to use UDP as data source and pack one source UDP packet into one radio packet. Radio packets now have variable size depends on payload size. This is reduces a video latency a lot.
|
||||
|
||||
## Theory
|
||||
WFB-NG puts the wifi cards into monitor mode. This mode allows to send and receive arbitrary packets without association and waiting for ACK packets.
|
||||
[Analysis of Injection Capabilities and Media Access of IEEE 802.11 Hardware in Monitor Mode](https://github.com/svpcom/wifibroadcast/blob/master/patches/Analysis%20of%20Injection%20Capabilities%20and%20Media%20Access%20of%20IEEE%20802.11%20Hardware%20in%20Monitor%20Mode.pdf)
|
||||
@ -109,9 +201,6 @@ My primary hardware targets are:
|
||||
|
||||
To maximize output power and/or increase bandwidth (in case of one-way transmitting) you need to apply kernel patches from ``patches`` directory. See https://github.com/svpcom/wifibroadcast/wiki/Kernel-patches for details.
|
||||
|
||||
WFB-NG + PX4 HOWTO:
|
||||
--------------------------
|
||||
https://dev.px4.io/en/qgc/video_streaming_wifi_broadcast.html
|
||||
|
||||
Wiki:
|
||||
-----
|
||||
|
62
install_gs.sh
Normal file
62
install_gs.sh
Normal file
@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Install required packages
|
||||
apt update
|
||||
apt upgrade
|
||||
|
||||
apt install python3-all libpcap-dev libsodium-dev python3-pip python3-pyroute2 python3-future python3-twisted
|
||||
apt install virtualenv
|
||||
apt install debhelper
|
||||
apt install dh-python build-essential
|
||||
|
||||
# Build
|
||||
make deb
|
||||
|
||||
# Create key and copy to right location
|
||||
./wfb_keygen
|
||||
mv gs.key /etc/gs.key
|
||||
|
||||
# Install
|
||||
dpkg -i deb_dist/*.deb
|
||||
|
||||
# Setup system
|
||||
echo net.core.bpf_jit_enable = 1 >> /etc/sysctl.conf
|
||||
|
||||
# Setup config
|
||||
cat <<EOT >> /etc/wifibroadcast.cfg
|
||||
[common]
|
||||
wifi_channel = 161 # 161 -- radio channel @5825 MHz, range: 5815–5835 MHz, width 20MHz
|
||||
# 1 -- radio channel @2412 Mhz,
|
||||
# see https://en.wikipedia.org/wiki/List_of_WLAN_channels for reference
|
||||
wifi_region = 'BO' # Your country for CRDA (use BO or GY if you want max tx power)
|
||||
|
||||
[gs_mavlink]
|
||||
peer = 'connect://127.0.0.1:14550' # outgoing connection
|
||||
# peer = 'listen://0.0.0.0:14550' # incoming connection
|
||||
|
||||
[gs_video]
|
||||
peer = 'connect://127.0.0.1:5600' # outgoing connection for
|
||||
# video sink (QGroundControl on GS)
|
||||
EOT
|
||||
|
||||
cat <<EOT >> /etc/default/wifibroadcast
|
||||
WFB_NICS="$0"
|
||||
EOT
|
||||
|
||||
cat <<EOT >> /etc/NetworkManager/NetworkManager.conf
|
||||
[keyfile]
|
||||
unmanaged-devices=interface-name:$1
|
||||
EOT
|
||||
|
||||
FILE=/etc/dhcpcd.conf
|
||||
if [ -f "$FILE" ]; then
|
||||
cat <<EOT >> /etc/dhcpcd.conf
|
||||
denyinterfaces $1
|
||||
EOT
|
||||
fi
|
||||
|
||||
# Start gs service
|
||||
systemctl daemon-reload
|
||||
systemctl start wifibroadcast@gs
|
||||
|
||||
echo "Started wfg-ng@gs"
|
Loading…
Reference in New Issue
Block a user