LQM improvements (#364)

This commit is contained in:
Tim Wilkinson 2022-05-20 06:10:01 -07:00 committed by GitHub
parent 3f3b71b10c
commit a8b7f8a216
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 7 deletions

View File

@ -30,5 +30,5 @@ config lqm
option min_distance '0' option min_distance '0'
option max_distance '80467' option max_distance '80467'
option min_quality '50' option min_quality '50'
option ping_penalty '10' option ping_penalty '5'
option margin_quality '1' option margin_quality '1'

View File

@ -10,7 +10,7 @@ do
option min_distance '0' option min_distance '0'
option max_distance '80467' option max_distance '80467'
option min_quality '50' option min_quality '50'
option ping_penalty '10' option ping_penalty '5'
option margin_quality '1' option margin_quality '1'
__EOF__ __EOF__
/sbin/uci -c $c commit aredn /sbin/uci -c $c commit aredn

View File

@ -366,7 +366,7 @@ function lqm()
end end
-- Ping addresses and penalize quality for excessively slow links -- 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") local sigsock = nixio.socket("inet", "dgram")
sigsock:setopt("socket", "bindtodevice", wlan) sigsock:setopt("socket", "bindtodevice", wlan)
sigsock:setopt("socket", "dontroute", 1) sigsock:setopt("socket", "dontroute", 1)

View File

@ -325,7 +325,7 @@ local settings = {
key = "aredn.@lqm[0].ping_penalty", key = "aredn.@lqm[0].ping_penalty",
type = "string", type = "string",
desc = "Quality penalty when neighbor cannot be pinged", desc = "Quality penalty when neighbor cannot be pinged",
default = "10", default = "5",
condition = "lqm_enabled()" condition = "lqm_enabled()"
}, },
{ {
@ -491,7 +491,7 @@ function lqm_defaults()
cursor_set("aredn", "@lqm[0]", "min_distance", "0") cursor_set("aredn", "@lqm[0]", "min_distance", "0")
cursor_set("aredn", "@lqm[0]", "max_distance", "80467") cursor_set("aredn", "@lqm[0]", "max_distance", "80467")
cursor_set("aredn", "@lqm[0]", "min_quality", "50") 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") cursor_set("aredn", "@lqm[0]", "margin_quality", "1")
end end

View File

@ -105,7 +105,7 @@ html.print([[<hr>
</td></tr> </td></tr>
<tr><td> <tr><td>
<div class="lt"> <div class="lt">
<span class="m">Neighbor</span><span class="s">SNR</span><span class="p">Distance</span><span class="s">Quality</span><span class="p">TX Estimate</span><span class="p">Status</span> <span class="m">RF Neighbor</span><span class="s">SNR</span><span class="p">Distance</span><span class="s">Quality</span><span class="p">TX Estimate</span><span class="p">Status</span>
</div> </div>
<div id="links"></div> <div id="links"></div>
</td></tr> </td></tr>
@ -183,7 +183,12 @@ html.print([[<hr>
} }
links += `<div><span class="m">${name(track)}</span><span class="s">${track.snr}${"rev_snr" in track ? "/" + track.rev_snr : ""}</span><span class="p">${distance}</span><span class="s">${txquality}</span><span class="p">${txspeed}</span><span class="p">${status}</span></div>`; links += `<div><span class="m">${name(track)}</span><span class="s">${track.snr}${"rev_snr" in track ? "/" + track.rev_snr : ""}</span><span class="p">${distance}</span><span class="s">${txquality}</span><span class="p">${txspeed}</span><span class="p">${status}</span></div>`;
} }
document.getElementById("links").innerHTML = links; if (links.length) {
document.getElementById("links").innerHTML = links;
}
else {
document.getElementById("links").innerHTML = `<div><span>Currently no RF neighbor data available</span></div>`
}
} }
const fetchAndUpdate = () => { const fetchAndUpdate = () => {
fetch("/cgi-bin/sysinfo.json?lqm=1").then(r => r.json()).then(data => { fetch("/cgi-bin/sysinfo.json?lqm=1").then(r => r.json()).then(data => {