mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-08-10 19:02:53 +02:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2625e7b91d | |||
| 75337d6c29 | |||
| a618383617 | |||
| 8add599838 | |||
| 83ec2265c6 | |||
| bec4f4f473 | |||
| 87a67cd2c9 |
@@ -51,11 +51,12 @@ ____________________________________________________
|
|||||||
<br />
|
<br />
|
||||||
|
|
||||||
# Timeline (Versions):
|
# Timeline (Versions):
|
||||||
|
- 2025-10-15 APRS Bridge for TNC added.
|
||||||
- 2025-10-13 Rx and Tx Frequencies are now with fully configurable.
|
- 2025-10-13 Rx and Tx Frequencies are now with fully configurable.
|
||||||
- 2025-10-13 Startup Delay to allow the Router/Modem to start WiFiAP before connecting.
|
- 2025-10-13 Startup Delay to allow the Router/Modem to start WiFiAP before connecting.
|
||||||
- 2025-10-12 Choose to send Beacon on Rx or Tx frequency in Digipeater Mode.
|
- 2025-10-12 Choose to send Beacon on Rx or Tx frequency.
|
||||||
- 2025-10-11 User defined NTP server and send beacon over MQTT added.
|
- 2025-10-11 User defined NTP server and send beacon over MQTT added.
|
||||||
- 2025-10-10 Changed Wiki into a pdf manual file.
|
- 2025-10-10 Converted the Wiki into a PDF manual.
|
||||||
- 2025-09-26 Heltec Wireless Bridge support added.
|
- 2025-09-26 Heltec Wireless Bridge support added.
|
||||||
- 2025-09-09 MQTT added (pub+sub), Status defined by Op now and many fixes more.
|
- 2025-09-09 MQTT added (pub+sub), Status defined by Op now and many fixes more.
|
||||||
- 2025-06-20 Digipeaters now with updated EcoMode (Board Sleeps until packet Rx reducing current consumption to almost 10% at idle).
|
- 2025-06-20 Digipeaters now with updated EcoMode (Board Sleeps until packet Rx reducing current consumption to almost 10% at idle).
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"path": "WIDE1-1",
|
"path": "WIDE1-1",
|
||||||
"sendViaAPRSIS": false,
|
"sendViaAPRSIS": false,
|
||||||
"sendViaRF": false,
|
"sendViaRF": false,
|
||||||
|
"beaconFreq": 1,
|
||||||
"statusActive": false,
|
"statusActive": false,
|
||||||
"statusPacket": "",
|
"statusPacket": "",
|
||||||
"gpsActive": false,
|
"gpsActive": false,
|
||||||
@@ -35,8 +36,7 @@
|
|||||||
"blacklist": "",
|
"blacklist": "",
|
||||||
"digi": {
|
"digi": {
|
||||||
"mode": 0,
|
"mode": 0,
|
||||||
"ecoMode": 0,
|
"ecoMode": 0
|
||||||
"beaconOnRxFreq": false
|
|
||||||
},
|
},
|
||||||
"lora": {
|
"lora": {
|
||||||
"rxActive": true,
|
"rxActive": true,
|
||||||
@@ -82,7 +82,8 @@
|
|||||||
"tnc": {
|
"tnc": {
|
||||||
"enableServer": false,
|
"enableServer": false,
|
||||||
"enableSerial": false,
|
"enableSerial": false,
|
||||||
"acceptOwn": false
|
"acceptOwn": false,
|
||||||
|
"aprsBrigdeActive": false
|
||||||
},
|
},
|
||||||
"mqtt": {
|
"mqtt": {
|
||||||
"active": false,
|
"active": false,
|
||||||
|
|||||||
+58
-45
@@ -567,11 +567,32 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 d-grid gap-2">
|
</div>
|
||||||
<button class="btn btn-primary" id="send-beacon">Send beacon now</button>
|
<div class="row mt-3">
|
||||||
|
<div class="col-6">
|
||||||
|
<button class="btn btn-primary form-control h-100" id="send-beacon">Send beacon now</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<label
|
||||||
|
for="beacon.beaconFreq"
|
||||||
|
class="form-label">
|
||||||
|
<small>(Select LoRa Beacon Frequency)</small>
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
class="form-select form-select"
|
||||||
|
name="beacon.beaconFreq"
|
||||||
|
id="beacon.beaconFreq"
|
||||||
|
>
|
||||||
|
<option value="0">
|
||||||
|
Beacon on Rx Freq
|
||||||
|
</option>
|
||||||
|
<option value="1">
|
||||||
|
Beacon on Tx Freq
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mt-4">
|
<div class="row mt-3">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label
|
<label
|
||||||
for="beacon.interval"
|
for="beacon.interval"
|
||||||
@@ -738,28 +759,6 @@
|
|||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1512,25 +1511,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-9 col-sm-12">
|
<div class="col-lg-9 col-sm-12">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-6">
|
||||||
<div class="form-check form-switch">
|
|
||||||
<div class="form-text">
|
|
||||||
Server will be available at port <strong>8001</strong>
|
|
||||||
</div>
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
name="tnc.enableServer"
|
|
||||||
id="tnc.enableServer"
|
|
||||||
class="form-check-input"
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
for="tnc.enableServer"
|
|
||||||
class="form-label"
|
|
||||||
>Enable TNC server</label
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12">
|
|
||||||
<div class="form-check form-switch">
|
<div class="form-check form-switch">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -1545,7 +1526,24 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-6">
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="tnc.enableServer"
|
||||||
|
id="tnc.enableServer"
|
||||||
|
class="form-check-input"
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
for="tnc.enableServer"
|
||||||
|
class="form-label"
|
||||||
|
>Enable TNC server <small><strong>(Port 8001)</strong></small></label
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mt-2">
|
||||||
|
<div class="col-6">
|
||||||
<div class="form-check form-switch">
|
<div class="form-check form-switch">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -1560,6 +1558,21 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="tnc.aprsBridgeActive"
|
||||||
|
id="tnc.aprsBridgeActive"
|
||||||
|
class="form-check-input"
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
for="tnc.aprsBridgeActive"
|
||||||
|
class="form-label"
|
||||||
|
>Enable APRS Bridge</label
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+11
-1
@@ -119,7 +119,11 @@ function loadSettings(settings) {
|
|||||||
document.getElementById("beacon.interval").value = settings.beacon.interval;
|
document.getElementById("beacon.interval").value = settings.beacon.interval;
|
||||||
document.getElementById("other.rememberStationTime").value = settings.other.rememberStationTime;
|
document.getElementById("other.rememberStationTime").value = settings.other.rememberStationTime;
|
||||||
document.getElementById("beacon.sendViaAPRSIS").checked = settings.beacon.sendViaAPRSIS;
|
document.getElementById("beacon.sendViaAPRSIS").checked = settings.beacon.sendViaAPRSIS;
|
||||||
|
|
||||||
document.getElementById("beacon.sendViaRF").checked = settings.beacon.sendViaRF;
|
document.getElementById("beacon.sendViaRF").checked = settings.beacon.sendViaRF;
|
||||||
|
document.getElementById("beacon.beaconFreq").value = settings.beacon.beaconFreq;
|
||||||
|
BeaconingViaRFCheckbox.checked = settings.beacon.sendViaRF;
|
||||||
|
BeaconingFrequency.disabled = !BeaconingViaRFCheckbox.checked;
|
||||||
|
|
||||||
document.getElementById("beacon.statusActive").checked = settings.beacon.statusActive;
|
document.getElementById("beacon.statusActive").checked = settings.beacon.statusActive;
|
||||||
document.getElementById("beacon.statusPacket").value = settings.beacon.statusPacket;
|
document.getElementById("beacon.statusPacket").value = settings.beacon.statusPacket;
|
||||||
@@ -135,7 +139,6 @@ function loadSettings(settings) {
|
|||||||
// Digi
|
// Digi
|
||||||
document.getElementById("digi.mode").value = settings.digi.mode;
|
document.getElementById("digi.mode").value = settings.digi.mode;
|
||||||
document.getElementById("digi.ecoMode").value = settings.digi.ecoMode;
|
document.getElementById("digi.ecoMode").value = settings.digi.ecoMode;
|
||||||
document.getElementById("digi.beaconOnRxFreq").value = settings.digi.beaconOnRxFreq;
|
|
||||||
|
|
||||||
// LoRa
|
// LoRa
|
||||||
document.getElementById("lora.rxActive").checked = settings.lora.rxActive;
|
document.getElementById("lora.rxActive").checked = settings.lora.rxActive;
|
||||||
@@ -203,6 +206,7 @@ function loadSettings(settings) {
|
|||||||
document.getElementById("tnc.enableServer").checked = settings.tnc.enableServer;
|
document.getElementById("tnc.enableServer").checked = settings.tnc.enableServer;
|
||||||
document.getElementById("tnc.enableSerial").checked = settings.tnc.enableSerial;
|
document.getElementById("tnc.enableSerial").checked = settings.tnc.enableSerial;
|
||||||
document.getElementById("tnc.acceptOwn").checked = settings.tnc.acceptOwn;
|
document.getElementById("tnc.acceptOwn").checked = settings.tnc.acceptOwn;
|
||||||
|
document.getElementById("tnc.aprsBridgeActive").checked = settings.tnc.aprsBridgeActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
// MQTT
|
// MQTT
|
||||||
@@ -306,6 +310,12 @@ function updateImage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Beaconing Switches
|
||||||
|
const BeaconingViaRFCheckbox = document.querySelector('input[name="beacon.sendViaRF"]');
|
||||||
|
const BeaconingFrequency = document.querySelector('select[name="beacon.beaconFreq"]');
|
||||||
|
BeaconingViaRFCheckbox.addEventListener("change", function() {
|
||||||
|
BeaconingFrequency.disabled = !this.checked;
|
||||||
|
});
|
||||||
|
|
||||||
// Status Switch
|
// Status Switch
|
||||||
const StatusCheckbox = document.querySelector('input[name="beacon.statusActive"]');
|
const StatusCheckbox = document.querySelector('input[name="beacon.statusActive"]');
|
||||||
|
|||||||
@@ -45,12 +45,13 @@ public:
|
|||||||
String overlay;
|
String overlay;
|
||||||
String symbol;
|
String symbol;
|
||||||
String path;
|
String path;
|
||||||
bool sendViaRF;
|
|
||||||
bool sendViaAPRSIS;
|
bool sendViaAPRSIS;
|
||||||
bool gpsActive;
|
bool sendViaRF;
|
||||||
bool gpsAmbiguity;
|
int beaconFreq;
|
||||||
bool statusActive;
|
bool statusActive;
|
||||||
String statusPacket;
|
String statusPacket;
|
||||||
|
bool gpsActive;
|
||||||
|
bool gpsAmbiguity;
|
||||||
};
|
};
|
||||||
|
|
||||||
class APRS_IS {
|
class APRS_IS {
|
||||||
@@ -67,8 +68,7 @@ public:
|
|||||||
class DIGI {
|
class DIGI {
|
||||||
public:
|
public:
|
||||||
int mode;
|
int mode;
|
||||||
int ecoMode; // 0 = Not Active | 1 = Ultra EcoMode | 2 = Not Active (WiFi OFF, Serial ON)
|
int ecoMode; // 0 = Not Active | 1 = Ultra EcoMode | 2 = Not Active (WiFi OFF, Serial ON)
|
||||||
bool beaconOnRxFreq;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class LoraModule {
|
class LoraModule {
|
||||||
@@ -127,6 +127,7 @@ public:
|
|||||||
bool enableServer;
|
bool enableServer;
|
||||||
bool enableSerial;
|
bool enableSerial;
|
||||||
bool acceptOwn;
|
bool acceptOwn;
|
||||||
|
bool aprsBridgeActive;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OTA {
|
class OTA {
|
||||||
|
|||||||
+2
-2
@@ -27,8 +27,8 @@ namespace TNC_Utils {
|
|||||||
void setup();
|
void setup();
|
||||||
void loop();
|
void loop();
|
||||||
|
|
||||||
void sendToClients(const String& packet);
|
void sendToClients(const String& packet, bool stripBytes = false);
|
||||||
void sendToSerial(const String& packet);
|
void sendToSerial(const String& packet, bool stripBytes = false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ ___________________________________________________________________*/
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
String versionDate = "2025-10-13";
|
String versionDate = "2025-10-15";
|
||||||
String versionNumber = "3.1.3";
|
String versionNumber = "3.1.4";
|
||||||
Configuration Config;
|
Configuration Config;
|
||||||
WiFiClient aprsIsClient;
|
WiFiClient aprsIsClient;
|
||||||
WiFiClient mqttClient;
|
WiFiClient mqttClient;
|
||||||
@@ -192,9 +192,9 @@ void loop() {
|
|||||||
DIGI_Utils::processLoRaPacket(packet); // Send received packet to Digi
|
DIGI_Utils::processLoRaPacket(packet); // Send received packet to Digi
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.tnc.enableServer) TNC_Utils::sendToClients(packet); // Send received packet to TNC KISS
|
if (Config.tnc.enableServer) TNC_Utils::sendToClients(packet, true); // Send received packet to TNC KISS
|
||||||
if (Config.tnc.enableSerial) TNC_Utils::sendToSerial(packet); // Send received packet to Serial KISS
|
if (Config.tnc.enableSerial) TNC_Utils::sendToSerial(packet, true); // Send received packet to Serial KISS
|
||||||
if (Config.mqtt.active) MQTT_Utils::sendToMqtt(packet); // Send received packet to MQTT
|
if (Config.mqtt.active) MQTT_Utils::sendToMqtt(packet); // Send received packet to MQTT
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.aprs_is.active) APRS_IS_Utils::listenAPRSIS(); // listen received packet from APRSIS
|
if (Config.aprs_is.active) APRS_IS_Utils::listenAPRSIS(); // listen received packet from APRSIS
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "query_utils.h"
|
#include "query_utils.h"
|
||||||
#include "A7670_utils.h"
|
#include "A7670_utils.h"
|
||||||
#include "digi_utils.h"
|
#include "digi_utils.h"
|
||||||
|
#include "tnc_utils.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
@@ -367,6 +368,10 @@ namespace APRS_IS_Utils {
|
|||||||
Serial.println(" ---> Rejected (Time): No Tx");
|
Serial.println(" ---> Rejected (Time): No Tx");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (Config.tnc.aprsBridgeActive) {
|
||||||
|
if (Config.tnc.enableServer) TNC_Utils::sendToClients(packet); // Send received packet to TNC KISS
|
||||||
|
if (Config.tnc.enableSerial) TNC_Utils::sendToSerial(packet); // Send received packet to Serial KISS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-10
@@ -68,9 +68,11 @@ bool Configuration::writeFile() {
|
|||||||
data["beacon"]["longitude"] = beacon.longitude;
|
data["beacon"]["longitude"] = beacon.longitude;
|
||||||
data["beacon"]["overlay"] = beacon.overlay;
|
data["beacon"]["overlay"] = beacon.overlay;
|
||||||
data["beacon"]["symbol"] = beacon.symbol;
|
data["beacon"]["symbol"] = beacon.symbol;
|
||||||
|
data["beacon"]["path"] = beacon.path;
|
||||||
|
|
||||||
data["beacon"]["sendViaAPRSIS"] = beacon.sendViaAPRSIS;
|
data["beacon"]["sendViaAPRSIS"] = beacon.sendViaAPRSIS;
|
||||||
data["beacon"]["sendViaRF"] = beacon.sendViaRF;
|
data["beacon"]["sendViaRF"] = beacon.sendViaRF;
|
||||||
data["beacon"]["path"] = beacon.path;
|
data["beacon"]["beaconFreq"] = beacon.beaconFreq;
|
||||||
|
|
||||||
data["beacon"]["statusActive"] = beacon.statusActive;
|
data["beacon"]["statusActive"] = beacon.statusActive;
|
||||||
data["beacon"]["statusPacket"] = beacon.statusPacket;
|
data["beacon"]["statusPacket"] = beacon.statusPacket;
|
||||||
@@ -87,7 +89,6 @@ bool Configuration::writeFile() {
|
|||||||
#if defined(HAS_A7670)
|
#if defined(HAS_A7670)
|
||||||
if (digi.ecoMode == 1) data["digi"]["ecoMode"] = 2;
|
if (digi.ecoMode == 1) data["digi"]["ecoMode"] = 2;
|
||||||
#endif
|
#endif
|
||||||
data["digi"]["beaconOnRxFreq"] = digi.beaconOnRxFreq;
|
|
||||||
|
|
||||||
data["lora"]["rxActive"] = loramodule.rxActive;
|
data["lora"]["rxActive"] = loramodule.rxActive;
|
||||||
data["lora"]["rxFreq"] = loramodule.rxFreq;
|
data["lora"]["rxFreq"] = loramodule.rxFreq;
|
||||||
@@ -130,6 +131,7 @@ bool Configuration::writeFile() {
|
|||||||
data["tnc"]["enableServer"] = tnc.enableServer;
|
data["tnc"]["enableServer"] = tnc.enableServer;
|
||||||
data["tnc"]["enableSerial"] = tnc.enableSerial;
|
data["tnc"]["enableSerial"] = tnc.enableSerial;
|
||||||
data["tnc"]["acceptOwn"] = tnc.acceptOwn;
|
data["tnc"]["acceptOwn"] = tnc.acceptOwn;
|
||||||
|
data["tnc"]["aprsBridgeActive"] = tnc.aprsBridgeActive;
|
||||||
|
|
||||||
data["mqtt"]["active"] = mqtt.active;
|
data["mqtt"]["active"] = mqtt.active;
|
||||||
data["mqtt"]["server"] = mqtt.server;
|
data["mqtt"]["server"] = mqtt.server;
|
||||||
@@ -226,6 +228,7 @@ bool Configuration::readFile() {
|
|||||||
!data["beacon"].containsKey("path") ||
|
!data["beacon"].containsKey("path") ||
|
||||||
!data["beacon"].containsKey("sendViaAPRSIS") ||
|
!data["beacon"].containsKey("sendViaAPRSIS") ||
|
||||||
!data["beacon"].containsKey("sendViaRF") ||
|
!data["beacon"].containsKey("sendViaRF") ||
|
||||||
|
!data["beacon"].containsKey("beaconFreq") ||
|
||||||
!data["beacon"].containsKey("statusActive") ||
|
!data["beacon"].containsKey("statusActive") ||
|
||||||
!data["beacon"].containsKey("statusPacket") ||
|
!data["beacon"].containsKey("statusPacket") ||
|
||||||
!data["beacon"].containsKey("gpsActive") ||
|
!data["beacon"].containsKey("gpsActive") ||
|
||||||
@@ -239,6 +242,7 @@ bool Configuration::readFile() {
|
|||||||
beacon.path = data["beacon"]["path"] | "WIDE1-1";
|
beacon.path = data["beacon"]["path"] | "WIDE1-1";
|
||||||
beacon.sendViaAPRSIS = data["beacon"]["sendViaAPRSIS"] | false;
|
beacon.sendViaAPRSIS = data["beacon"]["sendViaAPRSIS"] | false;
|
||||||
beacon.sendViaRF = data["beacon"]["sendViaRF"] | false;
|
beacon.sendViaRF = data["beacon"]["sendViaRF"] | false;
|
||||||
|
beacon.beaconFreq = data["beacon"]["beaconFreq"] | 1;
|
||||||
beacon.statusActive = data["beacon"]["statusActive"] | false;
|
beacon.statusActive = data["beacon"]["statusActive"] | false;
|
||||||
beacon.statusPacket = data["beacon"]["statusPacket"] | "";
|
beacon.statusPacket = data["beacon"]["statusPacket"] | "";
|
||||||
beacon.gpsActive = data["beacon"]["gpsActive"] | false;
|
beacon.gpsActive = data["beacon"]["gpsActive"] | false;
|
||||||
@@ -251,13 +255,10 @@ bool Configuration::readFile() {
|
|||||||
blacklist = data["blacklist"] | "station callsign";
|
blacklist = data["blacklist"] | "station callsign";
|
||||||
|
|
||||||
if (!data["digi"].containsKey("mode") ||
|
if (!data["digi"].containsKey("mode") ||
|
||||||
!data["digi"].containsKey("ecoMode") ||
|
!data["digi"].containsKey("ecoMode")) needsRewrite = true;
|
||||||
!data["digi"].containsKey("beaconOnRxFreq")) needsRewrite = true;
|
|
||||||
digi.mode = data["digi"]["mode"] | 0;
|
digi.mode = data["digi"]["mode"] | 0;
|
||||||
digi.ecoMode = data["digi"]["ecoMode"] | 0;
|
digi.ecoMode = data["digi"]["ecoMode"] | 0;
|
||||||
if (digi.ecoMode == 1) shouldSleepStop = false;
|
if (digi.ecoMode == 1) shouldSleepStop = false;
|
||||||
digi.beaconOnRxFreq = data["digi"]["beaconOnRxFreq"] | false;
|
|
||||||
|
|
||||||
#if defined(HAS_A7670)
|
#if defined(HAS_A7670)
|
||||||
if (digi.ecoMode == 1) digi.ecoMode = 2;
|
if (digi.ecoMode == 1) digi.ecoMode = 2;
|
||||||
#endif
|
#endif
|
||||||
@@ -331,10 +332,12 @@ bool Configuration::readFile() {
|
|||||||
|
|
||||||
if (!data["tnc"].containsKey("enableServer") ||
|
if (!data["tnc"].containsKey("enableServer") ||
|
||||||
!data["tnc"].containsKey("enableSerial") ||
|
!data["tnc"].containsKey("enableSerial") ||
|
||||||
!data["tnc"].containsKey("acceptOwn")) needsRewrite = true;
|
!data["tnc"].containsKey("acceptOwn") ||
|
||||||
|
!data["tnc"].containsKey("aprsBridgeActive")) needsRewrite = true;
|
||||||
tnc.enableServer = data["tnc"]["enableServer"] | false;
|
tnc.enableServer = data["tnc"]["enableServer"] | false;
|
||||||
tnc.enableSerial = data["tnc"]["enableSerial"] | false;
|
tnc.enableSerial = data["tnc"]["enableSerial"] | false;
|
||||||
tnc.acceptOwn = data["tnc"]["acceptOwn"] | false;
|
tnc.acceptOwn = data["tnc"]["acceptOwn"] | false;
|
||||||
|
tnc.aprsBridgeActive = data["tnc"]["aprsBridgeActive"] | false;
|
||||||
|
|
||||||
if (!data["mqtt"].containsKey("active") ||
|
if (!data["mqtt"].containsKey("active") ||
|
||||||
!data["mqtt"].containsKey("server") ||
|
!data["mqtt"].containsKey("server") ||
|
||||||
@@ -436,10 +439,12 @@ void Configuration::setDefaultValues() {
|
|||||||
beacon.interval = 15;
|
beacon.interval = 15;
|
||||||
beacon.overlay = "L";
|
beacon.overlay = "L";
|
||||||
beacon.symbol = "a";
|
beacon.symbol = "a";
|
||||||
beacon.sendViaAPRSIS = true;
|
|
||||||
beacon.sendViaRF = false;
|
|
||||||
beacon.path = "WIDE1-1";
|
beacon.path = "WIDE1-1";
|
||||||
|
|
||||||
|
beacon.sendViaAPRSIS = true;
|
||||||
|
beacon.sendViaRF = false;
|
||||||
|
beacon.beaconFreq = 1;
|
||||||
|
|
||||||
beacon.statusActive = false;
|
beacon.statusActive = false;
|
||||||
beacon.statusPacket = "";
|
beacon.statusPacket = "";
|
||||||
|
|
||||||
@@ -452,7 +457,6 @@ void Configuration::setDefaultValues() {
|
|||||||
|
|
||||||
digi.mode = 0;
|
digi.mode = 0;
|
||||||
digi.ecoMode = 0;
|
digi.ecoMode = 0;
|
||||||
digi.beaconOnRxFreq = false;
|
|
||||||
|
|
||||||
loramodule.rxActive = true;
|
loramodule.rxActive = true;
|
||||||
loramodule.rxFreq = 433775000;
|
loramodule.rxFreq = 433775000;
|
||||||
@@ -495,6 +499,7 @@ void Configuration::setDefaultValues() {
|
|||||||
tnc.enableServer = false;
|
tnc.enableServer = false;
|
||||||
tnc.enableSerial = false;
|
tnc.enableSerial = false;
|
||||||
tnc.acceptOwn = false;
|
tnc.acceptOwn = false;
|
||||||
|
tnc.aprsBridgeActive = false;
|
||||||
|
|
||||||
mqtt.active = false;
|
mqtt.active = false;
|
||||||
mqtt.server = "";
|
mqtt.server = "";
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ void displaySetup() {
|
|||||||
#ifdef HAS_EPAPER
|
#ifdef HAS_EPAPER
|
||||||
display.landscape();
|
display.landscape();
|
||||||
display.printCenter("LoRa APRS iGate Initialising...");
|
display.printCenter("LoRa APRS iGate Initialising...");
|
||||||
|
if (Config.display.turn180) display.setRotation(2);
|
||||||
display.update();
|
display.update();
|
||||||
#else
|
#else
|
||||||
#ifdef OLED_DISPLAY_HAS_RST_PIN
|
#ifdef OLED_DISPLAY_HAS_RST_PIN
|
||||||
|
|||||||
+4
-4
@@ -129,7 +129,7 @@ namespace LoRa_Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void changeFreqTx() {
|
void changeFreqTx() {
|
||||||
delay(500);
|
delay(300);
|
||||||
float freq = (float)Config.loramodule.txFreq / 1000000;
|
float freq = (float)Config.loramodule.txFreq / 1000000;
|
||||||
radio.setFrequency(freq);
|
radio.setFrequency(freq);
|
||||||
radio.setSpreadingFactor(Config.loramodule.txSpreadingFactor);
|
radio.setSpreadingFactor(Config.loramodule.txSpreadingFactor);
|
||||||
@@ -138,7 +138,7 @@ namespace LoRa_Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void changeFreqRx() {
|
void changeFreqRx() {
|
||||||
delay(500);
|
delay(300);
|
||||||
float freq = (float)Config.loramodule.rxFreq / 1000000;
|
float freq = (float)Config.loramodule.rxFreq / 1000000;
|
||||||
radio.setFrequency(freq);
|
radio.setFrequency(freq);
|
||||||
radio.setSpreadingFactor(Config.loramodule.rxSpreadingFactor);
|
radio.setSpreadingFactor(Config.loramodule.rxSpreadingFactor);
|
||||||
@@ -150,7 +150,7 @@ namespace LoRa_Utils {
|
|||||||
if (!Config.loramodule.txActive) return;
|
if (!Config.loramodule.txActive) return;
|
||||||
|
|
||||||
if (Config.loramodule.txFreq != Config.loramodule.rxFreq) {
|
if (Config.loramodule.txFreq != Config.loramodule.rxFreq) {
|
||||||
if (!packetIsBeacon || (packetIsBeacon && !Config.digi.beaconOnRxFreq)) {
|
if (!packetIsBeacon || (packetIsBeacon && Config.beacon.beaconFreq == 1)) {
|
||||||
changeFreqTx();
|
changeFreqTx();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ namespace LoRa_Utils {
|
|||||||
if (Config.digi.ecoMode != 1) digitalWrite(INTERNAL_LED_PIN, LOW); // disabled in Ultra Eco Mode
|
if (Config.digi.ecoMode != 1) digitalWrite(INTERNAL_LED_PIN, LOW); // disabled in Ultra Eco Mode
|
||||||
#endif
|
#endif
|
||||||
if (Config.loramodule.txFreq != Config.loramodule.rxFreq) {
|
if (Config.loramodule.txFreq != Config.loramodule.rxFreq) {
|
||||||
if (!packetIsBeacon || (packetIsBeacon && !Config.digi.beaconOnRxFreq)) {
|
if (!packetIsBeacon || (packetIsBeacon && Config.beacon.beaconFreq == 1)) {
|
||||||
changeFreqRx();
|
changeFreqRx();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -27,7 +27,7 @@
|
|||||||
extern Configuration Config;
|
extern Configuration Config;
|
||||||
|
|
||||||
WiFiUDP ntpUDP;
|
WiFiUDP ntpUDP;
|
||||||
NTPClient timeClient(ntpUDP, Config.ntp.server.c_str(), 0, 15 * 60 * 1000); // Update interval 15 min
|
NTPClient* timeClient;
|
||||||
|
|
||||||
|
|
||||||
namespace NTP_Utils {
|
namespace NTP_Utils {
|
||||||
@@ -35,17 +35,17 @@ namespace NTP_Utils {
|
|||||||
void setup() {
|
void setup() {
|
||||||
if (WiFi.status() == WL_CONNECTED && Config.digi.ecoMode == 0 && Config.callsign != "NOCALL-10") {
|
if (WiFi.status() == WL_CONNECTED && Config.digi.ecoMode == 0 && Config.callsign != "NOCALL-10") {
|
||||||
int gmt = Config.ntp.gmtCorrection * 3600;
|
int gmt = Config.ntp.gmtCorrection * 3600;
|
||||||
timeClient.setTimeOffset(gmt);
|
timeClient = new NTPClient(ntpUDP, Config.ntp.server.c_str(), gmt, 15 * 60 * 1000); // Update interval 15 min
|
||||||
timeClient.begin();
|
timeClient->begin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void update() {
|
void update() {
|
||||||
if (WiFi.status() == WL_CONNECTED && Config.digi.ecoMode == 0 && Config.callsign != "NOCALL-10") timeClient.update();
|
if (WiFi.status() == WL_CONNECTED && Config.digi.ecoMode == 0 && Config.callsign != "NOCALL-10") timeClient->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
String getFormatedTime() {
|
String getFormatedTime() {
|
||||||
if (Config.digi.ecoMode == 0) return timeClient.getFormattedTime();
|
if (Config.digi.ecoMode == 0) return timeClient->getFormattedTime();
|
||||||
return "DigiEcoMode Active";
|
return "DigiEcoMode Active";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-6
@@ -21,12 +21,15 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "station_utils.h"
|
#include "station_utils.h"
|
||||||
#include "kiss_protocol.h"
|
#include "kiss_protocol.h"
|
||||||
|
#include "aprs_is_utils.h"
|
||||||
#include "kiss_utils.h"
|
#include "kiss_utils.h"
|
||||||
#include "tnc_utils.h"
|
#include "tnc_utils.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
|
||||||
extern Configuration Config;
|
extern Configuration Config;
|
||||||
|
extern WiFiClient aprsIsClient;
|
||||||
|
extern bool passcodeValid;
|
||||||
|
|
||||||
#define MAX_CLIENTS 4
|
#define MAX_CLIENTS 4
|
||||||
#define INPUT_BUFFER_SIZE (2 + MAX_CLIENTS)
|
#define INPUT_BUFFER_SIZE (2 + MAX_CLIENTS)
|
||||||
@@ -94,7 +97,8 @@ namespace TNC_Utils {
|
|||||||
String sender = frame.substring(0,frame.indexOf(">"));
|
String sender = frame.substring(0,frame.indexOf(">"));
|
||||||
|
|
||||||
if (Config.tnc.acceptOwn || sender != Config.callsign) {
|
if (Config.tnc.acceptOwn || sender != Config.callsign) {
|
||||||
STATION_Utils::addToOutputPacketBuffer(frame);
|
if (Config.loramodule.txActive) STATION_Utils::addToOutputPacketBuffer(frame);
|
||||||
|
if (Config.tnc.aprsBridgeActive && Config.aprs_is.active && passcodeValid && aprsIsClient.connected()) APRS_IS_Utils::upload(frame);
|
||||||
} else {
|
} else {
|
||||||
Utils::println("Ignored own frame from KISS");
|
Utils::println("Ignored own frame from KISS");
|
||||||
}
|
}
|
||||||
@@ -131,8 +135,8 @@ namespace TNC_Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendToClients(const String& packet) {
|
void sendToClients(const String& packet, bool stripBytes) {
|
||||||
String cleanPacket = packet.substring(3);
|
String cleanPacket = stripBytes ? packet.substring(3): packet;
|
||||||
|
|
||||||
const String kissEncoded = encodeKISS(cleanPacket);
|
const String kissEncoded = encodeKISS(cleanPacket);
|
||||||
|
|
||||||
@@ -152,8 +156,8 @@ namespace TNC_Utils {
|
|||||||
Utils::println(cleanPacket);
|
Utils::println(cleanPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendToSerial(const String& packet) {
|
void sendToSerial(const String& packet, bool stripBytes) {
|
||||||
String cleanPacket = packet.substring(3);
|
String cleanPacket = stripBytes ? packet.substring(3): packet;
|
||||||
Serial.print(encodeKISS(cleanPacket));
|
Serial.print(encodeKISS(cleanPacket));
|
||||||
Serial.flush();
|
Serial.flush();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ namespace Utils {
|
|||||||
Serial.println("Tx Freq less than 125kHz from Rx Freq ---> NOT VALID");
|
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);
|
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.loramodule.txFreq = Config.loramodule.rxFreq; // Inform about that but then change the TX QRG to RX QRG and reset the device
|
||||||
|
Config.beacon.beaconFreq = 1; // return to LoRa Tx Beacon Freq
|
||||||
Config.writeFile();
|
Config.writeFile();
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -177,6 +177,7 @@ namespace WEB_Utils {
|
|||||||
Config.beacon.interval = getParamIntSafe("beacon.interval", Config.beacon.interval);
|
Config.beacon.interval = getParamIntSafe("beacon.interval", Config.beacon.interval);
|
||||||
Config.beacon.sendViaAPRSIS = request->hasParam("beacon.sendViaAPRSIS", true);
|
Config.beacon.sendViaAPRSIS = request->hasParam("beacon.sendViaAPRSIS", true);
|
||||||
Config.beacon.sendViaRF = request->hasParam("beacon.sendViaRF", true);
|
Config.beacon.sendViaRF = request->hasParam("beacon.sendViaRF", true);
|
||||||
|
Config.beacon.beaconFreq = getParamIntSafe("beacon.beaconFreq", Config.beacon.beaconFreq);
|
||||||
Config.beacon.latitude = getParamDoubleSafe("beacon.latitude", Config.beacon.latitude);
|
Config.beacon.latitude = getParamDoubleSafe("beacon.latitude", Config.beacon.latitude);
|
||||||
Config.beacon.longitude = getParamDoubleSafe("beacon.longitude", Config.beacon.longitude);
|
Config.beacon.longitude = getParamDoubleSafe("beacon.longitude", Config.beacon.longitude);
|
||||||
Config.beacon.comment = getParamStringSafe("beacon.comment", Config.beacon.comment);
|
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.mode = getParamIntSafe("digi.mode", Config.digi.mode);
|
||||||
Config.digi.ecoMode = getParamIntSafe("digi.ecoMode", Config.digi.ecoMode);
|
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.rxActive = request->hasParam("lora.rxActive", true);
|
||||||
Config.loramodule.rxFreq = getParamIntSafe("lora.rxFreq", Config.loramodule.rxFreq);
|
Config.loramodule.rxFreq = getParamIntSafe("lora.rxFreq", Config.loramodule.rxFreq);
|
||||||
Config.loramodule.rxSpreadingFactor = getParamIntSafe("lora.rxSpreadingFactor", Config.loramodule.rxSpreadingFactor);
|
Config.loramodule.rxSpreadingFactor = getParamIntSafe("lora.rxSpreadingFactor", Config.loramodule.rxSpreadingFactor);
|
||||||
@@ -259,6 +259,7 @@ namespace WEB_Utils {
|
|||||||
Config.tnc.enableServer = request->hasParam("tnc.enableServer", true);
|
Config.tnc.enableServer = request->hasParam("tnc.enableServer", true);
|
||||||
Config.tnc.enableSerial = request->hasParam("tnc.enableSerial", true);
|
Config.tnc.enableSerial = request->hasParam("tnc.enableSerial", true);
|
||||||
Config.tnc.acceptOwn = request->hasParam("tnc.acceptOwn", true);
|
Config.tnc.acceptOwn = request->hasParam("tnc.acceptOwn", true);
|
||||||
|
Config.tnc.aprsBridgeActive = request->hasParam("tnc.aprsBridgeActive", true);
|
||||||
|
|
||||||
|
|
||||||
Config.mqtt.active = request->hasParam("mqtt.active", true);
|
Config.mqtt.active = request->hasParam("mqtt.active", true);
|
||||||
|
|||||||
Reference in New Issue
Block a user