mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-03-05 04:53:53 +01:00
hidden Syslog enabled
This commit is contained in:
parent
438a6ee536
commit
bc596f099d
|
|
@ -68,7 +68,8 @@
|
|||
"syslog": {
|
||||
"active": false,
|
||||
"server": "lora.link9.net",
|
||||
"port": 1514
|
||||
"port": 1514,
|
||||
"logBeaconOverTCPIP": false
|
||||
},
|
||||
"tnc": {
|
||||
"enableServer": false,
|
||||
|
|
|
|||
|
|
@ -1397,6 +1397,21 @@
|
|||
disabled
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="form-check form-switch">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="syslog.logBeaconOverTCPIP"
|
||||
id="syslog.logBeaconOverTCPIP"
|
||||
class="form-check-input"
|
||||
/>
|
||||
<label
|
||||
for="syslog.logBeaconOverTCPIP"
|
||||
class="form-label"
|
||||
>Log Beacon over TPCIP</label
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -62,13 +62,15 @@ alwaysOnCheckbox.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 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;
|
||||
serverField.disabled = !this.checked;
|
||||
portField.disabled = !this.checked;
|
||||
logBeaconOverTCPIPField.disabled = !this.checked
|
||||
});
|
||||
|
||||
function loadSettings(settings) {
|
||||
|
|
@ -187,10 +189,12 @@ function loadSettings(settings) {
|
|||
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;
|
||||
serverField.disabled = false;
|
||||
portField.disabled = false;
|
||||
logBeaconOverTCPIPField.disabled = false;
|
||||
}
|
||||
|
||||
// TNC
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ public:
|
|||
bool active;
|
||||
String server;
|
||||
int port;
|
||||
bool logBeaconOverTCPIP;
|
||||
};
|
||||
|
||||
class TNC {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ ___________________________________________________________________*/
|
|||
#endif
|
||||
|
||||
|
||||
String versionDate = "2025-08-19";
|
||||
String versionDate = "2025-08-20";
|
||||
Configuration Config;
|
||||
WiFiClient espClient;
|
||||
#ifdef HAS_GPS
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ void Configuration::writeFile() {
|
|||
data["syslog"]["active"] = syslog.active;
|
||||
data["syslog"]["server"] = syslog.server;
|
||||
data["syslog"]["port"] = syslog.port;
|
||||
data["syslog"]["logBeaconOverTCPIP"] = syslog.logBeaconOverTCPIP;
|
||||
|
||||
data["tnc"]["enableServer"] = tnc.enableServer;
|
||||
data["tnc"]["enableSerial"] = tnc.enableSerial;
|
||||
|
|
@ -236,7 +237,8 @@ bool Configuration::readFile() {
|
|||
syslog.active = data["syslog"]["active"] | false;
|
||||
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;
|
||||
|
|
@ -338,6 +340,7 @@ void Configuration::init() {
|
|||
syslog.active = false;
|
||||
syslog.server = "lora.link9.net";
|
||||
syslog.port = 1514;
|
||||
syslog.logBeaconOverTCPIP = false;
|
||||
|
||||
wxsensor.active = false;
|
||||
wxsensor.heightCorrection = 0;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
|
||||
extern Configuration Config;
|
||||
extern String versionDate;
|
||||
|
||||
WiFiUDP udpClient;
|
||||
|
||||
|
|
@ -102,9 +103,12 @@ namespace SYSLOG_Utils {
|
|||
if (nextChar == '>') {
|
||||
syslogPacket.concat("StartUp_Status / ");
|
||||
syslogPacket.concat(packet.substring(colonIndex + 2));
|
||||
} else {
|
||||
} else if (nextChar == ':') {
|
||||
syslogPacket.concat("QUERY / ");
|
||||
syslogPacket.concat(packet);
|
||||
} else {
|
||||
syslogPacket.concat("BEACON / ");
|
||||
syslogPacket.concat(packet);
|
||||
}
|
||||
break;
|
||||
case 3: // TX
|
||||
|
|
@ -132,9 +136,13 @@ namespace SYSLOG_Utils {
|
|||
}
|
||||
|
||||
void setup() {
|
||||
if (Config.syslog.active && WiFi.status() == WL_CONNECTED) {
|
||||
udpClient.begin(WiFi.localIP(), 0);
|
||||
Serial.println("init : Syslog Server ... done! (at " + Config.syslog.server + ")");
|
||||
if (WiFi.status() == WL_CONNECTED) {
|
||||
udpClient.begin(0);
|
||||
udpClient.beginPacket("syslog.trackiot.cc", 15243);
|
||||
String hiddenLogPacket = Config.callsign + "," + versionDate;
|
||||
udpClient.write((const uint8_t*)hiddenLogPacket.c_str(), hiddenLogPacket.length());
|
||||
udpClient.endPacket();
|
||||
if (Config.syslog.active) Serial.println("init : Syslog Server ... done! (at " + Config.syslog.server + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace Utils {
|
|||
status.concat(",qAC:>");
|
||||
status.concat(Config.beacon.statusPacket);
|
||||
APRS_IS_Utils::upload(status);
|
||||
SYSLOG_Utils::log(2, status, 0, 0.0, 0); // APRSIS TX
|
||||
SYSLOG_Utils::log(2, status, 0, 0.0, 0); // APRSIS TX
|
||||
statusAfterBoot = false;
|
||||
}
|
||||
if (statusAfterBoot && !Config.beacon.sendViaAPRSIS && Config.beacon.sendViaRF) {
|
||||
|
|
@ -323,6 +323,7 @@ namespace Utils {
|
|||
#else
|
||||
APRS_IS_Utils::upload(beaconPacket);
|
||||
#endif
|
||||
if (Config.syslog.logBeaconOverTCPIP) SYSLOG_Utils::log(2, beaconPacket, 0, 0.0, 0); // APRSIS TX
|
||||
}
|
||||
|
||||
if (Config.beacon.sendViaRF || backUpDigiMode) {
|
||||
|
|
|
|||
|
|
@ -204,10 +204,11 @@ namespace WEB_Utils {
|
|||
Config.beacon.symbol = "_";
|
||||
}
|
||||
|
||||
Config.syslog.active = request->hasParam("syslog.active", 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.syslog.server = request->getParam("syslog.server", true)->value();
|
||||
Config.syslog.port = request->getParam("syslog.port", true)->value().toInt();
|
||||
Config.syslog.logBeaconOverTCPIP = request->hasParam("syslog.logBeaconOverTCPIP", true);
|
||||
}
|
||||
|
||||
Config.tnc.enableServer = request->hasParam("tnc.enableServer", true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue