mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-03-28 16:52:33 +01:00
Compare commits
5 Commits
mqtt-Add
...
mqttVersio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc1bdbb703 | ||
|
|
74a8fa7969 | ||
|
|
b65a6de018 | ||
|
|
1840ce2338 | ||
|
|
b8ef262cc7 |
@@ -22,13 +22,15 @@
|
||||
},
|
||||
"aprs_is": {
|
||||
"active": false,
|
||||
"passcode": "XYZVW",
|
||||
"server": "rotate.aprs2.net",
|
||||
"port": 14580,
|
||||
"filter": "m/10",
|
||||
"messagesToRF": false,
|
||||
"objectsToRF": false
|
||||
"objectsToRF": false,
|
||||
"server": "rotate.aprs2.net",
|
||||
"passcode": "XYZVW",
|
||||
"port": 14580,
|
||||
"filter": "m/10"
|
||||
},
|
||||
"personalNote": "",
|
||||
"blacklist": "",
|
||||
"digi": {
|
||||
"mode": 0,
|
||||
"ecoMode": 0
|
||||
@@ -76,6 +78,14 @@
|
||||
"enableSerial": false,
|
||||
"acceptOwn": false
|
||||
},
|
||||
"mqtt": {
|
||||
"active": false,
|
||||
"server": "",
|
||||
"topic": "",
|
||||
"username": "",
|
||||
"password": "",
|
||||
"port": 1883
|
||||
},
|
||||
"ota": {
|
||||
"username": "",
|
||||
"password": ""
|
||||
@@ -84,27 +94,17 @@
|
||||
"username": "admin",
|
||||
"password": ""
|
||||
},
|
||||
"ntp": {
|
||||
"gmtCorrection": 0.0
|
||||
},
|
||||
"remoteManagement": {
|
||||
"managers": "",
|
||||
"rfOnly": true
|
||||
},
|
||||
"mqtt": {
|
||||
"active": false,
|
||||
"server": "",
|
||||
"topic": "",
|
||||
"username": "",
|
||||
"password": "",
|
||||
"port": 1883
|
||||
},
|
||||
},
|
||||
"ntp": {
|
||||
"gmtCorrection": 0.0
|
||||
},
|
||||
"other": {
|
||||
"rememberStationTime": 30,
|
||||
"backupDigiMode": false,
|
||||
"rebootMode": false,
|
||||
"rebootModeTime": 6
|
||||
},
|
||||
"personalNote": "",
|
||||
"blacklist": ""
|
||||
}
|
||||
}
|
||||
@@ -283,6 +283,7 @@
|
||||
id="beacon.statusPacket"
|
||||
class="form-control"
|
||||
placeholder="Custom Status"
|
||||
value=""
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -438,8 +439,9 @@
|
||||
type="text"
|
||||
name="aprs_is.server"
|
||||
id="aprs_is.server"
|
||||
placeholder="soam.aprs2.net"
|
||||
placeholder="rotate.aprs2.net"
|
||||
class="form-control"
|
||||
value="rotate.aprs2.net"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
@@ -454,6 +456,7 @@
|
||||
id="aprs_is.port"
|
||||
placeholder="14580"
|
||||
class="form-control"
|
||||
value="14580"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -469,6 +472,7 @@
|
||||
name="aprs_is.passcode"
|
||||
id="aprs_is.passcode"
|
||||
class="form-control"
|
||||
value="XYZWV"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
@@ -482,6 +486,7 @@
|
||||
class="form-control"
|
||||
name="aprs_is.filter"
|
||||
id="aprs_is.filter"
|
||||
value="m/10"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1018,6 +1023,8 @@
|
||||
name="display.timeout"
|
||||
id="display.timeout"
|
||||
value="4"
|
||||
step="1"
|
||||
min="2"
|
||||
class="form-control"
|
||||
/>
|
||||
<span class="input-group-text"
|
||||
@@ -1379,7 +1386,6 @@
|
||||
id="syslog.server"
|
||||
placeholder="lora.link9.net"
|
||||
class="form-control"
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@@ -1394,7 +1400,6 @@
|
||||
id="syslog.port"
|
||||
placeholder="1514"
|
||||
class="form-control"
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
|
||||
@@ -49,29 +49,6 @@ 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;
|
||||
});
|
||||
|
||||
// timeoutInput.addEventListener("change", function () {
|
||||
// alwaysOnCheckbox.disabled = this.value !== "";
|
||||
// });
|
||||
|
||||
const logCheckbox = document.querySelector('input[name="syslog.active"]');
|
||||
const serverField = document.querySelector('input[name="syslog.server"]');
|
||||
const portField = document.querySelector('input[name="syslog.port"]');
|
||||
const logBeaconOverTCPIPField = document.querySelector('input[name="syslog.logBeaconOverTCPIP"]');
|
||||
|
||||
logCheckbox.addEventListener("change", function () {
|
||||
serverField.disabled = !this.checked;
|
||||
portField.disabled = !this.checked;
|
||||
logBeaconOverTCPIPField.disabled = !this.checked
|
||||
});
|
||||
|
||||
function loadSettings(settings) {
|
||||
currentSettings = settings;
|
||||
@@ -127,6 +104,13 @@ function loadSettings(settings) {
|
||||
document.getElementById("aprs_is.port").value = settings.aprs_is.port;
|
||||
document.getElementById("aprs_is.filter").value = settings.aprs_is.filter;
|
||||
document.getElementById("aprs_is.passcode").value = settings.aprs_is.passcode;
|
||||
APRSISCheckbox.checked = settings.aprs_is.active;
|
||||
APRSISGateMessages.disabled = !APRSISCheckbox.checked;
|
||||
APRSISGateObjects.disabled = !APRSISCheckbox.checked;
|
||||
APRSISServer.disabled = !APRSISCheckbox.checked;
|
||||
APRSISPort.disabled = !APRSISCheckbox.checked;
|
||||
APRSISPasscode.disabled = !APRSISCheckbox.checked;
|
||||
APRSISFilter.disabled = !APRSISCheckbox.checked;
|
||||
|
||||
// Beacon
|
||||
document.getElementById("beacon.latitude").value = settings.beacon.latitude;
|
||||
@@ -138,6 +122,8 @@ function loadSettings(settings) {
|
||||
|
||||
document.getElementById("beacon.statusActive").checked = settings.beacon.statusActive;
|
||||
document.getElementById("beacon.statusPacket").value = settings.beacon.statusPacket;
|
||||
StatusCheckbox.checked = settings.beacon.statusActive;
|
||||
StatusPacket.disabled = !StatusCheckbox.checked;
|
||||
|
||||
document.getElementById("beacon.gpsActive").checked = settings.beacon.gpsActive;
|
||||
document.getElementById("beacon.gpsAmbiguity").checked = settings.beacon.gpsAmbiguity;
|
||||
@@ -147,7 +133,7 @@ function loadSettings(settings) {
|
||||
|
||||
// Digi
|
||||
document.getElementById("digi.mode").value = settings.digi.mode;
|
||||
document.getElementById("digi.ecoMode").checked = settings.digi.ecoMode;
|
||||
document.getElementById("digi.ecoMode").value = settings.digi.ecoMode;
|
||||
|
||||
// LoRa
|
||||
document.getElementById("lora.txFreq").value = settings.lora.txFreq;
|
||||
@@ -163,40 +149,50 @@ function loadSettings(settings) {
|
||||
document.getElementById("display.alwaysOn").checked = settings.display.alwaysOn;
|
||||
document.getElementById("display.turn180").checked = settings.display.turn180;
|
||||
document.getElementById("display.timeout").value = settings.display.timeout;
|
||||
|
||||
if (settings.display.alwaysOn) {
|
||||
timeoutInput.disabled = true;
|
||||
}
|
||||
DisplayAlwaysOnCheckbox.checked = settings.display.alwaysOn;
|
||||
DisplayTimeout.disabled = DisplayAlwaysOnCheckbox.checked;
|
||||
|
||||
// BATTERY
|
||||
document.getElementById("battery.sendInternalVoltage").checked = settings.battery.sendInternalVoltage;
|
||||
document.getElementById("battery.monitorInternalVoltage").checked = settings.battery.monitorInternalVoltage;
|
||||
document.getElementById("battery.internalSleepVoltage").value = settings.battery.internalSleepVoltage.toFixed(1);
|
||||
MonitorInternalVoltageCheckbox.checked = settings.battery.monitorInternalVoltage;
|
||||
MonitorInternalSleepVoltage.disabled = !MonitorInternalVoltageCheckbox.checked;
|
||||
|
||||
document.getElementById("battery.sendExternalVoltage").checked = settings.battery.sendExternalVoltage;
|
||||
document.getElementById("battery.externalVoltagePin").value = settings.battery.externalVoltagePin;
|
||||
document.getElementById("battery.voltageDividerR1").value = settings.battery.voltageDividerR1.toFixed(1);
|
||||
document.getElementById("battery.voltageDividerR2").value = settings.battery.voltageDividerR2.toFixed(1);
|
||||
SendExternalVoltageCheckbox.checked = settings.battery.sendExternalVoltage;
|
||||
ExternalVoltagePin.disabled = !SendExternalVoltageCheckbox.checked;
|
||||
ExternalVoltageDividerR1.disabled = !SendExternalVoltageCheckbox.checked;
|
||||
ExternalVoltageDividerR2.disabled = !SendExternalVoltageCheckbox.checked;
|
||||
|
||||
document.getElementById("battery.monitorExternalVoltage").checked = settings.battery.monitorExternalVoltage;
|
||||
document.getElementById("battery.externalSleepVoltage").value = settings.battery.externalSleepVoltage.toFixed(1);
|
||||
MonitorExternalVoltageCheckbox.checked = settings.battery.monitorExternalVoltage;
|
||||
MonitorExternalSleepVoltage.disabled = !MonitorExternalVoltageCheckbox.checked;
|
||||
|
||||
document.getElementById("battery.sendVoltageAsTelemetry").checked = settings.battery.sendVoltageAsTelemetry;
|
||||
|
||||
|
||||
// TELEMETRY WX SENSOR
|
||||
document.getElementById("wxsensor.active").checked = settings.wxsensor.active;
|
||||
document.getElementById("wxsensor.heightCorrection").value = settings.wxsensor.heightCorrection;
|
||||
document.getElementById("wxsensor.temperatureCorrection").value = settings.wxsensor.temperatureCorrection.toFixed(1);
|
||||
TelemetryCheckbox.checked = settings.wxsensor.active;
|
||||
TelemetryHeightCorrection.disabled = !TelemetryCheckbox.checked;
|
||||
TelemetryTempCorrection.disabled = !TelemetryCheckbox.checked;
|
||||
|
||||
// SYSLOG
|
||||
document.getElementById("syslog.active").checked = settings.syslog.active;
|
||||
document.getElementById("syslog.server").value = settings.syslog.server;
|
||||
document.getElementById("syslog.port").value = settings.syslog.port;
|
||||
document.getElementById("syslog.logBeaconOverTCPIP").checked = settings.syslog.logBeaconOverTCPIP;
|
||||
|
||||
if (settings.syslog.active) {
|
||||
serverField.disabled = false;
|
||||
portField.disabled = false;
|
||||
logBeaconOverTCPIPField.disabled = false;
|
||||
}
|
||||
|
||||
SyslogCheckbox.checked = settings.syslog.active;
|
||||
SyslogServer.disabled = !SyslogCheckbox.checked;
|
||||
SyslogPort.disabled = !SyslogCheckbox.checked;
|
||||
SyslogBeaconOverTCPIP.disabled = !SyslogCheckbox.checked;
|
||||
|
||||
// TNC
|
||||
if (settings.tnc) {
|
||||
document.getElementById("tnc.enableServer").checked = settings.tnc.enableServer;
|
||||
@@ -204,9 +200,25 @@ function loadSettings(settings) {
|
||||
document.getElementById("tnc.acceptOwn").checked = settings.tnc.acceptOwn;
|
||||
}
|
||||
|
||||
// MQTT
|
||||
document.getElementById("mqtt.active").checked = settings.mqtt.active;
|
||||
document.getElementById("mqtt.server").value = settings.mqtt.server;
|
||||
document.getElementById("mqtt.topic").value = settings.mqtt.topic;
|
||||
document.getElementById("mqtt.username").value = settings.mqtt.username;
|
||||
document.getElementById("mqtt.password").value = settings.mqtt.password;
|
||||
document.getElementById("mqtt.port").value = settings.mqtt.port;
|
||||
MqttCheckbox.checked = settings.mqtt.active;
|
||||
MqttServer.disabled = !MqttCheckbox.check;
|
||||
MqttTopic.disabled = !MqttCheckbox.check;
|
||||
MqttUsername.disabled = !MqttCheckbox.check;
|
||||
MqttPassword.disabled = !MqttCheckbox.check;
|
||||
MqttPort.disabled = !MqttCheckbox.check;
|
||||
|
||||
// Reboot
|
||||
document.getElementById("other.rebootMode").checked = settings.other.rebootMode;
|
||||
document.getElementById("other.rebootModeTime").value = settings.other.rebootModeTime;
|
||||
RebootModeCheckbox.checked = settings.other.rebootMode;
|
||||
RebootModeTime.disabled = !RebootModeCheckbox.check;
|
||||
|
||||
// WiFi Auto AP
|
||||
document.getElementById("wifi.autoAP.password").value = settings.wifi.autoAP.password;
|
||||
@@ -220,28 +232,22 @@ function loadSettings(settings) {
|
||||
document.getElementById("webadmin.active").checked = settings.webadmin.active;
|
||||
document.getElementById("webadmin.username").value = settings.webadmin.username;
|
||||
document.getElementById("webadmin.password").value = settings.webadmin.password;
|
||||
|
||||
// NTP
|
||||
document.getElementById("ntp.gmtCorrection").value = settings.ntp.gmtCorrection;
|
||||
|
||||
// MQTT
|
||||
document.getElementById("mqtt.active").checked = settings.mqtt.active;
|
||||
document.getElementById("mqtt.server").value = settings.mqtt.server;
|
||||
document.getElementById("mqtt.topic").value = settings.mqtt.topic;
|
||||
document.getElementById("mqtt.username").value = settings.mqtt.username;
|
||||
document.getElementById("mqtt.password").value = settings.mqtt.password;
|
||||
document.getElementById("mqtt.port").value = settings.mqtt.port;
|
||||
|
||||
// Experimental
|
||||
document.getElementById("other.backupDigiMode").checked = settings.other.backupDigiMode;
|
||||
WebadminCheckbox.checked = settings.webadmin.active;
|
||||
WebadminUsername.disabled = !WebadminCheckbox.check;
|
||||
WebadminPassword.disabled = !WebadminCheckbox.check;
|
||||
|
||||
// Management over APRS
|
||||
document.getElementById("remoteManagement.managers").value = settings.remoteManagement.managers;
|
||||
document.getElementById("remoteManagement.rfOnly").checked = settings.remoteManagement.rfOnly;
|
||||
|
||||
// NTP
|
||||
document.getElementById("ntp.gmtCorrection").value = settings.ntp.gmtCorrection;
|
||||
|
||||
// Experimental
|
||||
document.getElementById("other.backupDigiMode").checked = settings.other.backupDigiMode;
|
||||
|
||||
updateImage();
|
||||
refreshSpeedStandard();
|
||||
toggleFields();
|
||||
}
|
||||
|
||||
function showToast(message) {
|
||||
@@ -268,8 +274,6 @@ document.getElementById('reboot').addEventListener('click', function (e) {
|
||||
showToast("Your device will be rebooted in a while");
|
||||
});
|
||||
|
||||
const wxsensorCheckbox = document.querySelector("input[name='wxsensor.active']");
|
||||
|
||||
function updateImage() {
|
||||
const value = document.getElementById("beacon.overlay").value + document.getElementById("beacon.symbol").value;
|
||||
|
||||
@@ -295,96 +299,111 @@ function updateImage() {
|
||||
}
|
||||
}
|
||||
|
||||
function toggleFields() {
|
||||
const sendExternalVoltageCheckbox = document.querySelector(
|
||||
'input[name="battery.sendExternalVoltage"]'
|
||||
);
|
||||
const externalVoltagePinInput = document.querySelector(
|
||||
'input[name="battery.externalVoltagePin"]'
|
||||
);
|
||||
|
||||
externalVoltagePinInput.disabled = !sendExternalVoltageCheckbox.checked;
|
||||
voltageDividerR1.disabled = !sendExternalVoltageCheckbox.checked;
|
||||
voltageDividerR2.disabled = !sendExternalVoltageCheckbox.checked;
|
||||
|
||||
const WebadminCheckbox = document.querySelector(
|
||||
'input[name="webadmin.active"]'
|
||||
);
|
||||
|
||||
const WebadminUsername = document.querySelector(
|
||||
'input[name="webadmin.username"]'
|
||||
);
|
||||
|
||||
const WebadminPassword = document.querySelector(
|
||||
'input[name="webadmin.password"]'
|
||||
);
|
||||
WebadminUsername.disabled = !WebadminCheckbox.checked;
|
||||
WebadminPassword.disabled = !WebadminCheckbox.checked;
|
||||
}
|
||||
|
||||
const sendExternalVoltageCheckbox = document.querySelector(
|
||||
'input[name="battery.sendExternalVoltage"]'
|
||||
);
|
||||
const externalVoltagePinInput = document.querySelector(
|
||||
'input[name="battery.externalVoltagePin"]'
|
||||
);
|
||||
|
||||
const voltageDividerR1 = document.querySelector(
|
||||
'input[name="battery.voltageDividerR1"]'
|
||||
);
|
||||
|
||||
const voltageDividerR2 = document.querySelector(
|
||||
'input[name="battery.voltageDividerR2"]'
|
||||
);
|
||||
|
||||
sendExternalVoltageCheckbox.addEventListener("change", function () {
|
||||
externalVoltagePinInput.disabled = !this.checked;
|
||||
voltageDividerR1.disabled = !this.checked;
|
||||
voltageDividerR2.disabled = !this.checked;
|
||||
// Status Switch
|
||||
const StatusCheckbox = document.querySelector('input[name="beacon.statusActive"]');
|
||||
const StatusPacket = document.querySelector('input[name="beacon.statusPacket"]');
|
||||
StatusCheckbox.addEventListener("change", function() {
|
||||
StatusPacket.disabled = !this.checked;
|
||||
});
|
||||
|
||||
const WebadminCheckbox = document.querySelector(
|
||||
'input[name="webadmin.active"]'
|
||||
);
|
||||
|
||||
const WebadminUsername = document.querySelector(
|
||||
'input[name="webadmin.username"]'
|
||||
);
|
||||
|
||||
const WebadminPassword = document.querySelector(
|
||||
'input[name="webadmin.password"]'
|
||||
);
|
||||
WebadminCheckbox.addEventListener("change", function () {
|
||||
WebadminUsername.disabled = !this.checked;
|
||||
WebadminPassword.disabled = !this.checked;
|
||||
// APRS-IS Switches
|
||||
const APRSISCheckbox = document.querySelector('input[name="aprs_is.active"]');
|
||||
const APRSISGateMessages = document.querySelector('input[name="aprs_is.messagesToRF"]');
|
||||
const APRSISGateObjects = document.querySelector('input[name="aprs_is.objectsToRF"]');
|
||||
const APRSISServer = document.querySelector('input[name="aprs_is.server"]');
|
||||
const APRSISPort = document.querySelector('input[name="aprs_is.port"]');
|
||||
const APRSISPasscode = document.querySelector('input[name="aprs_is.passcode"]');
|
||||
const APRSISFilter = document.querySelector('input[name="aprs_is.filter"]');
|
||||
APRSISCheckbox.addEventListener("change", function() {
|
||||
APRSISGateMessages.disabled = !this.checked;
|
||||
APRSISGateObjects.disabled = !this.checked;
|
||||
APRSISServer.disabled = !this.checked;
|
||||
APRSISPort.disabled = !this.checked;
|
||||
APRSISPasscode.disabled = !this.checked;
|
||||
APRSISFilter.disabled = !this.checked;
|
||||
});
|
||||
|
||||
const MqttCheckbox = document.querySelector(
|
||||
'input[name="mqtt.active"]'
|
||||
);
|
||||
const MqttServer = document.querySelector(
|
||||
'input[name="mqtt.server"]'
|
||||
);
|
||||
const MqttTopic = document.querySelector(
|
||||
'input[name="mqtt.topic"]'
|
||||
);
|
||||
const MqttUsername = document.querySelector(
|
||||
'input[name="mqtt.username"]'
|
||||
);
|
||||
const MqttPassword = document.querySelector(
|
||||
'input[name="mqtt.password"]'
|
||||
);
|
||||
const MqttPort = document.querySelector(
|
||||
'input[name="mqtt.port"]'
|
||||
);
|
||||
// Display Switches
|
||||
const DisplayAlwaysOnCheckbox = document.querySelector('input[name="display.alwaysOn"]');
|
||||
const DisplayTimeout = document.querySelector('input[name="display.timeout"]');
|
||||
DisplayAlwaysOnCheckbox.addEventListener("change", function () {
|
||||
DisplayTimeout.disabled = this.checked;
|
||||
});
|
||||
|
||||
// Battery Switches
|
||||
const MonitorInternalVoltageCheckbox = document.querySelector('input[name="battery.monitorInternalVoltage"]');
|
||||
const MonitorInternalSleepVoltage = document.querySelector('input[name="battery.internalSleepVoltage"]');
|
||||
MonitorInternalVoltageCheckbox.addEventListener("change", function () {
|
||||
MonitorInternalSleepVoltage.disabled = !this.checked;
|
||||
});
|
||||
const MonitorExternalVoltageCheckbox = document.querySelector('input[name="battery.monitorExternalVoltage"]');
|
||||
const MonitorExternalSleepVoltage = document.querySelector('input[name="battery.externalSleepVoltage"]');
|
||||
MonitorExternalVoltageCheckbox.addEventListener("change", function () {
|
||||
MonitorExternalSleepVoltage.disabled = !this.checked;
|
||||
});
|
||||
const SendExternalVoltageCheckbox = document.querySelector('input[name="battery.sendExternalVoltage"]');
|
||||
const ExternalVoltagePin = document.querySelector('input[name="battery.externalVoltagePin"]');
|
||||
const ExternalVoltageDividerR1 = document.querySelector('input[name="battery.voltageDividerR1"]');
|
||||
const ExternalVoltageDividerR2 = document.querySelector('input[name="battery.voltageDividerR2"]');
|
||||
SendExternalVoltageCheckbox.addEventListener("change", function () {
|
||||
ExternalVoltagePin.disabled = !this.checked;
|
||||
ExternalVoltageDividerR1.disabled = !this.checked;
|
||||
ExternalVoltageDividerR2.disabled = !this.checked;
|
||||
});
|
||||
|
||||
// Telemetry Switches
|
||||
const TelemetryCheckbox = document.querySelector('input[name="wxsensor.active"]');
|
||||
const TelemetryHeightCorrection = document.querySelector('input[name="wxsensor.heightCorrection"]');
|
||||
const TelemetryTempCorrection = document.querySelector('input[name="wxsensor.temperatureCorrection"]');
|
||||
TelemetryCheckbox.addEventListener("change", function () {
|
||||
TelemetryHeightCorrection.disabled = !this.checked;
|
||||
TelemetryTempCorrection.disabled = !this.checked;
|
||||
});
|
||||
|
||||
// Syslog Switches
|
||||
const SyslogCheckbox = document.querySelector('input[name="syslog.active"]');
|
||||
const SyslogServer = document.querySelector('input[name="syslog.server"]');
|
||||
const SyslogPort = document.querySelector('input[name="syslog.port"]');
|
||||
const SyslogBeaconOverTCPIP = document.querySelector('input[name="syslog.logBeaconOverTCPIP"]');
|
||||
SyslogCheckbox.addEventListener("change", function () {
|
||||
SyslogServer.disabled = !this.checked;
|
||||
SyslogPort.disabled = !this.checked;
|
||||
SyslogBeaconOverTCPIP.disabled = !this.checked
|
||||
});
|
||||
|
||||
// MQTT Switches
|
||||
const MqttCheckbox = document.querySelector('input[name="mqtt.active"]');
|
||||
const MqttServer = document.querySelector('input[name="mqtt.server"]');
|
||||
const MqttTopic = document.querySelector('input[name="mqtt.topic"]');
|
||||
const MqttUsername = document.querySelector('input[name="mqtt.username"]');
|
||||
const MqttPassword = document.querySelector('input[name="mqtt.password"]');
|
||||
const MqttPort = document.querySelector('input[name="mqtt.port"]');
|
||||
MqttCheckbox.addEventListener("change", function () {
|
||||
MqttServer.disabled = !this.checked;
|
||||
MqttTopic.disabled = !this.checked;
|
||||
MqttUsername.disabled = !this.checked;
|
||||
MqttPassword.disabled = !this.checked;
|
||||
MqttPort.disabled = !this.checked;
|
||||
MqttServer.disabled = !this.checked;
|
||||
MqttTopic.disabled = !this.checked;
|
||||
MqttUsername.disabled = !this.checked;
|
||||
MqttPassword.disabled = !this.checked;
|
||||
MqttPort.disabled = !this.checked;
|
||||
});
|
||||
|
||||
// Reboot Switches
|
||||
const RebootModeCheckbox = document.querySelector('input[name="other.rebootMode"]');
|
||||
const RebootModeTime = document.querySelector('input[name="other.rebootModeTime"]');
|
||||
RebootModeCheckbox.addEventListener("change", function() {
|
||||
RebootModeTime.disabled = !this.checked;
|
||||
});
|
||||
|
||||
// Web Admin Switches
|
||||
const WebadminCheckbox = document.querySelector('input[name="webadmin.active"]');
|
||||
const WebadminUsername = document.querySelector('input[name="webadmin.username"]');
|
||||
const WebadminPassword = document.querySelector('input[name="webadmin.password"]');
|
||||
WebadminCheckbox.addEventListener("change", function () {
|
||||
WebadminUsername.disabled = !this.checked;
|
||||
WebadminPassword.disabled = !this.checked;
|
||||
});
|
||||
|
||||
|
||||
document.querySelector(".new button").addEventListener("click", function () {
|
||||
const networksContainer = document.querySelector(".list-networks");
|
||||
|
||||
|
||||
@@ -67,7 +67,8 @@ ___________________________________________________________________*/
|
||||
#endif
|
||||
|
||||
|
||||
String versionDate = "2025-08-27";
|
||||
String versionDate = "2025-08-29";
|
||||
String versionNumber = "3.1";
|
||||
Configuration Config;
|
||||
WiFiClient aprsIsClient;
|
||||
WiFiClient mqttClient;
|
||||
|
||||
@@ -41,6 +41,7 @@ extern String sixthLine;
|
||||
extern String seventhLine;
|
||||
extern bool modemLoggedToAPRSIS;
|
||||
extern bool backUpDigiMode;
|
||||
extern String versionNumber;
|
||||
|
||||
uint32_t lastRxTime = millis();
|
||||
bool passcodeValid = false;
|
||||
@@ -78,7 +79,9 @@ namespace APRS_IS_Utils {
|
||||
aprsAuth += Config.callsign;
|
||||
aprsAuth += " pass ";
|
||||
aprsAuth += Config.aprs_is.passcode;
|
||||
aprsAuth += " vers CA2RXU_iGate 3.0 filter ";
|
||||
aprsAuth += " vers CA2RXUiGate ";
|
||||
aprsAuth += versionNumber;
|
||||
aprsAuth += " filter ";
|
||||
aprsAuth += Config.aprs_is.filter;
|
||||
upload(aprsAuth);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,10 @@ void Configuration::writeFile() {
|
||||
data["beacon"]["gpsActive"] = beacon.gpsActive;
|
||||
data["beacon"]["gpsAmbiguity"] = beacon.gpsAmbiguity;
|
||||
|
||||
data["personalNote"] = personalNote;
|
||||
|
||||
data["blacklist"] = blacklist;
|
||||
|
||||
data["digi"]["mode"] = digi.mode;
|
||||
data["digi"]["ecoMode"] = digi.ecoMode;
|
||||
#if defined(HAS_A7670)
|
||||
@@ -113,29 +117,6 @@ void Configuration::writeFile() {
|
||||
data["tnc"]["enableSerial"] = tnc.enableSerial;
|
||||
data["tnc"]["acceptOwn"] = tnc.acceptOwn;
|
||||
|
||||
data["other"]["rebootMode"] = rebootMode;
|
||||
data["other"]["rebootModeTime"] = rebootModeTime;
|
||||
|
||||
data["ota"]["username"] = ota.username;
|
||||
data["ota"]["password"] = ota.password;
|
||||
|
||||
data["other"]["rememberStationTime"] = rememberStationTime;
|
||||
|
||||
data["other"]["backupDigiMode"] = backupDigiMode;
|
||||
|
||||
data["personalNote"] = personalNote;
|
||||
|
||||
data["blacklist"] = blacklist;
|
||||
|
||||
data["webadmin"]["active"] = webadmin.active;
|
||||
data["webadmin"]["username"] = webadmin.username;
|
||||
data["webadmin"]["password"] = webadmin.password;
|
||||
|
||||
data["ntp"]["gmtCorrection"] = ntp.gmtCorrection;
|
||||
|
||||
data["remoteManagement"]["managers"] = remoteManagement.managers;
|
||||
data["remoteManagement"]["rfOnly"] = remoteManagement.rfOnly;
|
||||
|
||||
data["mqtt"]["active"] = mqtt.active;
|
||||
data["mqtt"]["server"] = mqtt.server;
|
||||
data["mqtt"]["topic"] = mqtt.topic;
|
||||
@@ -143,6 +124,25 @@ void Configuration::writeFile() {
|
||||
data["mqtt"]["password"] = mqtt.password;
|
||||
data["mqtt"]["port"] = mqtt.port;
|
||||
|
||||
data["ota"]["username"] = ota.username;
|
||||
data["ota"]["password"] = ota.password;
|
||||
|
||||
data["webadmin"]["active"] = webadmin.active;
|
||||
data["webadmin"]["username"] = webadmin.username;
|
||||
data["webadmin"]["password"] = webadmin.password;
|
||||
|
||||
data["remoteManagement"]["managers"] = remoteManagement.managers;
|
||||
data["remoteManagement"]["rfOnly"] = remoteManagement.rfOnly;
|
||||
|
||||
data["ntp"]["gmtCorrection"] = ntp.gmtCorrection;
|
||||
|
||||
data["other"]["rebootMode"] = rebootMode;
|
||||
data["other"]["rebootModeTime"] = rebootModeTime;
|
||||
|
||||
data["other"]["rememberStationTime"] = rememberStationTime;
|
||||
|
||||
data["other"]["backupDigiMode"] = backupDigiMode;
|
||||
|
||||
serializeJson(data, configFile);
|
||||
|
||||
configFile.close();
|
||||
@@ -177,7 +177,16 @@ bool Configuration::readFile() {
|
||||
wifiAutoAP.timeout = data["wifi"]["autoAP"]["timeout"] | 10;
|
||||
|
||||
callsign = data["callsign"] | "NOCALL-10";
|
||||
rememberStationTime = data["other"]["rememberStationTime"] | 30;
|
||||
|
||||
|
||||
aprs_is.active = data["aprs_is"]["active"] | false;
|
||||
aprs_is.passcode = data["aprs_is"]["passcode"] | "XYZWV";
|
||||
aprs_is.server = data["aprs_is"]["server"] | "rotate.aprs2.net";
|
||||
aprs_is.port = data["aprs_is"]["port"] | 14580;
|
||||
aprs_is.filter = data["aprs_is"]["filter"] | "m/10";
|
||||
aprs_is.messagesToRF = data["aprs_is"]["messagesToRF"] | false;
|
||||
aprs_is.objectsToRF = data["aprs_is"]["objectsToRF"] | false;
|
||||
|
||||
|
||||
beacon.latitude = data["beacon"]["latitude"] | 0.0;
|
||||
beacon.longitude = data["beacon"]["longitude"] | 0.0;
|
||||
@@ -188,20 +197,16 @@ bool Configuration::readFile() {
|
||||
beacon.path = data["beacon"]["path"] | "WIDE1-1";
|
||||
beacon.sendViaAPRSIS = data["beacon"]["sendViaAPRSIS"] | false;
|
||||
beacon.sendViaRF = data["beacon"]["sendViaRF"] | false;
|
||||
|
||||
|
||||
beacon.statusActive = data["beacon"]["statusActive"] | false;
|
||||
beacon.statusPacket = data["beacon"]["statusPacket"] | "";
|
||||
|
||||
beacon.gpsActive = data["beacon"]["gpsActive"] | false;
|
||||
beacon.gpsAmbiguity = data["beacon"]["gpsAmbiguity"] | false;
|
||||
|
||||
aprs_is.active = data["aprs_is"]["active"] | false;
|
||||
aprs_is.passcode = data["aprs_is"]["passcode"] | "XYZWV";
|
||||
aprs_is.server = data["aprs_is"]["server"] | "rotate.aprs2.net";
|
||||
aprs_is.port = data["aprs_is"]["port"] | 14580;
|
||||
aprs_is.filter = data["aprs_is"]["filter"] | "m/10";
|
||||
aprs_is.messagesToRF = data["aprs_is"]["messagesToRF"] | false;
|
||||
aprs_is.objectsToRF = data["aprs_is"]["objectsToRF"] | false;
|
||||
personalNote = data["personalNote"] | "personal note here";
|
||||
|
||||
blacklist = data["blacklist"] | "station callsign";
|
||||
|
||||
digi.mode = data["digi"]["mode"] | 0;
|
||||
digi.ecoMode = data["digi"]["ecoMode"] | 0;
|
||||
@@ -245,38 +250,36 @@ bool Configuration::readFile() {
|
||||
syslog.server = data["syslog"]["server"] | "lora.link9.net";
|
||||
syslog.port = data["syslog"]["port"] | 1514;
|
||||
syslog.logBeaconOverTCPIP = data["syslog"]["logBeaconOverTCPIP"] | false;
|
||||
|
||||
|
||||
tnc.enableServer = data["tnc"]["enableServer"] | false;
|
||||
tnc.enableSerial = data["tnc"]["enableSerial"] | false;
|
||||
tnc.acceptOwn = data["tnc"]["acceptOwn"] | false;
|
||||
|
||||
ota.username = data["ota"]["username"] | "";
|
||||
ota.password = data["ota"]["password"] | "";
|
||||
|
||||
webadmin.active = data["webadmin"]["active"] | false;
|
||||
webadmin.username = data["webadmin"]["username"] | "admin";
|
||||
webadmin.password = data["webadmin"]["password"] | "";
|
||||
|
||||
ntp.gmtCorrection = data["ntp"]["gmtCorrection"] | 0.0;
|
||||
|
||||
backupDigiMode = data["other"]["backupDigiMode"] | false;
|
||||
|
||||
rebootMode = data["other"]["rebootMode"] | false;
|
||||
rebootModeTime = data["other"]["rebootModeTime"] | 6;
|
||||
|
||||
personalNote = data["personalNote"] | "personal note here";
|
||||
|
||||
blacklist = data["blacklist"] | "station callsign";
|
||||
|
||||
remoteManagement.managers = data["remoteManagement"]["managers"] | "";
|
||||
remoteManagement.rfOnly = data["remoteManagement"]["rfOnly"] | true;
|
||||
|
||||
mqtt.active = data["mqtt"]["active"] | false;
|
||||
mqtt.server = data["mqtt"]["server"] | "";
|
||||
mqtt.topic = data["mqtt"]["topic"] | "aprs-igate";
|
||||
mqtt.username = data["mqtt"]["username"] | "";
|
||||
mqtt.password = data["mqtt"]["password"] | "";
|
||||
mqtt.port = data["mqtt"]["port"] | 1883;
|
||||
|
||||
ota.username = data["ota"]["username"] | "";
|
||||
ota.password = data["ota"]["password"] | "";
|
||||
|
||||
webadmin.active = data["webadmin"]["active"] | false;
|
||||
webadmin.username = data["webadmin"]["username"] | "admin";
|
||||
webadmin.password = data["webadmin"]["password"] | "";
|
||||
|
||||
remoteManagement.managers = data["remoteManagement"]["managers"] | "";
|
||||
remoteManagement.rfOnly = data["remoteManagement"]["rfOnly"] | true;
|
||||
|
||||
ntp.gmtCorrection = data["ntp"]["gmtCorrection"] | 0.0;
|
||||
|
||||
rebootMode = data["other"]["rebootMode"] | false;
|
||||
rebootModeTime = data["other"]["rebootModeTime"] | 6;
|
||||
|
||||
rememberStationTime = data["other"]["rememberStationTime"] | 30;
|
||||
|
||||
backupDigiMode = data["other"]["backupDigiMode"] | false;
|
||||
|
||||
if (wifiAPs.size() == 0) { // If we don't have any WiFi's from config we need to add "empty" SSID for AUTO AP
|
||||
WiFi_AP wifiap;
|
||||
@@ -307,6 +310,14 @@ void Configuration::init() {
|
||||
|
||||
callsign = "N0CALL-10";
|
||||
|
||||
aprs_is.active = false;
|
||||
aprs_is.passcode = "XYZVW";
|
||||
aprs_is.server = "rotate.aprs2.net";
|
||||
aprs_is.port = 14580;
|
||||
aprs_is.filter = "m/10";
|
||||
aprs_is.messagesToRF = false;
|
||||
aprs_is.objectsToRF = false;
|
||||
|
||||
beacon.comment = "LoRa APRS";
|
||||
beacon.latitude = 0.0;
|
||||
beacon.longitude = 0.0;
|
||||
@@ -318,26 +329,18 @@ void Configuration::init() {
|
||||
beacon.path = "WIDE1-1";
|
||||
|
||||
beacon.statusActive = false;
|
||||
beacon.statusPacket = "";
|
||||
beacon.statusPacket = "";
|
||||
|
||||
beacon.gpsActive = false;
|
||||
beacon.gpsAmbiguity = false;
|
||||
|
||||
personalNote = "";
|
||||
|
||||
blacklist = "";
|
||||
|
||||
digi.mode = 0;
|
||||
digi.ecoMode = 0;
|
||||
|
||||
tnc.enableServer = false;
|
||||
tnc.enableSerial = false;
|
||||
tnc.acceptOwn = false;
|
||||
|
||||
aprs_is.active = false;
|
||||
aprs_is.passcode = "XYZVW";
|
||||
aprs_is.server = "rotate.aprs2.net";
|
||||
aprs_is.port = 14580;
|
||||
aprs_is.filter = "m/10";
|
||||
aprs_is.messagesToRF = false;
|
||||
aprs_is.objectsToRF = false;
|
||||
|
||||
loramodule.txFreq = 433775000;
|
||||
loramodule.rxFreq = 433775000;
|
||||
loramodule.spreadingFactor = 12;
|
||||
@@ -350,21 +353,7 @@ void Configuration::init() {
|
||||
display.alwaysOn = true;
|
||||
display.timeout = 4;
|
||||
display.turn180 = false;
|
||||
|
||||
syslog.active = false;
|
||||
syslog.server = "lora.link9.net";
|
||||
syslog.port = 1514;
|
||||
syslog.logBeaconOverTCPIP = false;
|
||||
|
||||
wxsensor.active = false;
|
||||
wxsensor.heightCorrection = 0;
|
||||
wxsensor.temperatureCorrection = 0.0;
|
||||
|
||||
ota.username = "";
|
||||
ota.password = "";
|
||||
|
||||
rememberStationTime = 30;
|
||||
|
||||
|
||||
battery.sendInternalVoltage = false;
|
||||
battery.monitorInternalVoltage = false;
|
||||
battery.internalSleepVoltage = 2.9;
|
||||
@@ -378,23 +367,18 @@ void Configuration::init() {
|
||||
|
||||
battery.sendVoltageAsTelemetry = false;
|
||||
|
||||
backupDigiMode = false;
|
||||
wxsensor.active = false;
|
||||
wxsensor.heightCorrection = 0;
|
||||
wxsensor.temperatureCorrection = 0.0;
|
||||
|
||||
rebootMode = false;
|
||||
rebootModeTime = 0;
|
||||
syslog.active = false;
|
||||
syslog.server = "lora.link9.net";
|
||||
syslog.port = 1514;
|
||||
syslog.logBeaconOverTCPIP = false;
|
||||
|
||||
personalNote = "";
|
||||
|
||||
blacklist = "";
|
||||
|
||||
webadmin.active = false;
|
||||
webadmin.username = "admin";
|
||||
webadmin.password = "";
|
||||
|
||||
ntp.gmtCorrection = 0.0;
|
||||
|
||||
remoteManagement.managers = "";
|
||||
remoteManagement.rfOnly = true;
|
||||
tnc.enableServer = false;
|
||||
tnc.enableSerial = false;
|
||||
tnc.acceptOwn = false;
|
||||
|
||||
mqtt.active = false;
|
||||
mqtt.server = "";
|
||||
@@ -403,6 +387,25 @@ void Configuration::init() {
|
||||
mqtt.password = "";
|
||||
mqtt.port = 1883;
|
||||
|
||||
ota.username = "";
|
||||
ota.password = "";
|
||||
|
||||
webadmin.active = false;
|
||||
webadmin.username = "admin";
|
||||
webadmin.password = "";
|
||||
|
||||
remoteManagement.managers = "";
|
||||
remoteManagement.rfOnly = true;
|
||||
|
||||
ntp.gmtCorrection = 0.0;
|
||||
|
||||
rebootMode = false;
|
||||
rebootModeTime = 0;
|
||||
|
||||
rememberStationTime = 30;
|
||||
|
||||
backupDigiMode = false;
|
||||
|
||||
Serial.println("All is Written!");
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,15 @@ namespace MQTT_Utils {
|
||||
}
|
||||
pubSub.setServer(Config.mqtt.server.c_str(), Config.mqtt.port);
|
||||
Serial.print("Trying to connect with MQTT Server: " + String(Config.mqtt.server) + " MqttServerPort: " + String(Config.mqtt.port));
|
||||
if (pubSub.connect(Config.callsign.c_str(), Config.mqtt.username.c_str(), Config.mqtt.password.c_str())) {
|
||||
|
||||
bool connected = false;
|
||||
if (!Config.mqtt.username.isEmpty()) {
|
||||
connected = pubSub.connect(Config.callsign.c_str(), Config.mqtt.username.c_str(), Config.mqtt.password.c_str());
|
||||
} else {
|
||||
connected = pubSub.connect(Config.callsign.c_str());
|
||||
}
|
||||
|
||||
if (connected) {
|
||||
Serial.println(" -> Connected !");
|
||||
const String subscribedTopic = Config.mqtt.topic + "/" + Config.callsign + "/#";
|
||||
if (!pubSub.subscribe(subscribedTopic.c_str())) {
|
||||
@@ -74,7 +82,7 @@ namespace MQTT_Utils {
|
||||
Serial.print("Subscribed to MQTT topic : ");
|
||||
Serial.println(subscribedTopic);
|
||||
} else {
|
||||
Serial.println(" -> Not Connected (Retry in 10 secs)");
|
||||
Serial.println(" -> Not Connected (Retry in a few secs)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ extern float snr;
|
||||
extern int freqError;
|
||||
extern bool shouldSleepLowVoltage;
|
||||
extern bool saveNewDigiEcoModeConfig;
|
||||
extern String versionNumber;
|
||||
|
||||
|
||||
namespace QUERY_Utils {
|
||||
@@ -42,7 +43,9 @@ namespace QUERY_Utils {
|
||||
if (queryQuestion == "?APRS?" || queryQuestion == "H" || queryQuestion == "HELP" || queryQuestion=="?") {
|
||||
answer.concat("?APRSV ?APRSP ?APRSL ?APRSSSR ?EM=? ?TX=? "); // ?APRSH ?WHERE callsign
|
||||
} else if (queryQuestion == "?APRSV") {
|
||||
answer.concat("CA2RXU_LoRa_iGate 3.0 v");
|
||||
answer.concat("CA2RXU_LoRa_iGate v");
|
||||
answer.concat(versionNumber);
|
||||
answer.concat(" ");
|
||||
answer.concat(versionDate);
|
||||
} else if (queryQuestion == "?APRSP") {
|
||||
answer.concat("iGate QTH: ");
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
extern Configuration Config;
|
||||
extern String versionDate;
|
||||
extern String versionNumber;
|
||||
|
||||
WiFiUDP udpClient;
|
||||
|
||||
@@ -35,7 +36,9 @@ namespace SYSLOG_Utils {
|
||||
if (Config.syslog.active && WiFi.status() == WL_CONNECTED) {
|
||||
String syslogPacket = "<165>1 - ";
|
||||
syslogPacket.concat(Config.callsign);
|
||||
syslogPacket.concat(" CA2RXU_LoRa_iGate_3.0 - - - "); //RFC5424 The Syslog Protocol
|
||||
syslogPacket.concat(" CA2RXU_LoRa_iGate_");
|
||||
syslogPacket.concat(versionNumber);
|
||||
syslogPacket.concat(" - - - "); //RFC5424 The Syslog Protocol
|
||||
|
||||
char signalData[35];
|
||||
snprintf(signalData, sizeof(signalData), " / %ddBm / %.2fdB / %dHz", rssi, snr, freqError);
|
||||
|
||||
@@ -130,19 +130,20 @@ namespace WEB_Utils {
|
||||
}
|
||||
|
||||
Config.callsign = request->getParam("callsign", true)->value();
|
||||
|
||||
|
||||
Config.wifiAutoAP.password = request->getParam("wifi.autoAP.password", true)->value();
|
||||
Config.wifiAutoAP.timeout = request->getParam("wifi.autoAP.timeout", true)->value().toInt();
|
||||
|
||||
|
||||
|
||||
Config.aprs_is.active = request->hasParam("aprs_is.active", true);
|
||||
Config.aprs_is.passcode = request->getParam("aprs_is.passcode", true)->value();
|
||||
Config.aprs_is.server = request->getParam("aprs_is.server", true)->value();
|
||||
Config.aprs_is.port = request->getParam("aprs_is.port", true)->value().toInt();
|
||||
Config.aprs_is.filter = request->getParam("aprs_is.filter", true)->value();
|
||||
Config.aprs_is.messagesToRF = request->hasParam("aprs_is.messagesToRF", true);
|
||||
Config.aprs_is.objectsToRF = request->hasParam("aprs_is.objectsToRF", true);
|
||||
|
||||
if (Config.aprs_is.active) {
|
||||
Config.aprs_is.messagesToRF = request->hasParam("aprs_is.messagesToRF", true);
|
||||
Config.aprs_is.objectsToRF = request->hasParam("aprs_is.objectsToRF", true);
|
||||
Config.aprs_is.server = request->getParam("aprs_is.server", true)->value();
|
||||
Config.aprs_is.passcode = request->getParam("aprs_is.passcode", true)->value();
|
||||
Config.aprs_is.port = request->getParam("aprs_is.port", true)->value().toInt();
|
||||
Config.aprs_is.filter = request->getParam("aprs_is.filter", true)->value();
|
||||
}
|
||||
|
||||
Config.beacon.interval = request->getParam("beacon.interval", true)->value().toInt();
|
||||
Config.beacon.sendViaAPRSIS = request->hasParam("beacon.sendViaAPRSIS", true);
|
||||
@@ -155,16 +156,20 @@ namespace WEB_Utils {
|
||||
Config.beacon.path = request->getParam("beacon.path", true)->value();
|
||||
|
||||
Config.beacon.statusActive = request->hasParam("beacon.statusActive", true);
|
||||
Config.beacon.statusPacket = request->getParam("beacon.statusPacket", true)->value();
|
||||
if (Config.beacon.statusActive) {
|
||||
Config.beacon.statusPacket = request->getParam("beacon.statusPacket", true)->value();
|
||||
}
|
||||
|
||||
Config.beacon.gpsActive = request->hasParam("beacon.gpsActive", true);
|
||||
Config.beacon.gpsAmbiguity = request->hasParam("beacon.gpsAmbiguity", true);
|
||||
|
||||
Config.personalNote = request->getParam("personalNote", true)->value();
|
||||
|
||||
Config.blacklist = request->getParam("blacklist", true)->value();
|
||||
|
||||
Config.digi.mode = request->getParam("digi.mode", true)->value().toInt();
|
||||
Config.digi.ecoMode = request->getParam("digi.ecoMode", true)->value().toInt();;
|
||||
|
||||
|
||||
Config.loramodule.txFreq = request->getParam("lora.txFreq", true)->value().toInt();
|
||||
Config.loramodule.rxFreq = request->getParam("lora.rxFreq", true)->value().toInt();
|
||||
Config.loramodule.spreadingFactor = request->getParam("lora.spreadingFactor", true)->value().toInt();
|
||||
@@ -175,16 +180,18 @@ namespace WEB_Utils {
|
||||
Config.loramodule.rxActive = request->hasParam("lora.rxActive", true);
|
||||
|
||||
|
||||
Config.display.alwaysOn = request->hasParam("display.alwaysOn", true);
|
||||
Config.display.alwaysOn = request->hasParam("display.alwaysOn", true);
|
||||
if (!Config.display.alwaysOn) {
|
||||
Config.display.timeout = request->getParam("display.timeout", true)->value().toInt();
|
||||
Config.display.timeout = request->getParam("display.timeout", true)->value().toInt();
|
||||
}
|
||||
Config.display.turn180 = request->hasParam("display.turn180", true);
|
||||
Config.display.turn180 = request->hasParam("display.turn180", true);
|
||||
|
||||
|
||||
Config.battery.sendInternalVoltage = request->hasParam("battery.sendInternalVoltage", true);
|
||||
Config.battery.monitorInternalVoltage = request->hasParam("battery.monitorInternalVoltage", true);
|
||||
Config.battery.internalSleepVoltage = request->getParam("battery.internalSleepVoltage", true)->value().toFloat();
|
||||
if (Config.battery.monitorInternalVoltage) {
|
||||
Config.battery.internalSleepVoltage = request->getParam("battery.internalSleepVoltage", true)->value().toFloat();
|
||||
}
|
||||
|
||||
Config.battery.sendExternalVoltage = request->hasParam("battery.sendExternalVoltage", true);
|
||||
if (Config.battery.sendExternalVoltage) {
|
||||
@@ -193,17 +200,20 @@ namespace WEB_Utils {
|
||||
Config.battery.voltageDividerR2 = request->getParam("battery.voltageDividerR2", true)->value().toFloat();
|
||||
}
|
||||
Config.battery.monitorExternalVoltage = request->hasParam("battery.monitorExternalVoltage", true);
|
||||
Config.battery.externalSleepVoltage = request->getParam("battery.externalSleepVoltage", true)->value().toFloat();
|
||||
|
||||
if (Config.battery.monitorExternalVoltage) {
|
||||
Config.battery.externalSleepVoltage = request->getParam("battery.externalSleepVoltage", true)->value().toFloat();
|
||||
}
|
||||
Config.battery.sendVoltageAsTelemetry = request->hasParam("battery.sendVoltageAsTelemetry", true);
|
||||
|
||||
Config.wxsensor.active = request->hasParam("wxsensor.active", true);
|
||||
Config.wxsensor.heightCorrection = request->getParam("wxsensor.heightCorrection", true)->value().toInt();
|
||||
Config.wxsensor.temperatureCorrection = request->getParam("wxsensor.temperatureCorrection", true)->value().toFloat();
|
||||
|
||||
Config.wxsensor.active = request->hasParam("wxsensor.active", true);
|
||||
if (Config.wxsensor.active) {
|
||||
Config.wxsensor.heightCorrection = request->getParam("wxsensor.heightCorrection", true)->value().toInt();
|
||||
Config.wxsensor.temperatureCorrection = request->getParam("wxsensor.temperatureCorrection", true)->value().toFloat();
|
||||
Config.beacon.symbol = "_";
|
||||
}
|
||||
|
||||
|
||||
Config.syslog.active = request->hasParam("syslog.active", true);
|
||||
if (Config.syslog.active) {
|
||||
Config.syslog.server = request->getParam("syslog.server", true)->value();
|
||||
@@ -211,23 +221,29 @@ namespace WEB_Utils {
|
||||
Config.syslog.logBeaconOverTCPIP = request->hasParam("syslog.logBeaconOverTCPIP", true);
|
||||
}
|
||||
|
||||
Config.tnc.enableServer = request->hasParam("tnc.enableServer", true);
|
||||
Config.tnc.enableSerial = request->hasParam("tnc.enableSerial", true);
|
||||
Config.tnc.acceptOwn = request->hasParam("tnc.acceptOwn", true);
|
||||
|
||||
Config.rebootMode = request->hasParam("other.rebootMode", true);
|
||||
Config.rebootModeTime = request->getParam("other.rebootModeTime", true)->value().toInt();
|
||||
Config.tnc.enableServer = request->hasParam("tnc.enableServer", true);
|
||||
Config.tnc.enableSerial = request->hasParam("tnc.enableSerial", true);
|
||||
Config.tnc.acceptOwn = request->hasParam("tnc.acceptOwn", true);
|
||||
|
||||
Config.ota.username = request->getParam("ota.username", true)->value();
|
||||
Config.ota.password = request->getParam("ota.password", true)->value();
|
||||
|
||||
Config.rememberStationTime = request->getParam("other.rememberStationTime", true)->value().toInt();
|
||||
Config.mqtt.active = request->hasParam("mqtt.active", true);
|
||||
if (Config.mqtt.active) {
|
||||
Config.mqtt.server = request->getParam("mqtt.server", true)->value();
|
||||
Config.mqtt.topic = request->getParam("mqtt.topic", true)->value();
|
||||
Config.mqtt.username = request->getParam("mqtt.username", true)->value();
|
||||
Config.mqtt.password = request->getParam("mqtt.password", true)->value();
|
||||
Config.mqtt.port = request->getParam("mqtt.port", true)->value().toInt();
|
||||
}
|
||||
|
||||
Config.backupDigiMode = request->hasParam("other.backupDigiMode", true);
|
||||
|
||||
Config.rebootMode = request->hasParam("other.rebootMode", true);
|
||||
if (Config.rebootMode) {
|
||||
Config.rebootModeTime = request->getParam("other.rebootModeTime", true)->value().toInt();
|
||||
}
|
||||
|
||||
Config.personalNote = request->getParam("personalNote", true)->value();
|
||||
|
||||
Config.blacklist = request->getParam("blacklist", true)->value();
|
||||
Config.ota.username = request->getParam("ota.username", true)->value();
|
||||
Config.ota.password = request->getParam("ota.password", true)->value();
|
||||
|
||||
Config.webadmin.active = request->hasParam("webadmin.active", true);
|
||||
if (Config.webadmin.active) {
|
||||
@@ -235,17 +251,14 @@ namespace WEB_Utils {
|
||||
Config.webadmin.password = request->getParam("webadmin.password", true)->value();
|
||||
}
|
||||
|
||||
Config.ntp.gmtCorrection = request->getParam("ntp.gmtCorrection", true)->value().toFloat();
|
||||
|
||||
Config.remoteManagement.managers = request->getParam("remoteManagement.managers", true)->value();
|
||||
Config.remoteManagement.rfOnly = request->hasParam("remoteManagement.rfOnly", true);
|
||||
|
||||
Config.mqtt.active = request->hasParam("mqtt.active", true);
|
||||
Config.mqtt.server = request->getParam("mqtt.server", true)->value();
|
||||
Config.mqtt.topic = request->getParam("mqtt.topic", true)->value();
|
||||
Config.mqtt.username = request->getParam("mqtt.username", true)->value();
|
||||
Config.mqtt.password = request->getParam("mqtt.password", true)->value();
|
||||
Config.mqtt.port = request->getParam("mqtt.port", true)->value().toInt();
|
||||
Config.ntp.gmtCorrection = request->getParam("ntp.gmtCorrection", true)->value().toFloat();
|
||||
|
||||
Config.rememberStationTime = request->getParam("other.rememberStationTime", true)->value().toInt();
|
||||
|
||||
Config.backupDigiMode = request->hasParam("other.backupDigiMode", true);
|
||||
|
||||
Config.writeFile();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user