mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-03-21 04:35:33 +01:00
a
This commit is contained in:
parent
5986125661
commit
345a6c2c21
|
|
@ -18,24 +18,18 @@
|
|||
"sendViaAPRSIS": false,
|
||||
"sendViaRF": false
|
||||
},
|
||||
"digi": {
|
||||
"mode": 0
|
||||
},
|
||||
"tnc": {
|
||||
"enableServer": false,
|
||||
"enableSerial": false,
|
||||
"acceptOwn": false
|
||||
},
|
||||
"aprs_is": {
|
||||
"active": false,
|
||||
"passcode": "XYZVW",
|
||||
"server": "rotate.aprs2.net",
|
||||
"port": 14580,
|
||||
"filter": "m/10",
|
||||
"toRF": false,
|
||||
"messagesToRF": false,
|
||||
"objectsToRF": false
|
||||
},
|
||||
"digi": {
|
||||
"mode": 0
|
||||
},
|
||||
"lora": {
|
||||
"txFreq": 433775000,
|
||||
"rxFreq": 433775000,
|
||||
|
|
@ -51,16 +45,21 @@
|
|||
"timeout": 4,
|
||||
"turn180": false
|
||||
},
|
||||
"syslog": {
|
||||
"active": false,
|
||||
"server": "192.168.0.100",
|
||||
"port": 514
|
||||
},
|
||||
"bme": {
|
||||
"active": false,
|
||||
"heightCorrection": 0,
|
||||
"temperatureCorrection": 0.0
|
||||
},
|
||||
"syslog": {
|
||||
"active": false,
|
||||
"server": "192.168.0.100",
|
||||
"port": 514
|
||||
},
|
||||
"tnc": {
|
||||
"enableServer": false,
|
||||
"enableSerial": false,
|
||||
"acceptOwn": false
|
||||
},
|
||||
"ota": {
|
||||
"username": "",
|
||||
"password": ""
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ class WiFi_AP {
|
|||
public:
|
||||
String ssid;
|
||||
String password;
|
||||
// double latitude; // deprecated
|
||||
// double longitude; // deprecated
|
||||
};
|
||||
|
||||
class WiFi_Auto_AP {
|
||||
|
|
@ -21,47 +19,40 @@ public:
|
|||
|
||||
class Beacon {
|
||||
public:
|
||||
double latitude; // new
|
||||
double longitude; // new
|
||||
String comment; // new
|
||||
String overlay; // new
|
||||
String symbol; // new
|
||||
int interval; // new
|
||||
bool sendViaRF; // new
|
||||
bool sendViaAPRSIS; // new
|
||||
String path; // new
|
||||
};
|
||||
|
||||
class DIGI {
|
||||
public:
|
||||
int mode; // new
|
||||
// String comment; // deprecated
|
||||
// double latitude; // deprecated
|
||||
// double longitude; // deprecated
|
||||
double latitude;
|
||||
double longitude;
|
||||
String comment;
|
||||
int interval;
|
||||
String overlay;
|
||||
String symbol;
|
||||
String path;
|
||||
bool sendViaRF;
|
||||
bool sendViaAPRSIS;
|
||||
};
|
||||
|
||||
class APRS_IS {
|
||||
public:
|
||||
bool active; // new
|
||||
bool active;
|
||||
String passcode;
|
||||
String server;
|
||||
int port;
|
||||
// int reportingDistance; // deprecated
|
||||
String filter; // new
|
||||
//bool toRF; // new
|
||||
String filter;
|
||||
bool messagesToRF;
|
||||
bool objectsToRF;
|
||||
};
|
||||
|
||||
class DIGI {
|
||||
public:
|
||||
int mode;
|
||||
};
|
||||
|
||||
|
||||
class LoraModule {
|
||||
public:
|
||||
// long iGateFreq; // deprecated
|
||||
// long digirepeaterTxFreq; // deprecated
|
||||
// long digirepeaterRxFreq; // deprecated
|
||||
long txFreq; // new
|
||||
long rxFreq; // new
|
||||
bool txActive; // new
|
||||
bool rxActive; // new
|
||||
long txFreq;
|
||||
long rxFreq;
|
||||
bool txActive;
|
||||
bool rxActive;
|
||||
int spreadingFactor;
|
||||
long signalBandwidth;
|
||||
int codingRate4;
|
||||
|
|
@ -75,11 +66,11 @@ public:
|
|||
bool turn180;
|
||||
};
|
||||
|
||||
class TNC {
|
||||
class BME {
|
||||
public:
|
||||
bool enableServer;
|
||||
bool enableSerial;
|
||||
bool acceptOwn;
|
||||
bool active;
|
||||
int heightCorrection;
|
||||
float temperatureCorrection;
|
||||
};
|
||||
|
||||
class SYSLOG {
|
||||
|
|
@ -89,11 +80,11 @@ public:
|
|||
int port;
|
||||
};
|
||||
|
||||
class BME {
|
||||
class TNC {
|
||||
public:
|
||||
bool active;
|
||||
int heightCorrection;
|
||||
float temperatureCorrection;
|
||||
bool enableServer;
|
||||
bool enableSerial;
|
||||
bool acceptOwn;
|
||||
};
|
||||
|
||||
class OTA {
|
||||
|
|
@ -102,18 +93,10 @@ public:
|
|||
String password;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class Configuration {
|
||||
public:
|
||||
bool reload;
|
||||
String callsign;
|
||||
// int stationMode; // deprecated
|
||||
// String iGateComment; // deprecated
|
||||
// int beaconInterval; // deprecated
|
||||
// bool igateSendsLoRaBeacons; // deprecated
|
||||
// bool igateRepeatsLoRaPackets; // deprecated
|
||||
bool reload; // ?
|
||||
String callsign;
|
||||
int rememberStationTime;
|
||||
bool sendBatteryVoltage;
|
||||
bool externalVoltageMeasurement;
|
||||
|
|
@ -125,9 +108,9 @@ public:
|
|||
int rebootModeTime;
|
||||
std::vector<WiFi_AP> wifiAPs;
|
||||
WiFi_Auto_AP wifiAutoAP;
|
||||
Beacon beacon; // new
|
||||
Beacon beacon;
|
||||
DIGI digi;
|
||||
TNC tnc; // new
|
||||
TNC tnc;
|
||||
APRS_IS aprs_is;
|
||||
LoraModule loramodule;
|
||||
Display display;
|
||||
|
|
|
|||
|
|
@ -88,75 +88,22 @@ namespace WEB_Utils {
|
|||
WiFi_AP wifiap;
|
||||
wifiap.ssid = request->getParam("wifi.AP." + String(i) + ".ssid", true)->value();
|
||||
wifiap.password = request->getParam("wifi.AP." + String(i) + ".password", true)->value();
|
||||
// wifiap.latitude = request->getParam("wifi.AP." + String(i) + ".latitude", true)->value().toDouble();
|
||||
// wifiap.longitude = request->getParam("wifi.AP." + String(i) + ".longitude", true)->value().toDouble();
|
||||
|
||||
Config.wifiAPs.push_back(wifiap);
|
||||
}
|
||||
|
||||
Config.callsign = request->getParam("callsign", true)->value();
|
||||
// Config.iGateComment = request->getParam("iGateComment", true)->value();
|
||||
|
||||
|
||||
Config.wifiAutoAP.password = request->getParam("wifi.autoAP.password", true)->value();
|
||||
Config.wifiAutoAP.powerOff = request->getParam("wifi.autoAP.powerOff", true)->value().toInt();
|
||||
|
||||
Config.digi.mode = request->getParam("digi.mode", true)->value().toInt();
|
||||
// Config.digi.comment = request->getParam("digi.comment", true)->value();
|
||||
// Config.digi.latitude = request->getParam("digi.latitude", true)->value().toDouble();
|
||||
// Config.digi.longitude = request->getParam("digi.longitude", true)->value().toDouble();
|
||||
|
||||
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.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.reportingDistance = request->getParam("aprs_is.reportingDistance", true)->value().toInt();
|
||||
Config.aprs_is.filter = request->getParam("aprs_is.filter", true)->value();
|
||||
//Config.aprs_is.toRF = request->hasParam("aprs_is.toRF", true);
|
||||
Config.aprs_is.messagesToRF = request->hasParam("aprs_is.messagesToRF", true);
|
||||
Config.aprs_is.objectsToRF = request->hasParam("aprs_is.objectsToRF", true);
|
||||
|
||||
// Config.loramodule.iGateFreq = request->getParam("lora.iGateFreq", true)->value().toInt();
|
||||
// if (request->hasParam("lora.digirepeaterTxFreq", true)) {
|
||||
// Config.loramodule.digirepeaterTxFreq = request->getParam("lora.digirepeaterTxFreq", true)->value().toInt();
|
||||
// }
|
||||
// if (request->hasParam("lora.digirepeaterRxFreq", true)) {
|
||||
// Config.loramodule.digirepeaterRxFreq = request->getParam("lora.digirepeaterRxFreq", 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();
|
||||
Config.loramodule.signalBandwidth = request->getParam("lora.signalBandwidth", true)->value().toInt();
|
||||
Config.loramodule.codingRate4 = request->getParam("lora.codingRate4", true)->value().toInt();
|
||||
Config.loramodule.power = request->getParam("lora.power", true)->value().toInt();
|
||||
Config.loramodule.txActive = request->hasParam("lora.txActive", true);
|
||||
Config.loramodule.rxActive = request->hasParam("lora.rxActive", 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.turn180 = request->hasParam("display.turn180", true);
|
||||
|
||||
Config.syslog.active = request->hasParam("syslog.active", true);
|
||||
|
||||
if (Config.syslog.active) {
|
||||
Config.syslog.server = request->getParam("syslog.server", true)->value();
|
||||
Config.syslog.port = request->getParam("syslog.port", true)->value().toInt();
|
||||
}
|
||||
|
||||
Config.bme.active = request->hasParam("bme.active", true);
|
||||
Config.bme.heightCorrection = request->getParam("bme.heightCorrection", true)->value().toInt();
|
||||
Config.bme.temperatureCorrection = request->getParam("bme.temperatureCorrection", true)->value().toFloat();
|
||||
|
||||
Config.ota.username = request->getParam("ota.username", true)->value();
|
||||
Config.ota.password = request->getParam("ota.password", true)->value();
|
||||
|
||||
Config.beacon.interval = request->getParam("beacon.interval", true)->value().toInt();
|
||||
Config.beacon.sendViaAPRSIS = request->hasParam("beacon.sendViaAPRSIS", true);
|
||||
|
|
@ -168,29 +115,59 @@ namespace WEB_Utils {
|
|||
Config.beacon.symbol = request->getParam("beacon.symbol", true)->value();
|
||||
Config.beacon.path = request->getParam("beacon.path", true)->value();
|
||||
|
||||
// Config.beaconInterval = request->getParam("other.beaconInterval", true)->value().toInt();
|
||||
// Config.igateSendsLoRaBeacons = request->hasParam("other.igateSendsLoRaBeacons", true);
|
||||
// Config.igateRepeatsLoRaPackets = request->hasParam("other.igateRepeatsLoRaPackets", true);
|
||||
Config.rememberStationTime = request->getParam("other.rememberStationTime", true)->value().toInt();
|
||||
Config.sendBatteryVoltage = request->hasParam("other.sendBatteryVoltage", true);
|
||||
Config.externalVoltageMeasurement = request->hasParam("other.externalVoltageMeasurement", true);
|
||||
Config.digi.mode = request->getParam("digi.mode", true)->value().toInt();
|
||||
|
||||
if (Config.externalVoltageMeasurement) {
|
||||
Config.externalVoltagePin = request->getParam("other.externalVoltagePin", 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();
|
||||
Config.loramodule.signalBandwidth = request->getParam("lora.signalBandwidth", true)->value().toInt();
|
||||
Config.loramodule.codingRate4 = request->getParam("lora.codingRate4", true)->value().toInt();
|
||||
Config.loramodule.power = request->getParam("lora.power", true)->value().toInt();
|
||||
Config.loramodule.txActive = request->hasParam("lora.txActive", true);
|
||||
Config.loramodule.rxActive = request->hasParam("lora.rxActive", 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.turn180 = request->hasParam("display.turn180", true);
|
||||
|
||||
Config.rebootMode = request->hasParam("other.rebootMode", true);
|
||||
Config.rebootModeTime = request->getParam("other.rebootModeTime", true)->value().toInt();
|
||||
|
||||
Config.lowPowerMode = request->hasParam("other.lowPowerMode", true);
|
||||
Config.lowVoltageCutOff = request->getParam("other.lowVoltageCutOff", true)->value().toDouble();
|
||||
|
||||
Config.backupDigiMode = request->hasParam("other.backupDigiMode", true);
|
||||
|
||||
Config.bme.active = request->hasParam("bme.active", true);
|
||||
Config.bme.heightCorrection = request->getParam("bme.heightCorrection", true)->value().toInt();
|
||||
Config.bme.temperatureCorrection = request->getParam("bme.temperatureCorrection", true)->value().toFloat();
|
||||
if (Config.bme.active) {
|
||||
Config.beacon.symbol = "_";
|
||||
}
|
||||
|
||||
Config.syslog.active = request->hasParam("syslog.active", true);
|
||||
if (Config.syslog.active) {
|
||||
Config.syslog.server = request->getParam("syslog.server", true)->value();
|
||||
Config.syslog.port = request->getParam("syslog.port", 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.rebootMode = request->hasParam("other.rebootMode", true);
|
||||
Config.rebootModeTime = request->getParam("other.rebootModeTime", true)->value().toInt();
|
||||
|
||||
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.sendBatteryVoltage = request->hasParam("other.sendBatteryVoltage", true);
|
||||
Config.externalVoltageMeasurement = request->hasParam("other.externalVoltageMeasurement", true);
|
||||
if (Config.externalVoltageMeasurement) {
|
||||
Config.externalVoltagePin = request->getParam("other.externalVoltagePin", true)->value().toInt();
|
||||
}
|
||||
|
||||
Config.backupDigiMode = request->hasParam("other.backupDigiMode", true);
|
||||
|
||||
Config.lowPowerMode = request->hasParam("other.lowPowerMode", true);
|
||||
Config.lowVoltageCutOff = request->getParam("other.lowVoltageCutOff", true)->value().toDouble();
|
||||
|
||||
Config.writeFile();
|
||||
|
||||
AsyncWebServerResponse *response = request->beginResponse(302, "text/html", "");
|
||||
|
|
|
|||
Loading…
Reference in a new issue