diff --git a/data/tracker_conf.json b/data/tracker_conf.json index d0bab56..786aab7 100644 --- a/data/tracker_conf.json +++ b/data/tracker_conf.json @@ -48,7 +48,6 @@ "path": "WIDE1-1", "nonSmartBeaconRate": 15, "rememberStationTime": 30, - "maxDistanceToTracker": 30, "standingUpdateTime": 15, "sendAltitude": true, "disableGPS": false diff --git a/data_embed/bootstrap.css.gz b/data_embed/bootstrap.css.gz index 2008edf..e471001 100644 Binary files a/data_embed/bootstrap.css.gz and b/data_embed/bootstrap.css.gz differ diff --git a/data_embed/bootstrap.js.gz b/data_embed/bootstrap.js.gz index 9d58d29..f45838c 100644 Binary files a/data_embed/bootstrap.js.gz and b/data_embed/bootstrap.js.gz differ diff --git a/data_embed/favicon.png.gz b/data_embed/favicon.png.gz index e56997e..ba93142 100644 Binary files a/data_embed/favicon.png.gz and b/data_embed/favicon.png.gz differ diff --git a/data_embed/index.html.gz b/data_embed/index.html.gz index 89a6447..1899e07 100644 Binary files a/data_embed/index.html.gz and b/data_embed/index.html.gz differ diff --git a/data_embed/script.js b/data_embed/script.js index 2111779..0c2dc7e 100644 --- a/data_embed/script.js +++ b/data_embed/script.js @@ -40,6 +40,7 @@ function fetchSettings() { fetch("/configuration.json") .then((response) => response.json()) .then((settings) => { + console.log(settings); loadSettings(settings); }) .catch((err) => { @@ -49,46 +50,29 @@ function fetchSettings() { }); } -const alwaysOnCheckbox = document.querySelector( - 'input[name="display.alwaysOn"]' -); -const timeoutInput = document.querySelector('input[name="display.timeout"]'); - -alwaysOnCheckbox.addEventListener("change", function () { - timeoutInput.disabled = this.checked; -}); - - -logCheckbox.addEventListener("change", function () { - serverField.disabled = !this.checked; - portField.disabled = !this.checked; -}); - function loadSettings(settings) { currentSettings = settings; // BEACONS // ADITIONAL STATION CONFIG - document.getElementById("simplifiedTrackerMode").checked = settings.simplifiedTrackerMode; - document.getElementById("sendCommentAfterXBeacons").value = settings.sendCommentAfterXBeacons; - document.getElementById("path").value = settings.path; - document.getElementById("nonSmartBeaconRate").value = settings.nonSmartBeaconRate; - document.getElementById("rememberStationTime").value = settings.rememberStationTime; - document.getElementById("maxDistanceToTracker").value = settings.maxDistanceToTracker; - document.getElementById("standingUpdateTime").value = settings.standingUpdateTime; - document.getElementById("sendAltitude").checked = settings.sendAltitude ; - document.getElementById("disableGPS").checked = settings.disableGPS; + document.getElementById("simplifiedTrackerMode").checked = settings.other.simplifiedTrackerMode; + document.getElementById("sendCommentAfterXBeacons").value = settings.other.sendCommentAfterXBeacons; + document.getElementById("path").value = settings.other.path; + document.getElementById("nonSmartBeaconRate").value = settings.other.nonSmartBeaconRate; + document.getElementById("rememberStationTime").value = settings.other.rememberStationTime; + document.getElementById("standingUpdateTime").value = settings.other.standingUpdateTime; + document.getElementById("sendAltitude").checked = settings.other.sendAltitude ; + document.getElementById("disableGPS").checked = settings.other.disableGPS; // DISPLAY document.getElementById("display.showSymbol").checked = settings.display.showSymbol; document.getElementById("display.ecoMode").checked = settings.display.ecoMode; document.getElementById("display.timeout").value = settings.display.timeout; document.getElementById("display.turn180").checked = settings.display.turn180; - - if (settings.display.alwaysOn) { + /*if (settings.display.alwaysOn) { timeoutInput.disabled = true; - } + }*/ // BATTERY document.getElementById("battery.sendVoltage").checked = settings.battery.sendVoltage; @@ -123,19 +107,20 @@ function loadSettings(settings) { // LORA // BLUETOOTH - document.getElementById("bluettooth.active").checked = settings.bluetooth.active; - document.getElementById("bluettooth.type").value = settings.bluetooth.type; + document.getElementById("bluetooth.active").checked = settings.bluetooth.active; + document.getElementById("bluetooth.type").value = settings.bluetooth.type; // PTT Trigger - document.getElementById("ptt.active").checked = settings.ptt.active; - document.getElementById("ptt.io_pin").value = settings.ptt.io_pin; - document.getElementById("ptt.preDelay").value = settings.ptt.preDelay; - document.getElementById("ptt.postDelay").value = settings.ptt.postDelay; - document.getElementById("ptt.reverse").checked = settings.ptt.reverse; + document.getElementById("ptt.active").checked = settings.pttTrigger.active; + document.getElementById("ptt.io_pin").value = settings.pttTrigger.io_pin; + document.getElementById("ptt.preDelay").value = settings.pttTrigger.preDelay; + document.getElementById("ptt.postDelay").value = settings.pttTrigger.postDelay; + document.getElementById("ptt.reverse").checked = settings.pttTrigger.reverse; // WiFi AP document.getElementById("wifiAP.password").value = settings.wifiAP.password; + //refreshSpeedStandard(); toggleFields(); } @@ -148,14 +133,6 @@ function showToast(message) { (new bootstrap.Toast(el)).show(); } -document.getElementById('send-beacon').addEventListener('click', function (e) { - e.preventDefault(); - - fetch("/action?type=send-beacon", { method: "POST" }); - - showToast("Your beacon will be sent in a moment.
This action will be ignored if you have APRSIS and LoRa TX disabled!"); -}); - document.getElementById('reboot').addEventListener('click', function (e) { e.preventDefault(); @@ -169,7 +146,7 @@ const bmeCheckbox = document.querySelector("input[name='bme.active']"); const stationModeSelect = document.querySelector("select[name='stationMode']"); function toggleFields() { - const sendExternalVoltageCheckbox = document.querySelector( + /*const sendExternalVoltageCheckbox = document.querySelector( 'input[name="battery.sendExternalVoltage"]' ); const externalVoltagePinInput = document.querySelector( @@ -186,10 +163,10 @@ function toggleFields() { const WebadminUsername = document.querySelector( 'input[name="webadmin.username"]' - ); + );*/ } -const sendExternalVoltageCheckbox = document.querySelector( +/*const sendExternalVoltageCheckbox = document.querySelector( 'input[name="battery.sendExternalVoltage"]' ); const externalVoltagePinInput = document.querySelector( @@ -224,9 +201,9 @@ const WebadminPassword = document.querySelector( WebadminCheckbox.addEventListener("change", function () { WebadminUsername.disabled = !this.checked; WebadminPassword.disabled = !this.checked; -}); +});*/ -document.querySelector(".new button").addEventListener("click", function () { +/*document.querySelector(".new button").addEventListener("click", function () { const trackersContainer = document.querySelector(".list-tracker"); let trackerCount = document.querySelectorAll(".network").length; @@ -260,18 +237,18 @@ document.querySelector(".new button").addEventListener("click", function () { // Add the new network element to the end of the document document.querySelector(".new").before(trackerElement); -}); +});*/ -document +/*document .getElementById("action.symbol") .addEventListener("change", function () { const value = document.getElementById("action.symbol").value; document.getElementById("beacon.overlay").value = value[0]; document.getElementById("beacon.symbol").value = value[1]; - }); + });*/ -const speedStandards = { +/*const speedStandards = { 300: [125, 5, 12], 244: [125, 6, 12], 209: [125, 7, 12], @@ -303,17 +280,11 @@ function refreshSpeedStandard() { if (!found) { document.getElementById("action.speed").value = ""; } -} +}*/ -document - .getElementById("lora.signalBandwidth") - .addEventListener("focusout", refreshSpeedStandard); -document - .getElementById("lora.codingRate4") - .addEventListener("focusout", refreshSpeedStandard); -document - .getElementById("lora.spreadingFactor") - .addEventListener("focusout", refreshSpeedStandard); +/*document.getElementById("lora.signalBandwidth").addEventListener("focusout", refreshSpeedStandard); +document.getElementById("lora.codingRate4").addEventListener("focusout", refreshSpeedStandard); +document.getElementById("lora.spreadingFactor").addEventListener("focusout", refreshSpeedStandard); document.getElementById("action.speed").addEventListener("change", function () { const speed = document.getElementById("action.speed").value; @@ -329,7 +300,7 @@ document.getElementById("action.speed").addEventListener("change", function () { document.getElementById("lora.codingRate4").value = cr4; document.getElementById("lora.spreadingFactor").value = sf; } -}); +});*/ const form = document.querySelector("form"); @@ -368,8 +339,7 @@ function checkConnection() { form.addEventListener("submit", async (event) => { event.preventDefault(); - document.getElementById("beacons").value = - document.querySelectorAll(".network").length; + //document.getElementById("beacons").value = document.querySelectorAll(".beacons").length; fetch(form.action, { method: form.method, diff --git a/data_embed/script.js.gz b/data_embed/script.js.gz index d139eef..5a42232 100644 Binary files a/data_embed/script.js.gz and b/data_embed/script.js.gz differ diff --git a/data_embed/style.css.gz b/data_embed/style.css.gz index ca41755..4f60b35 100644 Binary files a/data_embed/style.css.gz and b/data_embed/style.css.gz differ diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 5ad3a3f..ba3558d 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -117,7 +117,7 @@ void setup() { startupScreen(loraIndex, versionDate); if (Config.wifiAP.active){ - displayShow(" WEB-CONF","", "WiFiAP:LoRaTracker-AP", "IP : 192.168.4.1","", ""); + displayShow(" LoRa APRS", " ** WEB-CONF **","", "WiFiAP:LoRaTracker-AP", "IP : 192.168.4.1",""); logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "Main", "WebConfiguration Started!"); WIFI_Utils::startAutoAP(); WEB_Utils::setup(); diff --git a/src/configuration.cpp b/src/configuration.cpp index c967b2c..14aab2a 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -81,7 +81,6 @@ void Configuration::writeFile() { data["other"]["path"] = path; data["other"]["nonSmartBeaconRate"] = nonSmartBeaconRate; data["other"]["rememberStationTime"] = rememberStationTime; - data["other"]["maxDistanceToTracker"] = maxDistanceToTracker; data["other"]["standingUpdateTime"] = standingUpdateTime; data["other"]["sendAltitude"] = sendAltitude; data["other"]["disableGPS"] = disableGPS; @@ -179,7 +178,6 @@ bool Configuration::readFile() { path = data["other"]["path"] | "WIDE1-1"; nonSmartBeaconRate = data["other"]["nonSmartBeaconRate"] | 15; rememberStationTime = data["other"]["rememberStationTime"] | 30; - maxDistanceToTracker = data["other"]["maxDistanceToTracker"] | 30; standingUpdateTime = data["other"]["standingUpdateTime"] | 15; sendAltitude = data["other"]["sendAltitude"] | true; disableGPS = data["other"]["disableGPS"] | false; @@ -301,7 +299,6 @@ void Configuration::init() { path = "WIDE1-1"; nonSmartBeaconRate = 15; rememberStationTime = 30; - maxDistanceToTracker = 30; standingUpdateTime = 15; sendAltitude = true; disableGPS = false; diff --git a/src/configuration.h b/src/configuration.h index 19c834e..e5a0772 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -78,7 +78,7 @@ public: int power; }; -class Ptt { +class PTT { public: bool active; int io_pin; @@ -105,7 +105,7 @@ public: BME bme; Notification notification; std::vector loraTypes; - Ptt ptt; + PTT ptt; BLUETOOTH bluetooth; bool simplifiedTrackerMode; @@ -113,7 +113,6 @@ public: String path; int nonSmartBeaconRate; int rememberStationTime; - int maxDistanceToTracker; int standingUpdateTime; bool sendAltitude; bool disableGPS; diff --git a/src/web_utils.cpp b/src/web_utils.cpp index dd3647a..5cb210c 100644 --- a/src/web_utils.cpp +++ b/src/web_utils.cpp @@ -90,12 +90,11 @@ namespace WEB_Utils { Config.path = request->getParam("path", true)->value(); Config.nonSmartBeaconRate = request->getParam("nonSmartBeaconRate", true)->value().toInt(); Config.rememberStationTime = request->getParam("rememberStationTime", true)->value().toInt(); - //Config.maxDistanceToTracker = request->getParam("maxDistanceToTracker", true)->value().toInt(); Config.standingUpdateTime = request->getParam("standingUpdateTime", true)->value().toInt(); Config.sendAltitude = request->hasParam("sendAltitude", true); Config.disableGPS = request->hasParam("disableGPS", true); - Config.display.showSymbol = request->hasParam("display.showSymbol", true); + Config.display.showSymbol = request->hasParam("display.showSymbol", true); if (request->hasParam("display.ecoMode", true)) { Config.display.ecoMode = true; if (request->hasParam("display.timeout", true)) { @@ -104,7 +103,7 @@ namespace WEB_Utils { } else { Config.display.ecoMode = false; } - Config.display.turn180 = request->hasParam("display.turn180", true); + Config.display.turn180 = request->hasParam("display.turn180", true); Config.battery.sendVoltage = request->hasParam("battery.sendVoltage", true); Config.battery.voltageAsTelemetry = request->hasParam("battery.voltageAsTelemetry", true);