mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-02-07 16:24:18 +01:00
beaconOnRxFreq into beacon config
This commit is contained in:
parent
87a67cd2c9
commit
bec4f4f473
|
|
@ -17,6 +17,7 @@
|
|||
"path": "WIDE1-1",
|
||||
"sendViaAPRSIS": false,
|
||||
"sendViaRF": false,
|
||||
"beaconOnRxFreq": false,
|
||||
"statusActive": false,
|
||||
"statusPacket": "",
|
||||
"gpsActive": false,
|
||||
|
|
@ -35,8 +36,7 @@
|
|||
"blacklist": "",
|
||||
"digi": {
|
||||
"mode": 0,
|
||||
"ecoMode": 0,
|
||||
"beaconOnRxFreq": false
|
||||
"ecoMode": 0
|
||||
},
|
||||
"lora": {
|
||||
"rxActive": true,
|
||||
|
|
|
|||
|
|
@ -567,11 +567,35 @@
|
|||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-6 d-grid gap-2">
|
||||
<button class="btn btn-primary" id="send-beacon">Send beacon now</button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label
|
||||
for="digi.beaconOnRxFreq"
|
||||
class="form-label"
|
||||
>Digipeater Beacon Frequency
|
||||
<small
|
||||
>(If Rx Freq different from Tx Freq).</small
|
||||
></label
|
||||
>
|
||||
<select
|
||||
class="form-select form-select"
|
||||
name="digi.beaconOnRxFreq"
|
||||
id="digi.beaconOnRxFreq"
|
||||
>
|
||||
<option value="false">
|
||||
Beacon on Tx Freq
|
||||
</option>
|
||||
<option value="true">
|
||||
Beacon on Rx Freq
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="row mt-3">
|
||||
<div class="col-6">
|
||||
<label
|
||||
for="beacon.interval"
|
||||
|
|
@ -738,28 +762,6 @@
|
|||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 mt-3">
|
||||
<label
|
||||
for="digi.beaconOnRxFreq"
|
||||
class="form-label"
|
||||
>Digipeater Beacon Frequency
|
||||
<small
|
||||
>(If Rx Freq different from Tx Freq).</small
|
||||
></label
|
||||
>
|
||||
<select
|
||||
class="form-select form-select"
|
||||
name="digi.beaconOnRxFreq"
|
||||
id="digi.beaconOnRxFreq"
|
||||
>
|
||||
<option value="false">
|
||||
Beacon on Tx Freq
|
||||
</option>
|
||||
<option value="true">
|
||||
Beacon on Rx Freq
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ function loadSettings(settings) {
|
|||
document.getElementById("other.rememberStationTime").value = settings.other.rememberStationTime;
|
||||
document.getElementById("beacon.sendViaAPRSIS").checked = settings.beacon.sendViaAPRSIS;
|
||||
document.getElementById("beacon.sendViaRF").checked = settings.beacon.sendViaRF;
|
||||
document.getElementById("beacon.beaconOnRxFreq").value = settings.beacon.beaconOnRxFreq;
|
||||
|
||||
document.getElementById("beacon.statusActive").checked = settings.beacon.statusActive;
|
||||
document.getElementById("beacon.statusPacket").value = settings.beacon.statusPacket;
|
||||
|
|
@ -135,7 +136,6 @@ function loadSettings(settings) {
|
|||
// Digi
|
||||
document.getElementById("digi.mode").value = settings.digi.mode;
|
||||
document.getElementById("digi.ecoMode").value = settings.digi.ecoMode;
|
||||
document.getElementById("digi.beaconOnRxFreq").value = settings.digi.beaconOnRxFreq;
|
||||
|
||||
// LoRa
|
||||
document.getElementById("lora.rxActive").checked = settings.lora.rxActive;
|
||||
|
|
|
|||
|
|
@ -45,12 +45,13 @@ public:
|
|||
String overlay;
|
||||
String symbol;
|
||||
String path;
|
||||
bool sendViaRF;
|
||||
bool sendViaAPRSIS;
|
||||
bool gpsActive;
|
||||
bool gpsAmbiguity;
|
||||
bool sendViaRF;
|
||||
bool beaconOnRxFreq;
|
||||
bool statusActive;
|
||||
String statusPacket;
|
||||
bool gpsActive;
|
||||
bool gpsAmbiguity;
|
||||
};
|
||||
|
||||
class APRS_IS {
|
||||
|
|
@ -67,8 +68,7 @@ public:
|
|||
class DIGI {
|
||||
public:
|
||||
int mode;
|
||||
int ecoMode; // 0 = Not Active | 1 = Ultra EcoMode | 2 = Not Active (WiFi OFF, Serial ON)
|
||||
bool beaconOnRxFreq;
|
||||
int ecoMode; // 0 = Not Active | 1 = Ultra EcoMode | 2 = Not Active (WiFi OFF, Serial ON)
|
||||
};
|
||||
|
||||
class LoraModule {
|
||||
|
|
|
|||
|
|
@ -68,9 +68,11 @@ bool Configuration::writeFile() {
|
|||
data["beacon"]["longitude"] = beacon.longitude;
|
||||
data["beacon"]["overlay"] = beacon.overlay;
|
||||
data["beacon"]["symbol"] = beacon.symbol;
|
||||
data["beacon"]["path"] = beacon.path;
|
||||
|
||||
data["beacon"]["sendViaAPRSIS"] = beacon.sendViaAPRSIS;
|
||||
data["beacon"]["sendViaRF"] = beacon.sendViaRF;
|
||||
data["beacon"]["path"] = beacon.path;
|
||||
data["beacon"]["beaconOnRxFreq"] = beacon.beaconOnRxFreq;
|
||||
|
||||
data["beacon"]["statusActive"] = beacon.statusActive;
|
||||
data["beacon"]["statusPacket"] = beacon.statusPacket;
|
||||
|
|
@ -87,7 +89,6 @@ bool Configuration::writeFile() {
|
|||
#if defined(HAS_A7670)
|
||||
if (digi.ecoMode == 1) data["digi"]["ecoMode"] = 2;
|
||||
#endif
|
||||
data["digi"]["beaconOnRxFreq"] = digi.beaconOnRxFreq;
|
||||
|
||||
data["lora"]["rxActive"] = loramodule.rxActive;
|
||||
data["lora"]["rxFreq"] = loramodule.rxFreq;
|
||||
|
|
@ -226,6 +227,7 @@ bool Configuration::readFile() {
|
|||
!data["beacon"].containsKey("path") ||
|
||||
!data["beacon"].containsKey("sendViaAPRSIS") ||
|
||||
!data["beacon"].containsKey("sendViaRF") ||
|
||||
!data["beacon"].containsKey("beaconOnRxFreq") ||
|
||||
!data["beacon"].containsKey("statusActive") ||
|
||||
!data["beacon"].containsKey("statusPacket") ||
|
||||
!data["beacon"].containsKey("gpsActive") ||
|
||||
|
|
@ -239,6 +241,7 @@ bool Configuration::readFile() {
|
|||
beacon.path = data["beacon"]["path"] | "WIDE1-1";
|
||||
beacon.sendViaAPRSIS = data["beacon"]["sendViaAPRSIS"] | false;
|
||||
beacon.sendViaRF = data["beacon"]["sendViaRF"] | false;
|
||||
beacon.beaconOnRxFreq = data["beacon"]["beaconOnRxFreq"] | false;
|
||||
beacon.statusActive = data["beacon"]["statusActive"] | false;
|
||||
beacon.statusPacket = data["beacon"]["statusPacket"] | "";
|
||||
beacon.gpsActive = data["beacon"]["gpsActive"] | false;
|
||||
|
|
@ -251,13 +254,10 @@ bool Configuration::readFile() {
|
|||
blacklist = data["blacklist"] | "station callsign";
|
||||
|
||||
if (!data["digi"].containsKey("mode") ||
|
||||
!data["digi"].containsKey("ecoMode") ||
|
||||
!data["digi"].containsKey("beaconOnRxFreq")) needsRewrite = true;
|
||||
!data["digi"].containsKey("ecoMode")) needsRewrite = true;
|
||||
digi.mode = data["digi"]["mode"] | 0;
|
||||
digi.ecoMode = data["digi"]["ecoMode"] | 0;
|
||||
if (digi.ecoMode == 1) shouldSleepStop = false;
|
||||
digi.beaconOnRxFreq = data["digi"]["beaconOnRxFreq"] | false;
|
||||
|
||||
#if defined(HAS_A7670)
|
||||
if (digi.ecoMode == 1) digi.ecoMode = 2;
|
||||
#endif
|
||||
|
|
@ -436,10 +436,12 @@ void Configuration::setDefaultValues() {
|
|||
beacon.interval = 15;
|
||||
beacon.overlay = "L";
|
||||
beacon.symbol = "a";
|
||||
beacon.sendViaAPRSIS = true;
|
||||
beacon.sendViaRF = false;
|
||||
beacon.path = "WIDE1-1";
|
||||
|
||||
beacon.sendViaAPRSIS = true;
|
||||
beacon.sendViaRF = false;
|
||||
beacon.beaconOnRxFreq = false;
|
||||
|
||||
beacon.statusActive = false;
|
||||
beacon.statusPacket = "";
|
||||
|
||||
|
|
@ -452,7 +454,6 @@ void Configuration::setDefaultValues() {
|
|||
|
||||
digi.mode = 0;
|
||||
digi.ecoMode = 0;
|
||||
digi.beaconOnRxFreq = false;
|
||||
|
||||
loramodule.rxActive = true;
|
||||
loramodule.rxFreq = 433775000;
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ namespace LoRa_Utils {
|
|||
if (!Config.loramodule.txActive) return;
|
||||
|
||||
if (Config.loramodule.txFreq != Config.loramodule.rxFreq) {
|
||||
if (!packetIsBeacon || (packetIsBeacon && !Config.digi.beaconOnRxFreq)) {
|
||||
if (!packetIsBeacon || (packetIsBeacon && !Config.beacon.beaconOnRxFreq)) {
|
||||
changeFreqTx();
|
||||
}
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ namespace LoRa_Utils {
|
|||
if (Config.digi.ecoMode != 1) digitalWrite(INTERNAL_LED_PIN, LOW); // disabled in Ultra Eco Mode
|
||||
#endif
|
||||
if (Config.loramodule.txFreq != Config.loramodule.rxFreq) {
|
||||
if (!packetIsBeacon || (packetIsBeacon && !Config.digi.beaconOnRxFreq)) {
|
||||
if (!packetIsBeacon || (packetIsBeacon && !Config.beacon.beaconOnRxFreq)) {
|
||||
changeFreqRx();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -284,6 +284,7 @@ namespace Utils {
|
|||
Serial.println("Tx Freq less than 125kHz from Rx Freq ---> NOT VALID");
|
||||
displayShow("Tx Freq is less than ", "125kHz from Rx Freq", "device will autofix", "and then reboot", 1000);
|
||||
Config.loramodule.txFreq = Config.loramodule.rxFreq; // Inform about that but then change the TX QRG to RX QRG and reset the device
|
||||
Config.beacon.beaconOnRxFreq = false;
|
||||
Config.writeFile();
|
||||
ESP.restart();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ namespace WEB_Utils {
|
|||
Config.beacon.interval = getParamIntSafe("beacon.interval", Config.beacon.interval);
|
||||
Config.beacon.sendViaAPRSIS = request->hasParam("beacon.sendViaAPRSIS", true);
|
||||
Config.beacon.sendViaRF = request->hasParam("beacon.sendViaRF", true);
|
||||
Config.beacon.beaconOnRxFreq = request->hasParam("beacon.beaconOnRxFreq", true);
|
||||
Config.beacon.latitude = getParamDoubleSafe("beacon.latitude", Config.beacon.latitude);
|
||||
Config.beacon.longitude = getParamDoubleSafe("beacon.longitude", Config.beacon.longitude);
|
||||
Config.beacon.comment = getParamStringSafe("beacon.comment", Config.beacon.comment);
|
||||
|
|
@ -198,9 +199,8 @@ namespace WEB_Utils {
|
|||
|
||||
Config.digi.mode = getParamIntSafe("digi.mode", Config.digi.mode);
|
||||
Config.digi.ecoMode = getParamIntSafe("digi.ecoMode", Config.digi.ecoMode);
|
||||
Config.digi.beaconOnRxFreq = request->hasParam("digi.beaconOnRxFreq", true);
|
||||
|
||||
|
||||
|
||||
Config.loramodule.rxActive = request->hasParam("lora.rxActive", true);
|
||||
Config.loramodule.rxFreq = getParamIntSafe("lora.rxFreq", Config.loramodule.rxFreq);
|
||||
Config.loramodule.rxSpreadingFactor = getParamIntSafe("lora.rxSpreadingFactor", Config.loramodule.rxSpreadingFactor);
|
||||
|
|
|
|||
Loading…
Reference in a new issue