Skip to content

Commit b35eab0

Browse files
committed
Update install_gs.sh
1 parent 1613daf commit b35eab0

File tree

3 files changed

+77
-15
lines changed

3 files changed

+77
-15
lines changed

README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,10 @@ wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 2312
111111
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
112112
```
113113
- Run `$ ethtool -i wlan0` and ensure that it show right driver: `rtl88xxau_wfb` or `rtl8812eu`
114-
- Copy the name of the RTL8812AU/EU WiFi card.
115-
- Install wfb-ng. Replace `wlan0` with the previously copied name of the WiFi card.
114+
- Download and run [install_gs.sh](https://raw.githubusercontent.com/svpcom/wfb-ng/refs/heads/master/scripts/install_gs.sh):
116115
```
117-
git clone -b stable https://github.com/svpcom/wfb-ng.git
118-
cd wfb-ng
119-
sudo ./scripts/install_gs.sh
116+
curl -o install_gs.sh https://raw.githubusercontent.com/svpcom/wfb-ng/refs/heads/master/scripts/install_gs.sh
117+
sudo bash ./install_gs.sh
120118
```
121119
- Done! To monitor the link use the following command on the ground station:
122120
```

scripts/install_gs.sh

+73-9
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,32 @@ nics="$*"
55
auto_nics=0
66
release=master
77

8+
if [ $(id -u) != "0" ]
9+
then
10+
echo "Root access is required. Run: sudo $0 $*"
11+
exit 1
12+
fi
13+
14+
err_handler()
15+
{
16+
echo "WFB-ng setup failed"
17+
exit 1
18+
}
19+
20+
wfb_nics()
21+
{
22+
for i in $(find /sys/class/net/ -maxdepth 1 -type l | sort)
23+
do
24+
if udevadm info $i | grep -qE 'ID_NET_DRIVER=(rtl88xxau_wfb|rtl88x2eu)'
25+
then
26+
echo $(basename $i)
27+
fi
28+
done
29+
}
30+
831
if [ -z "$nics" ]
932
then
10-
nics="$($(dirname $0)/wfb-nics)"
33+
nics="$(wfb_nics)"
1134
auto_nics=1
1235
fi
1336

@@ -19,24 +42,31 @@ then
1942
exit 1
2043
fi
2144

45+
trap err_handler ERR
46+
2247
# Try to install prebuilt packages from wfb-ng apt repository
2348

24-
curl -s https://apt.wfb-ng.org/public.asc | sudo gpg --dearmor --yes -o /usr/share/keyrings/wfb-ng.gpg
25-
echo "deb [signed-by=/usr/share/keyrings/wfb-ng.gpg] https://apt.wfb-ng.org/ $(lsb_release -cs) $release" | sudo tee /etc/apt/sources.list.d/wfb-ng.list
26-
sudo apt update
49+
curl -s https://apt.wfb-ng.org/public.asc | gpg --dearmor --yes -o /usr/share/keyrings/wfb-ng.gpg
50+
echo "deb [signed-by=/usr/share/keyrings/wfb-ng.gpg] https://apt.wfb-ng.org/ $(lsb_release -cs) $release" > /etc/apt/sources.list.d/wfb-ng.list
2751

28-
if ! sudo apt -y install wfb-ng
52+
if ! apt update
53+
then
54+
rm -f /etc/apt/sources.list.d/wfb-ng.list /usr/share/keyrings/wfb-ng.gpg
55+
apt update
56+
fi
57+
58+
if ! apt -y install wfb-ng
2959
then
3060
# Install required packages for wfb-ng source build
3161

3262
apt -y install python3-all python3-all-dev libpcap-dev libsodium-dev libevent-dev python3-pip python3-pyroute2 python3-msgpack \
3363
python3-future python3-twisted python3-serial python3-jinja2 iw virtualenv debhelper dh-python fakeroot build-essential \
34-
libgstrtspserver-1.0-dev
64+
libgstrtspserver-1.0-dev socat git
3565

3666
tmpdir="$(mktemp -d)"
3767
git clone -b $release --depth 1 https://github.com/svpcom/wfb-ng.git "$tmpdir"
3868

