From a8b7f8a2169df3b472afd60114f35b456efda328 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Fri, 20 May 2022 06:10:01 -0700 Subject: [PATCH] LQM improvements (#364) --- files/etc/config.mesh/aredn | 2 +- files/etc/uci-defaults/80_aredn_lqm | 2 +- files/usr/local/bin/mgr/lqm.lua | 2 +- files/www/cgi-bin/advancedconfig | 4 ++-- files/www/cgi-bin/lqm | 9 +++++++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/files/etc/config.mesh/aredn b/files/etc/config.mesh/aredn index 0e58d637..2cac1254 100644 --- a/files/etc/config.mesh/aredn +++ b/files/etc/config.mesh/aredn @@ -30,5 +30,5 @@ config lqm option min_distance '0' option max_distance '80467' option min_quality '50' - option ping_penalty '10' + option ping_penalty '5' option margin_quality '1' diff --git a/files/etc/uci-defaults/80_aredn_lqm b/files/etc/uci-defaults/80_aredn_lqm index f04ad0dd..30a13ff1 100755 --- a/files/etc/uci-defaults/80_aredn_lqm +++ b/files/etc/uci-defaults/80_aredn_lqm @@ -10,7 +10,7 @@ do option min_distance '0' option max_distance '80467' option min_quality '50' - option ping_penalty '10' + option ping_penalty '5' option margin_quality '1' __EOF__ /sbin/uci -c $c commit aredn diff --git a/files/usr/local/bin/mgr/lqm.lua b/files/usr/local/bin/mgr/lqm.lua index 68351b03..7d21af1b 100755 --- a/files/usr/local/bin/mgr/lqm.lua +++ b/files/usr/local/bin/mgr/lqm.lua @@ -366,7 +366,7 @@ function lqm() end -- Ping addresses and penalize quality for excessively slow links - if track.ip and (not track.blocked or only_quality_block(track)) then + if track.ip and not track.blocked then local sigsock = nixio.socket("inet", "dgram") sigsock:setopt("socket", "bindtodevice", wlan) sigsock:setopt("socket", "dontroute", 1) diff --git a/files/www/cgi-bin/advancedconfig b/files/www/cgi-bin/advancedconfig index a912acad..dd51d7c5 100755 --- a/files/www/cgi-bin/advancedconfig +++ b/files/www/cgi-bin/advancedconfig @@ -325,7 +325,7 @@ local settings = { key = "aredn.@lqm[0].ping_penalty", type = "string", desc = "Quality penalty when neighbor cannot be pinged", - default = "10", + default = "5", condition = "lqm_enabled()" }, { @@ -491,7 +491,7 @@ function lqm_defaults() cursor_set("aredn", "@lqm[0]", "min_distance", "0") cursor_set("aredn", "@lqm[0]", "max_distance", "80467") cursor_set("aredn", "@lqm[0]", "min_quality", "50") - cursor_set("aredn", "@lqm[0]", "ping_penalty", "10") + cursor_set("aredn", "@lqm[0]", "ping_penalty", "5") cursor_set("aredn", "@lqm[0]", "margin_quality", "1") end diff --git a/files/www/cgi-bin/lqm b/files/www/cgi-bin/lqm index 8278d378..b218cd3f 100755 --- a/files/www/cgi-bin/lqm +++ b/files/www/cgi-bin/lqm @@ -105,7 +105,7 @@ html.print([[
- NeighborSNRDistanceQualityTX EstimateStatus + RF NeighborSNRDistanceQualityTX EstimateStatus
@@ -183,7 +183,12 @@ html.print([[
} links += `
${name(track)}${track.snr}${"rev_snr" in track ? "/" + track.rev_snr : ""}${distance}${txquality}${txspeed}${status}
`; } - document.getElementById("links").innerHTML = links; + if (links.length) { + document.getElementById("links").innerHTML = links; + } + else { + document.getElementById("links").innerHTML = `
Currently no RF neighbor data available
` + } } const fetchAndUpdate = () => { fetch("/cgi-bin/sysinfo.json?lqm=1").then(r => r.json()).then(data => {