Fix empty initial lqm status.

Limit distance between DtD nodes which are considered at the same site.
Some network setups use non-ham networks to connect nodes over DtD links.
These should not be consider the same site, so we limit how far appart DtDed
nodes can be when optimizing.
This commit is contained in:
Tim Wilkinson 2022-05-26 22:28:37 -07:00 committed by Joe AE6XE
parent 2f96f2bc7a
commit ba94a86ce3
1 changed files with 5 additions and 2 deletions

View File

@ -45,6 +45,7 @@ local quality_min_packets = 100 -- minimum number of tx packets before we can sa
local quality_injection_max = 10 -- number of packets to inject into poor links to update quality local quality_injection_max = 10 -- number of packets to inject into poor links to update quality
local tx_quality_run_avg = 0.8 -- tx quality running average local tx_quality_run_avg = 0.8 -- tx quality running average
local ping_timeout = 1.0 -- timeout before ping gives a qualtiy penalty local ping_timeout = 1.0 -- timeout before ping gives a qualtiy penalty
local dtd_distance = 50 -- distance (meters) after which nodes connected with DtD links are considered different sites
local myhostname = (info.get_nvram("node") or "localnode"):lower() local myhostname = (info.get_nvram("node") or "localnode"):lower()
local now = 0 local now = 0
@ -135,7 +136,7 @@ end
-- Clear old data -- Clear old data
local f = io.open("/tmp/lqm.info", "w") local f = io.open("/tmp/lqm.info", "w")
f:write("{}") f:write('{"trackers":{}}')
f:close() f:close()
local cursor = uci.cursor() local cursor = uci.cursor()
@ -549,10 +550,12 @@ function lqm()
if track ~= track2 and track2.hostname and not should_nonpair_block(track2) then if track ~= track2 and track2.hostname and not should_nonpair_block(track2) then
local connection = track.links[track2.hostname] local connection = track.links[track2.hostname]
if connection and connection.type == "DTD" then if connection and connection.type == "DTD" then
if not (track.lat and track.lon and track2.lat and track2.lon) or calc_distance(track.lat, track.lon, track2.lat, track2.lon) < dtd_distance then
tracklist[#tracklist + 1] = track2 tracklist[#tracklist + 1] = track2
end end
end end
end end
end
if #tracklist == 1 then if #tracklist == 1 then
track.blocks.dup = false track.blocks.dup = false
else else