39-
(cd "$tmpdir" && make deb && sudo apt -y install ./deb_dist/*.deb)
69+
(cd "$tmpdir" && make deb && apt -y install ./deb_dist/*.deb)
4070
rm -rf "$tmpdir"
4171
fi
4272

@@ -52,7 +82,7 @@ else
5282
fi
5383

5484
# Setup config
55-
cat <<EOF >> /etc/wifibroadcast.cfg
85+
cat <<EOF > /etc/wifibroadcast.cfg
5686
[common]
5787
wifi_channel = 165 # 165 -- radio channel @5825 MHz, range: 5815–5835 MHz, width 20MHz
5888
# 1 -- radio channel @2412 Mhz,
@@ -82,13 +112,47 @@ options 8812eu rtw_tx_pwr_by_rate=0 rtw_tx_pwr_lmt_enable=0
82112
EOF
83113

84114
if [ -f /etc/dhcpcd.conf ]; then
85-
echo "denyinterfaces $(nics)" >> /etc/dhcpcd.conf
115+
echo "denyinterfaces $nics" >> /etc/dhcpcd.conf
86116
fi
87117

118+
cat > /etc/motd <<__EOF__
119+
WFB-ng: http://wfb-ng.org
120+
Setup HOWTO: https://github.com/svpcom/wfb-ng/wiki/Setup-HOWTO
121+
Community chat: (wfb-ng support) https://t.me/wfb_ng
122+
123+
Version: $release
124+
125+
Quickstart (x86 laptop):
126+
1. Run "wfb-cli gs" to monitor link state
127+
2. Run QGroundControl
128+
129+
Quickstart (SBC + RTP video):
130+
1. Run "wfb-cli gs" to monitor link state
131+
2. Edit /etc/wifibroadcast.cfg and in section [gs_video] set peer to ip address of your laptop with QGC
132+
3. Edit /etc/wifibroadcast.cfg and in section [gs_mavlink] set peer to ip address of your laptop with QGC
133+
4. Reboot SBC.
134+
5. Run QGroundControl on your laptop
135+
136+
Quickstart (SBC + RTSP video):
137+
1. Run "wfb-cli gs" to monitor link state
138+
2. Run "sudo systemctl enable rtsp@h264" or "sudo systemctl enable rtsp@h265" (according to your video codec)
139+
3. Edit /etc/wifibroadcast.cfg and in section [gs_mavlink] set peer to ip address of your laptop with QGC
140+
4. Reboot SBC.
141+
5. Run QGroundControl on your laptop. Set video QGC source to rtsp://x.x.x.x:8554/wfb , where x.x.x.x is GS IP address.
142+
6. (optional) Run any other RTSP video player(s) for rtsp://x.x.x.x:8554/wfb
143+
144+
To set TX power edit /etc/modprobe.d/wfb.conf and reboot.
145+
146+
In case of any failures check "sudo systemctl status wifibroadcast@gs" service status.
147+
See full logs via: "sudo journalctl -xu wifibroadcast@gs"
148+
__EOF__
149+
88150
# Start gs service
89151
systemctl daemon-reload
90152
systemctl start wifibroadcast@gs
91153
systemctl status wifibroadcast@gs
92154
systemctl enable wifibroadcast@gs
93155

156+
cat /etc/motd
157+
echo
94158
echo "GS setup successfully finished"

stdeb.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[DEFAULT]
2-
Depends3: python3-twisted, libpcap-dev, libsodium-dev, libevent-dev, python3-pyroute2, python3-future, python3-serial, python3-msgpack, python3-jinja2, python3-yaml, socat, libgstrtspserver-1.0-dev
2+
Depends3: python3-twisted, libpcap-dev, libsodium-dev, libevent-dev, python3-pyroute2, python3-future, python3-serial, python3-msgpack, python3-jinja2, python3-yaml, socat, iw, libgstrtspserver-1.0-dev
33
Package3: wfb-ng
44
Replaces3: wifibroadcast
55
Maintainer: Vasily Evseenko <svpcom@p2ptech.org>

0 commit comments

Comments
 (0)