Add msposd tunnel support

pull/1715/head
Daniel Li 2025-02-26 09:34:05 +08:00
parent fb525438e1
commit bada6ae2ab
2 changed files with 15 additions and 6 deletions

View File

@ -24,9 +24,7 @@ start_drone_telemetry() {
-M "$mcs_index" -S "$stbc" -L "$ldpc" -G "$guard_interval" -k "$fec_k" -n "$fec_n" \
-T "$pool_timeout" -i "$link_id" -f "$frame_type" "$wlan" > /dev/null &
elif [ "$router" -eq 3 ]; then
# Increment $port_tx by 1 if $router is equal to 3 for ground station OSD
port_tx=$((port_tx + 1))
telemetry_tx -p "$stream_tx" -u "$port_tx" -K "$keydir/$unit.key" -B "$bandwidth" \
telemetry_tx -p "$stream_tx" -u "$tel_port" -K "$keydir/$unit.key" -B "$bandwidth" \
-M "$mcs_index" -S "$stbc" -L "$ldpc" -G "$guard_interval" -k "$fec_k" -n "$fec_n" \
-T "$pool_timeout" -i "$link_id" -f "$frame_type" "$wlan" > /dev/null &
fi
@ -49,10 +47,13 @@ case "$1" in
else
if [ "$router" -eq 2 ]; then
msposd --channels "$channels" --master "$serial" --baudrate "$baud" \
--out 127.0.0.1:$(($port_tx + 1)) -osd -r "$fps" --ahi "$ahi" > /dev/null &
--out 127.0.0.1:$tel_port -osd -r "$fps" --ahi "$ahi" > /dev/null &
elif [ "$router" -eq 3 ]; then
msposd --channels "$channels" --master "$serial" --baudrate "$baud" \
--out 127.0.0.1:$(($port_tx + 1)) -r "$fps" --ahi "$ahi" > /dev/null &
--out 127.0.0.1:$tel_port -r "$fps" --ahi "$ahi" > /dev/null &
elif [ "$router" -eq 4 ]; then
msposd --channels "$channels" --master "$serial" --baudrate "$baud" \
--out $tun_ip:$tun_port -r "$fps" --ahi "$ahi" > /dev/null &
else
mavfwd --channels "$channels" --master "$serial" --baudrate "$baud" -p 100 -t -a "$aggregate" \
--out 127.0.0.1:$port_tx --in 127.0.0.1:$port_rx > /dev/null &

View File

@ -4,7 +4,12 @@ unit=drone
serial=/dev/ttyAMA0
baud=115200
### router: use simple mavfwd (0), classic mavlink-routerd (1) or msposd instead of mavfwd (2)
### router:
# 0: simple mavfwd (default)
# 1: classic mavlink-routerd
# 2: msposd airunit embedded osd
# 3: msposd ground osd using telemetry
# 4: msposd ground osd using tunnel
router=0
wlan=wlan0
@ -31,3 +36,6 @@ channels=8
### for msposd: OSD over video
fps=20
ahi=0
tel_port=14551
tun_ip=10.5.0.1
tun_port=5000