{% /* * Part of AREDN® -- Used for creating Amateur Radio Emergency Data Networks * Copyright (C) 2024 Tim Wilkinson * See Contributors file for additional contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * Additional Terms: * * Additional use restrictions exist on the AREDN® trademark and logo. * See AREDNLicense.txt for more info. * * Attributions to the AREDN® Project must be retained in the source code. * If importing this code into a new or existing project attribution * to the AREDN® project must be added to the source code. * * You must not misrepresent the origin of the material contained within. * * Modified versions must be modified to attribute to the original source * and be marked in reasonable ways as differentiate it from the original * version */ %} {% if (request.env.REQUEST_METHOD === "PUT") { const wifiiface = uci.get("network", "wifi", "device"); let f = fs.popen(`iw ${wifiiface} station dump`); if (f) { const signals = {}; let mac = null; for (let l = f.read("line"); length(l); l = f.read("line")) { if (index(l, "Station") === 0) { const m = match(l, / ([0-9a-fA-F:]+) /); if (m) { mac = m[1]; } } if (index(l, "signal:") !== -1) { const m = match(l, /[\t ]([0-9\-]+)[\t ]/); if (m) { signals[mac] = int(m[1]); } } } f.close(); let noise = -95; f = fs.popen(`iw ${wifiiface} survey dump`); if (f) { const reN = /noise:[ \t]+([0-9\-]+) dBm/; let ff = false; for (let l = f.read("line"); length(l); l = f.read("line")) { if (index(l, "[in use]") !== -1) { ff = true; } else if (ff) { const m = match(l, reN); if (m) { noise = int(m[1]); break; } } } f.close(); } printf("%J", { s: signals, n: noise }); } return; } const stations = fs.lsdir("/tmp/snrlog"); for (let i = 0; i < length(stations); i++) { const s = stations[i]; const m = match(s, /^([0-9A-Fa-f:]+)-(.*)$/); if (m) { stations[i] = { hostname: m[2], mac: lc(m[1]) }; } else { stations[i] = null; } } %}
{{_R("tool-header", "WiFi Signal")}}
Node
Select the target node
- dBm
snr: -
dBm 0 -20 -40 -60 -80 -100 -120 Last 5 minutes
Sound
Enable audible indicator
Volume
Pitch
{{_H("This tool helps to align the node's antenna with its neighbors for the best signal strength. The indicator on the left shows the current, best, and worst signal strenghts. The graph on the right show the history of the most recent signal strengths. Specific neighbors can be selected, the default being an average of all those currently visible.

A sound indicator is also provided which is useful when aligning antennas without looking at this display.")}}

{{_R("tool-footer")}}