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

View File

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

View File

@ -7,30 +7,32 @@ vendor=$(ipcinfo -v)
case "$1" in case "$1" in
"1") "1")
echo '1-1' > /sys/bus/usb/drivers/usb/unbind echo '1-1' > /sys/bus/usb/drivers/usb/unbind
if [ ${vendor} = "ingenic" ]; then if [ ${vendor} = "ingenic" ]; then
rm /lib/firmware/htc_9271.fw rm /lib/firmware/htc_9271.fw
ln -s /lib/firmware/ath9k_htc/htc_9271.fw.1 /lib/firmware/htc_9271.fw ln -s /lib/firmware/ath9k_htc/htc_9271.fw.1 /lib/firmware/htc_9271.fw
else else
rm /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw 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 ln -s /lib/firmware/ath9k_htc/htc_9271.fw.1 /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
fi fi
echo '1-1' > /sys/bus/usb/drivers/usb/bind echo '1-1' > /sys/bus/usb/drivers/usb/bind
echo "Loaded firmware with MCS"$1 echo "Loaded firmware with MCS"$1
;; ;;
"3") "3")
echo '1-1' > /sys/bus/usb/drivers/usb/unbind echo '1-1' > /sys/bus/usb/drivers/usb/unbind
if [ ${vendor} = "ingenic" ]; then if [ ${vendor} = "ingenic" ]; then
rm /lib/firmware/htc_9271.fw rm /lib/firmware/htc_9271.fw
ln -s /lib/firmware/ath9k_htc/htc_9271.fw.3 /lib/firmware/htc_9271.fw ln -s /lib/firmware/ath9k_htc/htc_9271.fw.3 /lib/firmware/htc_9271.fw
else else
rm /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw 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 ln -s /lib/firmware/ath9k_htc/htc_9271.fw.3 /lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
fi fi
echo '1-1' > /sys/bus/usb/drivers/usb/bind echo '1-1' > /sys/bus/usb/drivers/usb/bind
echo "Loaded firmware with MCS"$1 echo "Loaded firmware with MCS"$1
;; ;;
*) *)
echo "Only MCS 1 or 3 supported!" echo "Only MCS 1 or 3 supported!"
;; ;;
esac esac

View File

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