commit 3d8af3debb9f0130af14959c27aa23284da0d2b7 Author: pali112 Date: Wed Apr 8 23:13:35 2026 +0800 first commit diff --git a/alink_gs.conf b/alink_gs.conf new file mode 100644 index 0000000..59cd745 --- /dev/null +++ b/alink_gs.conf @@ -0,0 +1,40 @@ +# adaptive-link VRX settings + +[outgoing] +udp_ip = 10.5.0.10 +udp_port = 9999 + +[json] +HOST = 127.0.0.1 +PORT = 8103 + +[weights] +snr_weight = 0.5 +rssi_weight = 0.5 + +[ranges] +SNR_MIN = 10 +SNR_MAX = 36 +RSSI_MIN = -85 +RSSI_MAX = -40 + +[keyframe] +allow_idr = True +idr_max_messages = 20 + +[dynamic refinement] +allow_penalty = False +allow_fec_increase = False + +[noise] +min_noise = 0.01 +max_noise = 0.1 +deduction_exponent = 0.5 +min_noise_for_fec_change = 0.01 +noise_for_max_fec_change = 0.1 + +[error estimation] +kalman_estimate = 0.005 +kalman_error_estimate = 0.1 +process_variance = 1e-5 +measurement_variance = 0.01 diff --git a/config_osd.json b/config_osd.json new file mode 100644 index 0000000..75bc8b7 --- /dev/null +++ b/config_osd.json @@ -0,0 +1,186 @@ +{ + "format": "0.0.1", + "assets_dir": "/usr/share/pixelpilot/", + "widgets": [ + { + "type": "IconSelectorWidget", + "name": "RSSI of antenna 1", + "x": -96, + "y": 0, + "facts": [ + {"name": "wfbcli.rx.ant_stats.rssi_avg","tags": {"ant_id": "0", "id": "video rx"}} + ], + "ranges_and_icons": [ + {"range": [-49, 1], "icon_path": "signal1.png"}, + {"range": [-59, -50],"icon_path": "signal2.png"}, + {"range": [-69, -60],"icon_path": "signal3.png"}, + {"range": [-79, -70],"icon_path": "signal4.png"}, + {"range": [-130, -80],"icon_path": "signal5.png"} + ] + }, + { + "type": "IconSelectorWidget", + "name": "RSSI of antenna 2", + "x": -192, + "y": 0, + "facts": [ + {"name": "wfbcli.rx.ant_stats.rssi_avg","tags": {"ant_id": "1", "id": "video rx"}} + ], + "ranges_and_icons": [ + {"range": [-49, 1], "icon_path": "signal1.png"}, + {"range": [-59, -50],"icon_path": "signal2.png"}, + {"range": [-69, -60],"icon_path": "signal3.png"}, + {"range": [-79, -70],"icon_path": "signal4.png"}, + {"range": [-130, -80],"icon_path": "signal5.png"} + ], + "calculation": "wfbcli_rx_ant_stats_rssi_avg_ant_id_1_id_video_rx" + }, + { + "type": "IconSelectorWidget", + "name": "RSSI of antenna 3", + "x": -288, + "y": 0, + "facts": [ + {"name": "wfbcli.rx.ant_stats.rssi_avg","tags": {"ant_id": "256", "id": "video rx"}} + ], + "ranges_and_icons": [ + {"range": [-49, 1], "icon_path": "signal1.png"}, + {"range": [-59, -50],"icon_path": "signal2.png"}, + {"range": [-69, -60],"icon_path": "signal3.png"}, + {"range": [-79, -70],"icon_path": "signal4.png"}, + {"range": [-130, -80],"icon_path": "signal5.png"} + ] + }, + { + "type": "IconSelectorWidget", + "name": "RSSI of antenna 4", + "x": -384, + "y": 0, + "facts": [ + {"name": "wfbcli.rx.ant_stats.rssi_avg","tags": {"ant_id": "257", "id": "video rx"}} + ], + "ranges_and_icons": [ + {"range": [-49, 1], "icon_path": "signal1.png"}, + {"range": [-59, -50],"icon_path": "signal2.png"}, + {"range": [-69, -60],"icon_path": "signal3.png"}, + {"range": [-79, -70],"icon_path": "signal4.png"}, + {"range": [-130, -80],"icon_path": "signal5.png"} + ] + }, + { + "type": "IconSelectorWidget", + "name": "RSSI of antenna 5", + "x": -480, + "y": 0, + "facts": [ + {"name": "wfbcli.rx.ant_stats.rssi_avg","tags": {"ant_id": "512", "id": "video rx"}} + ], + "ranges_and_icons": [ + {"range": [-49, 1], "icon_path": "signal1.png"}, + {"range": [-59, -50],"icon_path": "signal2.png"}, + {"range": [-69, -60],"icon_path": "signal3.png"}, + {"range": [-79, -70],"icon_path": "signal4.png"}, + {"range": [-130, -80],"icon_path": "signal5.png"} + ] + }, + { + "type": "IconSelectorWidget", + "name": "RSSI of antenna 6", + "x": -576, + "y": 0, + "facts": [ + {"name": "wfbcli.rx.ant_stats.rssi_avg","tags": {"ant_id": "513", "id": "video rx"}} + ], + "ranges_and_icons": [ + {"range": [-49, 1], "icon_path": "signal1.png"}, + {"range": [-59, -50],"icon_path": "signal2.png"}, + {"range": [-69, -60],"icon_path": "signal3.png"}, + {"range": [-79, -70],"icon_path": "signal4.png"}, + {"range": [-130, -80],"icon_path": "signal5.png"} + ] + }, + { + "name": "Metrics background", + "type": "BoxWidget", + "x": -270, + "y": 100, + "width": 270, + "height": 100, + "color": { + "r": 0.0, + "g": 0.0, + "b": 0.0, + "alpha": 0.4 + }, + "facts": [] + }, + { + "name": "Video FPS and resolution", + "type": "VideoWidget", + "x": -250, + "y": 126, + "icon_path": "framerate.png", + "template": "%u fps | %ux%u", + "per_second_window_s": 2, + "per_second_bucket_ms": 200, + "facts": [ + { + "__comment": "Will be converted to per-second", + "name": "video.displayed_frame" + }, + { + "name": "video.width" + }, + { + "name": "video.height" + } + ] + }, + { + "name": "Video link throughput", + "type": "VideoBitrateWidget", + "x": -250, + "y": 156, + "icon_path": "network.png", + "template": "%f Mbps", + "per_second_window_s": 2, + "per_second_bucket_ms": 100, + "facts": [ + { + "__comment": "Should be sum per-second, scaled to Megs", + "name": "gstreamer.received_bytes" + } + ] + }, + { + "name": "DVR status", + "type": "DvrStatusWidget", + "x": -250, + "y": 186, + "icon_path": "sdcard-white.png", + "text": "Recording", + "facts": [ + {"name": "dvr.recording"} + ] + }, + { + "name": "Custom fading message", + "type": "PopupWidget", + "x": 400, + "y": 50, + "timeout_ms": 10000, + "facts": [ + {"name": "osd.custom_message"} + ] + }, + { + "name": "msposd", + "type": "ExternalSurfaceWidget", + "x": 0, + "y": 0, + "width": 0, + "height": 0, + "facts": [] + } + ] +} diff --git a/scripts/autoload-wfb-nics.sh b/scripts/autoload-wfb-nics.sh new file mode 100755 index 0000000..87b0571 --- /dev/null +++ b/scripts/autoload-wfb-nics.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# Initialize log file and type variables +LOG_FILE="" +TYPE="" + +# Parse arguments +while [[ "$#" -gt 0 ]]; do + case $1 in + --log) + LOG_FILE="$2" + shift + ;; + --type) + TYPE="$2" + shift + ;; + *) + echo "Unknown parameter passed: $1" + exit 1 + ;; + esac + shift +done + +# Initialize an empty string to store matching interface names +matching_interfaces="" + +# List all network interfaces and filter only wireless ones +for iface in /sys/class/net/*; do + iface_name=$(basename $iface) + # Check if the interface is wireless and usb + if [ -d "/sys/class/net/$iface_name/wireless" ] && [[ "$(readlink -f /sys/class/net/$iface_name/device/subsystem)" == *"usb"* ]]; then + # Append the interface name to the list + matching_interfaces+="$iface_name " + fi +done + +# Output the list of matching interfaces as a space-separated string +new_wfb_nics="WFB_NICS=\"${matching_interfaces% }\"" + +# Read the current contents of /etc/default/wifibroadcast +current_wfb_nics=$(cat /etc/default/wifibroadcast 2>/dev/null) + +# Compare and update if different +if [[ "$current_wfb_nics" != "$new_wfb_nics" ]]; then + echo "$new_wfb_nics" >/etc/default/wifibroadcast + systemctl restart wifibroadcast & + # Log to file if --log argument was provided + if [[ -n "$LOG_FILE" ]]; then + echo "$(date) [$TYPE]: Network interface $ACTION $INTERFACE" >>"$LOG_FILE" + echo "$(date) [$TYPE]: $new_wfb_nics" >>"$LOG_FILE" + echo "$(date) [$TYPE]: Restarting Wifibroadcast service" >>"$LOG_FILE" + fi +fi \ No newline at end of file diff --git a/scripts/rec-fps b/scripts/rec-fps new file mode 100644 index 0000000..abdfb05 --- /dev/null +++ b/scripts/rec-fps @@ -0,0 +1 @@ +60 diff --git a/scripts/screen-mode b/scripts/screen-mode new file mode 100644 index 0000000..b027371 --- /dev/null +++ b/scripts/screen-mode @@ -0,0 +1 @@ +1280x720@60 diff --git a/scripts/stream.sh b/scripts/stream.sh new file mode 100755 index 0000000..48e9945 --- /dev/null +++ b/scripts/stream.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +DVR_PATH=/media +SCREEN_MODE=$(