[no ci] Package: format datalink/wifibroadcast scripts

pull/1274/head
Viktor 2024-01-22 10:28:20 +01:00
parent a0626194f7
commit a992eea345
4 changed files with 72 additions and 73 deletions

View File

@ -2,54 +2,54 @@
#
# Start fpv datalink
#
. /etc/datalink.conf
chip=$(ipcinfo -c)
fw=$(grep "BUILD_OPTION" "/etc/os-release" | cut -d= -f2)
case "$1" in
start)
if ! [ -f /etc/system.ok ]; then
tweaksys ${chip}
fi
start)
if ! [ -f /etc/system.ok ]; then
tweaksys ${chip}
fi
echo "Starting FPV datalink..."
if [ ${fw} = "lte" ]; then
if [ ${usb_modem} = "true" ]; then
echo "Starting FPV datalink..."
if [ ${fw} = "lte" ]; then
if [ ${usb_modem} = "true" ]; then
echo "Starting lte modem configuration..."
echo "ToDo: Running usb_modeswitch or other shit here..."
fi
# for the future
#cli -s .outgoing.url1 udp://${gs_ipaddr}:${gs_port}
if [ ${use_zt} = "true" ]; then
fi
# for the future
#cli -s .outgoing.url1 udp://${gs_ipaddr}:${gs_port}
if [ ${use_zt} = "true" ]; then
echo "Starting ZeroTier-One daemon..."
/usr/sbin/zerotier-one -d &
if [ ! -f /var/lib/zerotier-one/networks.d/${zt_netid}.conf ]; then
sleep 8
zerotier-cli join ${zt_netid} &> /dev/null
echo "Don't forget authorize in the my.zerotier.com!"
sleep 8
zerotier-cli join ${zt_netid} &> /dev/null
echo "Don't forget authorize in the my.zerotier.com!"
fi
fi
if [ ${telemetry} = "true" ]; then
fi
if [ ${telemetry} = "true" ]; then
telemetry start
fi
else
echo "Starting wifibroadcast service..."
wifibroadcast start
fi
;;
stop)
echo "Stopping all services..."
kill -9 $(pidof wfb_tx)
kill -9 $(pidof wfb_rx)
kill -9 $(pidof telemetry_rx)
kill -9 $(pidof telemetry_tx)
kill -9 $(pidof mavlink-routerd)
kill -9 $(pidof mavfwd)
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
fi
else
echo "Starting wifibroadcast service..."
wifibroadcast start
fi
;;
stop)
echo "Stopping all services..."
killall -q wfb_tx
killall -q wfb_rx
killall -q telemetry_rx
killall -q telemetry_tx
killall -q mavlink-routerd
killall -q mavfwd
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac

View File

@ -113,7 +113,6 @@ finish() {
case "$1" in
gk7205v200 | gk7205v210 | hi3516ev200)
echo "Preparing system tweaks for ${chip}..."
# set custom config
if [ ${chip} = "gk7205v200" ] && [ ${sensor} = "imx307" ]; then
echo "switch to custom sensor config"
@ -136,6 +135,7 @@ case "$1" in
streamer
finish
;;
gk7205v300 | hi3516ev300)
echo "Preparing system tweaks for ${chip}..."
@ -152,27 +152,29 @@ case "$1" in
streamer
finish
;;
t31l | t31n | t31x | t31zx)
echo "Preparing system tweaks for ${chip}..."
basic
streamer
finish
;;
hi3536dv100)
echo "Preparing system tweaks for ${chip}..."
finish
;;
ssc33x)
echo "Preparing system tweaks for ${chip}..."
basic
sigmastar
streamer
finish
;;
*)
echo "Usage: $0 {gk7205v200|gk7205v210|gk7205v300|hi3516ev200|hi3516ev300|t31l|t31n|t31x|t31zx|hi3536dv100|ssc33x}"
exit 1
;;
esac

View File

@ -1,36 +1,38 @@
#!/bin/sh
#
# Change Atheros MCS
# Change Atheros MCS
# Author: Tipo Man
vendor=$(ipcinfo -v)
case "$1" in
"1")
echo '1-1' > /sys/bus/usb/drivers/usb/unbind
if [ ${vendor} = "ingenic" ]; then
rm /lib/firmware/htc_9271.fw
ln -s /lib/firmware/ath9k_htc/htc_9271.fw.1 /lib/firmware/htc_9271.fw
else
rm /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
ln -s /lib/firmware/ath9k_htc/htc_9271.fw.1 /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
fi
echo '1-1' > /sys/bus/usb/drivers/usb/bind
echo "Loaded firmware with MCS"$1
;;
"3")
echo '1-1' > /sys/bus/usb/drivers/usb/unbind
if [ ${vendor} = "ingenic" ]; then
rm /lib/firmware/htc_9271.fw
ln -s /lib/firmware/ath9k_htc/htc_9271.fw.3 /lib/firmware/htc_9271.fw
else
rm /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
ln -s /lib/firmware/ath9k_htc/htc_9271.fw.3 /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
fi
echo '1-1' > /sys/bus/usb/drivers/usb/bind
echo "Loaded firmware with MCS"$1
;;
"1")
echo '1-1' > /sys/bus/usb/drivers/usb/unbind
if [ ${vendor} = "ingenic" ]; then
rm /lib/firmware/htc_9271.fw
ln -s /lib/firmware/ath9k_htc/htc_9271.fw.1 /lib/firmware/htc_9271.fw
else
rm /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
ln -s /lib/firmware/ath9k_htc/htc_9271.fw.1 /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
fi
echo '1-1' > /sys/bus/usb/drivers/usb/bind
echo "Loaded firmware with MCS"$1
;;
"3")
echo '1-1' > /sys/bus/usb/drivers/usb/unbind
if [ ${vendor} = "ingenic" ]; then
rm /lib/firmware/htc_9271.fw
ln -s /lib/firmware/ath9k_htc/htc_9271.fw.3 /lib/firmware/htc_9271.fw
else
rm /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
ln -s /lib/firmware/ath9k_htc/htc_9271.fw.3 /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
fi
echo '1-1' > /sys/bus/usb/drivers/usb/bind
echo "Loaded firmware with MCS"$1
;;
*)
echo "Only MCS 1 or 3 supported!"
;;
echo "Only MCS 1 or 3 supported!"
;;
esac

View File

@ -43,11 +43,6 @@ detect_wifi_card() {
modprobe 88XXau rtw_tx_pwr_idx_override=${driver_txpower_override}
;;
"0bda:f72b")
driver="realtek"
modprobe 8733bu
;;
"0cf3:9271" | "040d:3801")
driver="atheros"
if ! [ ${unit} = "gs" ]; then