From 03f094c033248053f0a9284b1427e2f5dafd70f0 Mon Sep 17 00:00:00 2001 From: viktorxda <35473052+viktorxda@users.noreply.github.com> Date: Wed, 16 Apr 2025 15:18:29 +0200 Subject: [PATCH] [no ci] Package: update wifibroadcast-ng (#1798) --- .../package/wifibroadcast-ng/files/wfb.yaml | 1 + .../wifibroadcast-ng/files/wifibroadcast | 24 +++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/general/package/wifibroadcast-ng/files/wfb.yaml b/general/package/wifibroadcast-ng/files/wfb.yaml index cd0b3851..a92b1b6b 100644 --- a/general/package/wifibroadcast-ng/files/wfb.yaml +++ b/general/package/wifibroadcast-ng/files/wfb.yaml @@ -2,6 +2,7 @@ wireless: txpower: 1 channel: 161 width: 20 + mlink: 1500 broadcast: mcs_index: 2 tun_index: 1 diff --git a/general/package/wifibroadcast-ng/files/wifibroadcast b/general/package/wifibroadcast-ng/files/wifibroadcast index fb432cff..7f5c6c55 100755 --- a/general/package/wifibroadcast-ng/files/wifibroadcast +++ b/general/package/wifibroadcast-ng/files/wifibroadcast @@ -18,8 +18,9 @@ wfb_yaml() { } load_config() { + wfb_yaml /rom"$wfb_cfg" wfb_yaml "$wfb_cfg" - [ ! -e "$wfb_key" ] && wfb_key=/rom/etc/drone.key + [ ! -e "$wfb_key" ] && wfb_key=/rom"$wfb_key" } load_modules() { @@ -48,8 +49,12 @@ load_modules() { [ -e /sys/class/net/"$wfb_dev" ] && return sleep 1 - [ "$driver" != "88XXau" ] && opts="rtw_tx_pwr_by_rate=2 rtw_tx_pwr_lmt_enable=2" - modprobe "$driver" "$opts" + if [ "$driver" != "88XXau" ]; then + opt1="rtw_tx_pwr_by_rate=2" + opt2="rtw_tx_pwr_lmt_enable=2" + fi + + modprobe "$driver" "$opt1" "$opt2" sleep 3 if ! ifconfig "$wfb_dev" up; then @@ -58,6 +63,16 @@ load_modules() { fi } +load_mlink() { + ifconfig "$wfb_dev" mtu "$mlink" + + nalu=$((mlink - 100)) + if [ "$(cli -g .outgoing.naluSize)" != "$nalu" ]; then + cli -s .outgoing.naluSize "$nalu" + killall -1 majestic + fi +} + load_interface() { iw "$wfb_dev" set monitor none @@ -126,6 +141,7 @@ video_settings() { start() { load_config load_modules + load_mlink load_interface if [ ! -e /etc/system.ok ]; then @@ -155,7 +171,7 @@ case "$1" in ;; reset) - cp -f /rom/"$wfb_cfg" "$wfb_cfg" + cp -f /rom"$wfb_cfg" "$wfb_cfg" cp -f /rom/etc/majestic.yaml /etc/majestic.yaml video_settings ;;