mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-11-09 23:22:21 +01:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d13227c519 | ||
|
|
9556eabd80 | ||
|
|
d75c88fc91 | ||
|
|
1257e5d9e0 | ||
|
|
bfeb0f13eb | ||
|
|
9bddbdf20a | ||
|
|
e6f8953da2 | ||
|
|
1876016509 |
No files matched your search
+4
-4
@@ -34,10 +34,10 @@ lib_deps =
|
|||||||
bblanchon/ArduinoJson @ 7.4.3
|
bblanchon/ArduinoJson @ 7.4.3
|
||||||
jgromes/RadioLib @ 7.6.0
|
jgromes/RadioLib @ 7.6.0
|
||||||
knolleary/PubSubClient @ 2.8
|
knolleary/PubSubClient @ 2.8
|
||||||
ESP32Async/AsyncTCP @ 3.4.10
|
ESP32Async/AsyncTCP @ 3.5.0
|
||||||
ESP32Async/ESPAsyncWebServer @ 3.11.1
|
ESP32Async/ESPAsyncWebServer @ 3.12.1
|
||||||
mikalhart/TinyGPSPlus @ 1.0.3
|
mikalhart/TinyGPSPlus @ 1.1.0
|
||||||
richonguzman/APRSPacketLib @ 1.0.7
|
richonguzman/APRSPacketLib @ 1.0.10
|
||||||
display_libs =
|
display_libs =
|
||||||
adafruit/Adafruit GFX Library @ 1.12.6
|
adafruit/Adafruit GFX Library @ 1.12.6
|
||||||
adafruit/Adafruit SSD1306 @ 2.5.17
|
adafruit/Adafruit SSD1306 @ 2.5.17
|
||||||
|
|||||||
+25
-1
@@ -291,7 +291,7 @@ body{background:var(--msh-bg);color:var(--msh-text);font-family:"Inter",system-u
|
|||||||
oninput="this.value = this.value.toUpperCase();"
|
oninput="this.value = this.value.toUpperCase();"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 mt-3">
|
<div class="col-12 col-md-9 mt-3">
|
||||||
<label
|
<label
|
||||||
for="beacon.comment"
|
for="beacon.comment"
|
||||||
class="form-label"
|
class="form-label"
|
||||||
@@ -305,6 +305,30 @@ body{background:var(--msh-bg);color:var(--msh-text);font-family:"Inter",system-u
|
|||||||
placeholder=""
|
placeholder=""
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-12 col-md-3 mt-3">
|
||||||
|
<label
|
||||||
|
for="beacon.rfCommentEveryXBeacons"
|
||||||
|
class="form-label"
|
||||||
|
>RF Comment every</label
|
||||||
|
>
|
||||||
|
<div class="input-group">
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
name="beacon.rfCommentEveryXBeacons"
|
||||||
|
id="beacon.rfCommentEveryXBeacons"
|
||||||
|
class="form-control"
|
||||||
|
value="1"
|
||||||
|
min="1"
|
||||||
|
max="100"
|
||||||
|
step="1"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<span class="input-group-text"
|
||||||
|
>beacons
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<small>(1 = every beacon, RF only)</small>
|
||||||
|
</div>
|
||||||
<div class="col-12 mt-3">
|
<div class="col-12 mt-3">
|
||||||
<label
|
<label
|
||||||
for="beacon.path"
|
for="beacon.path"
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ function loadSettings(settings) {
|
|||||||
document.getElementById("callsign").value = settings.callsign;
|
document.getElementById("callsign").value = settings.callsign;
|
||||||
document.getElementById("tacticalCallsign").value = settings.tacticalCallsign;
|
document.getElementById("tacticalCallsign").value = settings.tacticalCallsign;
|
||||||
document.getElementById("beacon.comment").value = settings.beacon.comment;
|
document.getElementById("beacon.comment").value = settings.beacon.comment;
|
||||||
|
document.getElementById("beacon.rfCommentEveryXBeacons").value = settings.beacon.rfCommentEveryXBeacons;
|
||||||
document.getElementById("beacon.path").value = settings.beacon.path;
|
document.getElementById("beacon.path").value = settings.beacon.path;
|
||||||
document.getElementById("beacon.symbol").value = settings.beacon.symbol;
|
document.getElementById("beacon.symbol").value = settings.beacon.symbol;
|
||||||
document.getElementById("beacon.overlay").value = settings.beacon.overlay;
|
document.getElementById("beacon.overlay").value = settings.beacon.overlay;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public:
|
|||||||
double latitude;
|
double latitude;
|
||||||
double longitude;
|
double longitude;
|
||||||
String comment;
|
String comment;
|
||||||
|
int rfCommentEveryXBeacons;
|
||||||
int interval;
|
int interval;
|
||||||
String overlay;
|
String overlay;
|
||||||
String symbol;
|
String symbol;
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
namespace GPS_Utils {
|
namespace GPS_Utils {
|
||||||
|
|
||||||
String getiGateLoRaBeaconPacket();
|
|
||||||
void generateBeacons();
|
void generateBeacons();
|
||||||
String buildDistanceAndComment(float latitude, float longitude, const String& comment);
|
String buildDistanceAndComment(float latitude, float longitude, const String& comment);
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,8 @@
|
|||||||
|
|
||||||
namespace QUERY_Utils {
|
namespace QUERY_Utils {
|
||||||
|
|
||||||
String process(const String& query, const String& station, bool queryFromAPRSIS, bool thirdParty);
|
bool isQuery(const String& message);
|
||||||
|
String process(const String& query, const String& station, bool queryFromAPRSIS, bool thirdParty);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ namespace Utils {
|
|||||||
void checkBeaconInterval();
|
void checkBeaconInterval();
|
||||||
void checkDisplayInterval();
|
void checkDisplayInterval();
|
||||||
void validateFreqs();
|
void validateFreqs();
|
||||||
|
String padForDisplay(const String& text);
|
||||||
void updateLoRaPacketDisplayInfo(APRSPacket& aprsPacket, const uint8_t packetType);
|
void updateLoRaPacketDisplayInfo(APRSPacket& aprsPacket, const uint8_t packetType);
|
||||||
void updateAPRSISPacketDisplayInfo(const String& packet);
|
void updateAPRSISPacketDisplayInfo(const String& packet);
|
||||||
void print(const String& text);
|
void print(const String& text);
|
||||||
|
|||||||
@@ -197,6 +197,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
void uploadToAPRSIS(const String& packet) {
|
void uploadToAPRSIS(const String& packet) {
|
||||||
|
if (packet == "") return; // never send an empty line to APRS-IS
|
||||||
beaconBytesSent = checkATResponse("AT+CIPSEND=0," + String(packet.length()+1));
|
beaconBytesSent = checkATResponse("AT+CIPSEND=0," + String(packet.length()+1));
|
||||||
delay(2000);
|
delay(2000);
|
||||||
if (beaconBytesSent) {
|
if (beaconBytesSent) {
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ ___________________________________________________________________*/
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
String versionDate = "2026-10-02";
|
String versionDate = "2026-10-05";
|
||||||
String versionNumber = "4.0.2";
|
String versionNumber = "4.0.2";
|
||||||
Configuration Config;
|
Configuration Config;
|
||||||
WiFiClient aprsIsClient;
|
WiFiClient aprsIsClient;
|
||||||
|
|||||||
+23
-53
@@ -60,6 +60,7 @@ uint32_t lastServerCheck = 0;
|
|||||||
namespace APRS_IS_Utils {
|
namespace APRS_IS_Utils {
|
||||||
|
|
||||||
void upload(const String& line) {
|
void upload(const String& line) {
|
||||||
|
if (line == "") return; // never send an empty line to APRS-IS
|
||||||
aprsIsClient.print(line + "\r\n");
|
aprsIsClient.print(line + "\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,37 +157,19 @@ namespace APRS_IS_Utils {
|
|||||||
int leftCurlyBraceIndex = packet.indexOf("{");
|
int leftCurlyBraceIndex = packet.indexOf("{");
|
||||||
int colonIndex = packet.indexOf(":");
|
int colonIndex = packet.indexOf(":");
|
||||||
if (leftCurlyBraceIndex > 0) { // ack?
|
if (leftCurlyBraceIndex > 0) { // ack?
|
||||||
String ackMessage = "ack";
|
String ackCallsign = (Config.tacticalCallsign == "") ? Config.callsign : Config.tacticalCallsign; // ack from the callsign the message was addressed to
|
||||||
ackMessage.concat(packet.substring(leftCurlyBraceIndex + 1));
|
String ackPath = (lastAprsPacket.header == "") ? "RFONLY," + Config.beacon.path : Config.beacon.path;
|
||||||
ackMessage.trim();
|
String ackPacket = APRSPacketLib::generateAckPacket(ackCallsign, "APLRG1", ackPath, sender, packet);
|
||||||
//Serial.println(ackMessage);
|
if (ackPacket != "") STATION_Utils::addToOutputPacketBuffer(ackPacket);
|
||||||
|
|
||||||
String addToBuffer = Config.callsign;
|
|
||||||
addToBuffer += ">APLRG1";
|
|
||||||
if (lastAprsPacket.header == "") addToBuffer += ",RFONLY";
|
|
||||||
if (Config.beacon.path != "") {
|
|
||||||
addToBuffer += ",";
|
|
||||||
addToBuffer += Config.beacon.path;
|
|
||||||
}
|
|
||||||
addToBuffer += "::";
|
|
||||||
|
|
||||||
String processedSender = sender;
|
|
||||||
for (int i = sender.length(); i < 9; i++) {
|
|
||||||
processedSender += ' ';
|
|
||||||
}
|
|
||||||
addToBuffer += processedSender;
|
|
||||||
|
|
||||||
addToBuffer += ":";
|
|
||||||
addToBuffer += ackMessage;
|
|
||||||
STATION_Utils::addToOutputPacketBuffer(addToBuffer);
|
|
||||||
receivedMessage = packet.substring(colonIndex + 1, leftCurlyBraceIndex);
|
receivedMessage = packet.substring(colonIndex + 1, leftCurlyBraceIndex);
|
||||||
} else {
|
} else {
|
||||||
receivedMessage = packet.substring(colonIndex + 1);
|
receivedMessage = packet.substring(colonIndex + 1);
|
||||||
}
|
}
|
||||||
if (receivedMessage.indexOf("?") == 0) {
|
if (QUERY_Utils::isQuery(receivedMessage)) {
|
||||||
if (!Config.display.alwaysOn && Config.display.timeout != 0) displayToggle(true);
|
if (!Config.display.alwaysOn && Config.display.timeout != 0) displayToggle(true);
|
||||||
|
|
||||||
STATION_Utils::addToOutputPacketBuffer(QUERY_Utils::process(receivedMessage, sender, false, lastAprsPacket.header != ""));
|
String queryAnswer = QUERY_Utils::process(receivedMessage, sender, false, lastAprsPacket.header != "");
|
||||||
|
if (queryAnswer != "") STATION_Utils::addToOutputPacketBuffer(queryAnswer); // unknown query: no answer
|
||||||
lastScreenOn = millis();
|
lastScreenOn = millis();
|
||||||
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, "Callsign = " + sender, "TYPE --> QUERY", 0);
|
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, "Callsign = " + sender, "TYPE --> QUERY", 0);
|
||||||
return true;
|
return true;
|
||||||
@@ -274,21 +257,9 @@ namespace APRS_IS_Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void processAckMessage(const String& sender, const String& message) {
|
void processAckMessage(const String& sender, const String& message) {
|
||||||
String ackPacket = Config.callsign;
|
String ackPacket = APRSPacketLib::generateAckPacket(Config.callsign, "APLRG1", "", sender, message);
|
||||||
ackPacket += ">APLRG1,TCPIP,qAC::";
|
if (ackPacket == "") return;
|
||||||
|
ackPacket = APRSPacketLib::generateAPRSISPacket(ackPacket);
|
||||||
String senderCallsign = sender;
|
|
||||||
for (int i = sender.length(); i < 9; i++) {
|
|
||||||
senderCallsign += ' ';
|
|
||||||
}
|
|
||||||
ackPacket += senderCallsign;
|
|
||||||
ackPacket += ":";
|
|
||||||
|
|
||||||
String ackMessage = "ack";
|
|
||||||
ackMessage += message.substring(message.indexOf("{") + 1);
|
|
||||||
ackMessage.trim();
|
|
||||||
ackPacket += ackMessage;
|
|
||||||
|
|
||||||
#ifdef HAS_A7670
|
#ifdef HAS_A7670
|
||||||
A7670_Utils::uploadToAPRSIS(ackPacket);
|
A7670_Utils::uploadToAPRSIS(ackPacket);
|
||||||
#else
|
#else
|
||||||
@@ -314,7 +285,7 @@ namespace APRS_IS_Utils {
|
|||||||
if (Config.digi.backupDigiMode) lastServerCheck = currentTime;
|
if (Config.digi.backupDigiMode) lastServerCheck = currentTime;
|
||||||
} else {
|
} else {
|
||||||
int doubleColonIndex = packet.indexOf("::");
|
int doubleColonIndex = packet.indexOf("::");
|
||||||
if (Config.aprs_is.messagesToRF && doubleColonIndex > 0) {
|
if (doubleColonIndex > 0) { // messages for this station are always answered; messagesToRF only gates forwarding to RF
|
||||||
String Sender = packet.substring(0, packet.indexOf(">"));
|
String Sender = packet.substring(0, packet.indexOf(">"));
|
||||||
const String& AddresseeAndMessage = packet.substring(doubleColonIndex + 2);
|
const String& AddresseeAndMessage = packet.substring(doubleColonIndex + 2);
|
||||||
int colonIndex = AddresseeAndMessage.indexOf(":");
|
int colonIndex = AddresseeAndMessage.indexOf(":");
|
||||||
@@ -329,7 +300,7 @@ namespace APRS_IS_Utils {
|
|||||||
} else {
|
} else {
|
||||||
receivedMessage = AddresseeAndMessage.substring(colonIndex + 1);
|
receivedMessage = AddresseeAndMessage.substring(colonIndex + 1);
|
||||||
}
|
}
|
||||||
if (receivedMessage.indexOf("?") == 0) {
|
if (QUERY_Utils::isQuery(receivedMessage)) {
|
||||||
Utils::println("Rx Query (APRS-IS) : " + packet);
|
Utils::println("Rx Query (APRS-IS) : " + packet);
|
||||||
String queryAnswer = QUERY_Utils::process(receivedMessage, Sender, true, false);
|
String queryAnswer = QUERY_Utils::process(receivedMessage, Sender, true, false);
|
||||||
//Serial.println("---> QUERY Answer : " + queryAnswer.substring(0,queryAnswer.indexOf("\n")));
|
//Serial.println("---> QUERY Answer : " + queryAnswer.substring(0,queryAnswer.indexOf("\n")));
|
||||||
@@ -337,24 +308,23 @@ namespace APRS_IS_Utils {
|
|||||||
displayToggle(true);
|
displayToggle(true);
|
||||||
}
|
}
|
||||||
lastScreenOn = currentTime;
|
lastScreenOn = currentTime;
|
||||||
#ifdef HAS_A7670
|
if (queryAnswer != "") { // unknown query: no answer
|
||||||
A7670_Utils::uploadToAPRSIS(queryAnswer);
|
#ifdef HAS_A7670
|
||||||
#else
|
A7670_Utils::uploadToAPRSIS(queryAnswer);
|
||||||
upload(queryAnswer);
|
#else
|
||||||
#endif
|
upload(queryAnswer);
|
||||||
SYSLOG_Utils::logAPRSISTx(queryAnswer);
|
#endif
|
||||||
fifthLine = "APRS-IS ----> APRS-IS";
|
SYSLOG_Utils::logAPRSISTx(queryAnswer);
|
||||||
sixthLine = Config.callsign;
|
|
||||||
for (int j = sixthLine.length();j < 9;j++) {
|
|
||||||
sixthLine += " ";
|
|
||||||
}
|
}
|
||||||
|
fifthLine = "APRS-IS ----> APRS-IS";
|
||||||
|
sixthLine = Utils::padForDisplay(Config.callsign);
|
||||||
sixthLine += "> ";
|
sixthLine += "> ";
|
||||||
sixthLine += Sender;
|
sixthLine += Sender;
|
||||||
seventhLine = "QUERY = ";
|
seventhLine = "QUERY = ";
|
||||||
seventhLine += receivedMessage;
|
seventhLine += receivedMessage;
|
||||||
}
|
}
|
||||||
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
|
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
|
||||||
} else {
|
} else if (Config.aprs_is.messagesToRF) {
|
||||||
Utils::print("Rx Message (APRS-IS): " + packet);
|
Utils::print("Rx Message (APRS-IS): " + packet);
|
||||||
if (STATION_Utils::wasHeard(Addressee) && packet.indexOf("EQNS.") == -1 && packet.indexOf("UNIT.") == -1 && packet.indexOf("PARM.") == -1) {
|
if (STATION_Utils::wasHeard(Addressee) && packet.indexOf("EQNS.") == -1 && packet.indexOf("UNIT.") == -1 && packet.indexOf("PARM.") == -1) {
|
||||||
STATION_Utils::addToOutputPacketBuffer(buildPacketToTx(packet, 1));
|
STATION_Utils::addToOutputPacketBuffer(buildPacketToTx(packet, 1));
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ bool Configuration::writeFile() {
|
|||||||
data["aprs_is"]["objectsToRF"] = aprs_is.objectsToRF;
|
data["aprs_is"]["objectsToRF"] = aprs_is.objectsToRF;
|
||||||
|
|
||||||
data["beacon"]["comment"] = beacon.comment;
|
data["beacon"]["comment"] = beacon.comment;
|
||||||
|
data["beacon"]["rfCommentEveryXBeacons"] = beacon.rfCommentEveryXBeacons;
|
||||||
data["beacon"]["interval"] = beacon.interval;
|
data["beacon"]["interval"] = beacon.interval;
|
||||||
data["beacon"]["latitude"] = beacon.latitude;
|
data["beacon"]["latitude"] = beacon.latitude;
|
||||||
data["beacon"]["longitude"] = beacon.longitude;
|
data["beacon"]["longitude"] = beacon.longitude;
|
||||||
@@ -249,6 +250,7 @@ bool Configuration::readFile() {
|
|||||||
if (data["beacon"]["latitude"].isNull() ||
|
if (data["beacon"]["latitude"].isNull() ||
|
||||||
data["beacon"]["longitude"].isNull() ||
|
data["beacon"]["longitude"].isNull() ||
|
||||||
data["beacon"]["comment"].isNull() ||
|
data["beacon"]["comment"].isNull() ||
|
||||||
|
data["beacon"]["rfCommentEveryXBeacons"].isNull() ||
|
||||||
data["beacon"]["interval"].isNull() ||
|
data["beacon"]["interval"].isNull() ||
|
||||||
data["beacon"]["overlay"].isNull() ||
|
data["beacon"]["overlay"].isNull() ||
|
||||||
data["beacon"]["symbol"].isNull() ||
|
data["beacon"]["symbol"].isNull() ||
|
||||||
@@ -263,6 +265,7 @@ bool Configuration::readFile() {
|
|||||||
beacon.latitude = data["beacon"]["latitude"] | 0.0;
|
beacon.latitude = data["beacon"]["latitude"] | 0.0;
|
||||||
beacon.longitude = data["beacon"]["longitude"] | 0.0;
|
beacon.longitude = data["beacon"]["longitude"] | 0.0;
|
||||||
beacon.comment = data["beacon"]["comment"] | "LoRa APRS";
|
beacon.comment = data["beacon"]["comment"] | "LoRa APRS";
|
||||||
|
beacon.rfCommentEveryXBeacons = data["beacon"]["rfCommentEveryXBeacons"] | 1;
|
||||||
beacon.interval = data["beacon"]["interval"] | 15;
|
beacon.interval = data["beacon"]["interval"] | 15;
|
||||||
beacon.overlay = data["beacon"]["overlay"] | "L";
|
beacon.overlay = data["beacon"]["overlay"] | "L";
|
||||||
beacon.symbol = data["beacon"]["symbol"] | "a";
|
beacon.symbol = data["beacon"]["symbol"] | "a";
|
||||||
@@ -472,6 +475,7 @@ void Configuration::setDefaultValues() {
|
|||||||
aprs_is.objectsToRF = false;
|
aprs_is.objectsToRF = false;
|
||||||
|
|
||||||
beacon.comment = "LoRa APRS";
|
beacon.comment = "LoRa APRS";
|
||||||
|
beacon.rfCommentEveryXBeacons = 1;
|
||||||
beacon.latitude = 0.0;
|
beacon.latitude = 0.0;
|
||||||
beacon.longitude = 0.0;
|
beacon.longitude = 0.0;
|
||||||
beacon.interval = 15;
|
beacon.interval = 15;
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
extern Configuration Config;
|
extern Configuration Config;
|
||||||
extern uint32_t lastScreenOn;
|
extern uint32_t lastScreenOn;
|
||||||
extern APRSPacket lastAprsPacket;
|
extern APRSPacket lastAprsPacket;
|
||||||
extern String iGateBeaconPacket;
|
|
||||||
extern String firstLine;
|
extern String firstLine;
|
||||||
extern String secondLine;
|
extern String secondLine;
|
||||||
extern String thirdLine;
|
extern String thirdLine;
|
||||||
|
|||||||
+6
-16
@@ -40,7 +40,7 @@ extern Configuration Config;
|
|||||||
extern HardwareSerial gpsSerial;
|
extern HardwareSerial gpsSerial;
|
||||||
extern TinyGPSPlus gps;
|
extern TinyGPSPlus gps;
|
||||||
extern bool stationCallsignIsValid;
|
extern bool stationCallsignIsValid;
|
||||||
String distance, iGateBeaconPacket, iGateLoRaBeaconPacket;
|
String distance, iGateAPRSISBeaconPacket, iGateLoRaBeaconPacket;
|
||||||
|
|
||||||
|
|
||||||
namespace GPS_Utils {
|
namespace GPS_Utils {
|
||||||
@@ -115,13 +115,8 @@ namespace GPS_Utils {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
String getiGateLoRaBeaconPacket() {
|
|
||||||
return iGateLoRaBeaconPacket;
|
|
||||||
}
|
|
||||||
|
|
||||||
void generateBeacons() {
|
void generateBeacons() {
|
||||||
String beaconPacket = APRSPacketLib::generateBasePacket(Config.callsign, "APLRG1", Config.beacon.path);
|
String beaconCallsign = Config.callsign;
|
||||||
String encodedGPS = APRSPacketLib::encodeGPSIntoBase91(Config.beacon.latitude, Config.beacon.longitude, 0, 0, Config.beacon.symbol, false, 0, true, Config.beacon.ambiguityLevel);
|
|
||||||
|
|
||||||
if (Config.callsign.indexOf("NOCALL-10") != 0) {
|
if (Config.callsign.indexOf("NOCALL-10") != 0) {
|
||||||
if (!stationCallsignIsValid) {
|
if (!stationCallsignIsValid) {
|
||||||
@@ -133,7 +128,7 @@ namespace GPS_Utils {
|
|||||||
Config.digi.mode = 0;
|
Config.digi.mode = 0;
|
||||||
Config.digi.backupDigiMode = false;
|
Config.digi.backupDigiMode = false;
|
||||||
} else if (stationCallsignIsValid && Config.tacticalCallsign != "") {
|
} else if (stationCallsignIsValid && Config.tacticalCallsign != "") {
|
||||||
beaconPacket = APRSPacketLib::generateBasePacket(Config.tacticalCallsign, "APLRG1", Config.beacon.path);
|
beaconCallsign = Config.tacticalCallsign;
|
||||||
Config.aprs_is.active = false;
|
Config.aprs_is.active = false;
|
||||||
Config.beacon.sendViaAPRSIS = false;
|
Config.beacon.sendViaAPRSIS = false;
|
||||||
Config.digi.backupDigiMode = false;
|
Config.digi.backupDigiMode = false;
|
||||||
@@ -143,15 +138,10 @@ namespace GPS_Utils {
|
|||||||
Config.beacon.sendViaRF = false;
|
Config.beacon.sendViaRF = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
iGateBeaconPacket = beaconPacket;
|
String encodedGPS = APRSPacketLib::encodeGPSIntoBase91(Config.beacon.latitude, Config.beacon.longitude, 0, 0, Config.beacon.symbol, false, 0, true, Config.beacon.ambiguityLevel);
|
||||||
iGateBeaconPacket += ",qAC:=";
|
|
||||||
iGateBeaconPacket += Config.beacon.overlay;
|
|
||||||
iGateBeaconPacket += encodedGPS;
|
|
||||||
|
|
||||||
iGateLoRaBeaconPacket = beaconPacket;
|
iGateLoRaBeaconPacket = APRSPacketLib::generateBase91GPSBeaconPacket(beaconCallsign, "APLRG1", Config.beacon.path, Config.beacon.overlay, encodedGPS);
|
||||||
iGateLoRaBeaconPacket += ":=";
|
iGateAPRSISBeaconPacket = APRSPacketLib::generateAPRSISPacket(iGateLoRaBeaconPacket);
|
||||||
iGateLoRaBeaconPacket += Config.beacon.overlay;
|
|
||||||
iGateLoRaBeaconPacket += encodedGPS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double calculateDistanceTo(double latitude, double longitude) {
|
double calculateDistanceTo(double latitude, double longitude) {
|
||||||
|
|||||||
+1
-1
@@ -142,7 +142,7 @@ namespace LoRa_Utils {
|
|||||||
#endif
|
#endif
|
||||||
#if defined(HAS_SX1278) || defined(HAS_SX1276)
|
#if defined(HAS_SX1278) || defined(HAS_SX1276)
|
||||||
state = radio.setOutputPower(Config.loramodule.power); // max value 20dB for 400M30S as it has Low Noise Amp
|
state = radio.setOutputPower(Config.loramodule.power); // max value 20dB for 400M30S as it has Low Noise Amp
|
||||||
radio.setCurrentLimit(100); // to be validated (80 , 100)?
|
radio.setCurrentLimit(120); // OCP ceiling for SX127x: ~120mA needed at +20dBm (not a fixed consumption)
|
||||||
#endif
|
#endif
|
||||||
#if (defined(HAS_SX1268) || defined(HAS_SX1262)) && !defined(HAS_1W_LORA)
|
#if (defined(HAS_SX1268) || defined(HAS_SX1262)) && !defined(HAS_1W_LORA)
|
||||||
state = radio.setOutputPower(Config.loramodule.power + 2); // values available: 10, 17, 22 --> if 20 in tracker_conf.json it will be updated to 22.
|
state = radio.setOutputPower(Config.loramodule.power + 2); // values available: 10, 17, 22 --> if 20 in tracker_conf.json it will be updated to 22.
|
||||||
|
|||||||
+16
-26
@@ -16,6 +16,7 @@
|
|||||||
* along with LoRa APRS iGate. If not, see <https://www.gnu.org/licenses/>.
|
* along with LoRa APRS iGate. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <APRSPacketLib.h>
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "battery_utils.h"
|
#include "battery_utils.h"
|
||||||
#include "station_utils.h"
|
#include "station_utils.h"
|
||||||
@@ -36,11 +37,17 @@ extern String versionNumber;
|
|||||||
|
|
||||||
namespace QUERY_Utils {
|
namespace QUERY_Utils {
|
||||||
|
|
||||||
|
bool isQuery(const String& message) { // "?..." queries, plus "HELP" (any case) without the "?"
|
||||||
|
String queryQuestion = message;
|
||||||
|
queryQuestion.toUpperCase();
|
||||||
|
return queryQuestion.startsWith("?") || queryQuestion == "HELP";
|
||||||
|
}
|
||||||
|
|
||||||
String process(const String& query, const String& station, bool queryFromAPRSIS, bool thirdParty) {
|
String process(const String& query, const String& station, bool queryFromAPRSIS, bool thirdParty) {
|
||||||
String answer;
|
String answer;
|
||||||
String queryQuestion = query;
|
String queryQuestion = query;
|
||||||
queryQuestion.toUpperCase();
|
queryQuestion.toUpperCase();
|
||||||
if (queryQuestion == "?APRS?" || queryQuestion == "H" || queryQuestion == "HELP" || queryQuestion=="?") {
|
if (queryQuestion == "?APRS?" || queryQuestion == "?" || queryQuestion == "HELP") {
|
||||||
answer.concat("?APRSV ?APRSP ?APRSL ?APRSSR ?EM=? ?TX=? "); // ?APRSH ?WHERE callsign
|
answer.concat("?APRSV ?APRSP ?APRSL ?APRSSR ?EM=? ?TX=? "); // ?APRSH ?WHERE callsign
|
||||||
} else if (queryQuestion == "?APRSV") {
|
} else if (queryQuestion == "?APRSV") {
|
||||||
answer.concat("CA2RXU_LoRa_iGate v");
|
answer.concat("CA2RXU_LoRa_iGate v");
|
||||||
@@ -139,32 +146,15 @@ namespace QUERY_Utils {
|
|||||||
|
|
||||||
if (answer == "") return "";
|
if (answer == "") return "";
|
||||||
|
|
||||||
String queryAnswer = (Config.tacticalCallsign == "" ? Config.callsign : Config.tacticalCallsign);
|
answer += " *";
|
||||||
queryAnswer += ">APLRG1";
|
answer += char(random(97, 123));
|
||||||
if (queryFromAPRSIS) {
|
answer += char(random(97, 123));
|
||||||
queryAnswer += ",TCPIP,qAC";
|
answer += "*";
|
||||||
} else {
|
|
||||||
if (!thirdParty) queryAnswer += ",RFONLY";
|
|
||||||
if (Config.beacon.path != "") {
|
|
||||||
queryAnswer += ",";
|
|
||||||
queryAnswer += Config.beacon.path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
queryAnswer += "::";
|
|
||||||
|
|
||||||
String processedStation = station;
|
String queryCallsign = (Config.tacticalCallsign == "") ? Config.callsign : Config.tacticalCallsign;
|
||||||
for (int i = station.length(); i < 9; i++) {
|
String queryPath = queryFromAPRSIS ? "" : (thirdParty ? Config.beacon.path : "RFONLY," + Config.beacon.path);
|
||||||
processedStation += ' ';
|
String queryAnswer = APRSPacketLib::generateMessagePacket(queryCallsign, "APLRG1", queryPath, station, answer);
|
||||||
}
|
return queryFromAPRSIS ? APRSPacketLib::generateAPRSISPacket(queryAnswer) : queryAnswer;
|
||||||
queryAnswer += processedStation;
|
|
||||||
queryAnswer += ":";
|
|
||||||
queryAnswer += answer;
|
|
||||||
|
|
||||||
queryAnswer += " *";
|
|
||||||
queryAnswer += char(random(97, 123));
|
|
||||||
queryAnswer += char(random(97, 123));
|
|
||||||
queryAnswer += "*";
|
|
||||||
return queryAnswer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -234,6 +234,7 @@ namespace STATION_Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void addToOutputPacketBuffer(const String& packet, bool flag) {
|
void addToOutputPacketBuffer(const String& packet, bool flag) {
|
||||||
|
if (packet == "") return; // never queue an empty packet
|
||||||
outputPacketBuffer.emplace_back(OutputPacketBuffer{packet, flag});
|
outputPacketBuffer.emplace_back(OutputPacketBuffer{packet, flag});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,8 +71,9 @@ namespace TELEMETRY_Utils {
|
|||||||
void sendBaseTelemetryPacket(const String& prefix, const std::vector<String>& values) {
|
void sendBaseTelemetryPacket(const String& prefix, const std::vector<String>& values) {
|
||||||
String packet = prefix + joinWithCommas(values);
|
String packet = prefix + joinWithCommas(values);
|
||||||
String currentCallsign = (Config.tacticalCallsign != "") ? Config.tacticalCallsign : Config.callsign;
|
String currentCallsign = (Config.tacticalCallsign != "") ? Config.tacticalCallsign : Config.callsign;
|
||||||
|
String baseRFTelemetryPacket = APRSPacketLib::generateMessagePacket(currentCallsign, "APLRG1", Config.beacon.path, currentCallsign, packet);
|
||||||
if (Config.beacon.sendViaAPRSIS) {
|
if (Config.beacon.sendViaAPRSIS) {
|
||||||
String baseAPRSISTelemetryPacket = APRSPacketLib::generateMessagePacket(currentCallsign, "APLRG1", "TCPIP,qAC", currentCallsign, packet);
|
String baseAPRSISTelemetryPacket = APRSPacketLib::generateAPRSISPacket(baseRFTelemetryPacket);
|
||||||
#ifdef HAS_A7670
|
#ifdef HAS_A7670
|
||||||
A7670_Utils::uploadToAPRSIS(baseAPRSISTelemetryPacket);
|
A7670_Utils::uploadToAPRSIS(baseAPRSISTelemetryPacket);
|
||||||
#else
|
#else
|
||||||
@@ -80,7 +81,6 @@ namespace TELEMETRY_Utils {
|
|||||||
#endif
|
#endif
|
||||||
delay(300);
|
delay(300);
|
||||||
} else if (Config.beacon.sendViaRF) {
|
} else if (Config.beacon.sendViaRF) {
|
||||||
String baseRFTelemetryPacket = APRSPacketLib::generateMessagePacket(currentCallsign, "APLRG1", Config.beacon.path, currentCallsign, packet);
|
|
||||||
LoRa_Utils::sendNewPacket(baseRFTelemetryPacket);
|
LoRa_Utils::sendNewPacket(baseRFTelemetryPacket);
|
||||||
delay(3000);
|
delay(3000);
|
||||||
}
|
}
|
||||||
|
|||||||
+49
-57
@@ -48,7 +48,7 @@ extern String fourthLine;
|
|||||||
extern String fifthLine;
|
extern String fifthLine;
|
||||||
extern String sixthLine;
|
extern String sixthLine;
|
||||||
extern String seventhLine;
|
extern String seventhLine;
|
||||||
extern String iGateBeaconPacket;
|
extern String iGateAPRSISBeaconPacket;
|
||||||
extern String iGateLoRaBeaconPacket;
|
extern String iGateLoRaBeaconPacket;
|
||||||
extern int rssi;
|
extern int rssi;
|
||||||
extern float snr;
|
extern float snr;
|
||||||
@@ -69,8 +69,7 @@ uint32_t lastBeaconTx = 0;
|
|||||||
uint32_t lastScreenOn = millis();
|
uint32_t lastScreenOn = millis();
|
||||||
uint32_t lastStatusTx = 0;
|
uint32_t lastStatusTx = 0;
|
||||||
bool stationCallsignIsValid = false;
|
bool stationCallsignIsValid = false;
|
||||||
String beaconPacket;
|
uint32_t rfBeaconCounter = 0;
|
||||||
String secondaryBeaconPacket;
|
|
||||||
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
@@ -84,13 +83,13 @@ namespace Utils {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String statusPacket = APRSPacketLib::generateBasePacket(Config.callsign, "APLRG1", Config.beacon.path);
|
String statusCallsign = (Config.tacticalCallsign == "") ? Config.callsign : Config.tacticalCallsign;
|
||||||
statusPacket += sendOverAPRSIS ? ",qAC:>" : ":>";
|
String statusPacket = APRSPacketLib::generateStatusPacket(statusCallsign, "APLRG1", Config.beacon.path, Config.beacon.statusPacket);
|
||||||
statusPacket += Config.beacon.statusPacket;
|
|
||||||
|
|
||||||
if (sendOverAPRSIS) {
|
if (sendOverAPRSIS) {
|
||||||
APRS_IS_Utils::upload(statusPacket);
|
String aprsisStatusPacket = APRSPacketLib::generateAPRSISPacket(statusPacket);
|
||||||
SYSLOG_Utils::logAPRSISTx(statusPacket);
|
APRS_IS_Utils::upload(aprsisStatusPacket);
|
||||||
|
SYSLOG_Utils::logAPRSISTx(aprsisStatusPacket);
|
||||||
} else {
|
} else {
|
||||||
STATION_Utils::addToOutputPacketBuffer(statusPacket, true); // treated also as beacon on Tx Freq
|
STATION_Utils::addToOutputPacketBuffer(statusPacket, true); // treated also as beacon on Tx Freq
|
||||||
}
|
}
|
||||||
@@ -187,48 +186,42 @@ namespace Utils {
|
|||||||
|
|
||||||
showActiveStations();
|
showActiveStations();
|
||||||
|
|
||||||
beaconPacket = iGateBeaconPacket;
|
String aprsisBeaconPacket = iGateAPRSISBeaconPacket;
|
||||||
secondaryBeaconPacket = iGateLoRaBeaconPacket;
|
String loraBeaconPacket = iGateLoRaBeaconPacket;
|
||||||
#ifdef HAS_GPS
|
#ifdef HAS_GPS
|
||||||
if (Config.beacon.gpsActive && Config.digi.ecoMode == 0) {
|
if (Config.beacon.gpsActive && Config.digi.ecoMode == 0) {
|
||||||
GPS_Utils::getData();
|
GPS_Utils::getData();
|
||||||
if (gps.location.isUpdated() && gps.location.lat() != 0.0 && gps.location.lng() != 0.0) {
|
if (gps.location.isUpdated() && gps.location.lat() != 0.0 && gps.location.lng() != 0.0) {
|
||||||
String basePacket = APRSPacketLib::generateBasePacket(Config.callsign, "APLRG1", Config.beacon.path);
|
String beaconCallsign = (stationCallsignIsValid && Config.tacticalCallsign != "") ? Config.tacticalCallsign : Config.callsign;
|
||||||
String encodedGPS = APRSPacketLib::encodeGPSIntoBase91(gps.location.lat(),gps.location.lng(), 0, 0, Config.beacon.symbol, false, 0, true, Config.beacon.ambiguityLevel);
|
String encodedGPS = APRSPacketLib::encodeGPSIntoBase91(gps.location.lat(),gps.location.lng(), 0, 0, Config.beacon.symbol, false, 0, true, Config.beacon.ambiguityLevel);
|
||||||
|
|
||||||
beaconPacket = basePacket;
|
loraBeaconPacket = APRSPacketLib::generateBase91GPSBeaconPacket(beaconCallsign, "APLRG1", Config.beacon.path, Config.beacon.overlay, encodedGPS);
|
||||||
beaconPacket += ",qAC:!";
|
aprsisBeaconPacket = APRSPacketLib::generateAPRSISPacket(loraBeaconPacket);
|
||||||
beaconPacket += Config.beacon.overlay;
|
|
||||||
beaconPacket += encodedGPS;
|
|
||||||
|
|
||||||
secondaryBeaconPacket = basePacket;
|
|
||||||
secondaryBeaconPacket += ":=";
|
|
||||||
secondaryBeaconPacket += Config.beacon.overlay;
|
|
||||||
secondaryBeaconPacket += encodedGPS;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (Config.wxsensor.active) {
|
if (Config.wxsensor.active) {
|
||||||
String sensorData = (wxModuleType == 0) ? ".../...g...t..." : WX_Utils::readDataSensor();
|
String sensorData = (wxModuleType == 0) ? ".../...g...t..." : WX_Utils::readDataSensor();
|
||||||
beaconPacket += sensorData;
|
aprsisBeaconPacket += sensorData;
|
||||||
secondaryBeaconPacket += sensorData;
|
loraBeaconPacket += sensorData;
|
||||||
}
|
}
|
||||||
beaconPacket += Config.beacon.comment;
|
aprsisBeaconPacket += Config.beacon.comment; // APRS-IS beacon always carries the comment
|
||||||
secondaryBeaconPacket += Config.beacon.comment;
|
int commentEveryX = max(1, Config.beacon.rfCommentEveryXBeacons); // safety: 0 or negative behaves as "every beacon"
|
||||||
|
if (rfBeaconCounter % commentEveryX == 0) loraBeaconPacket += Config.beacon.comment;
|
||||||
if (stationCallsignIsValid && Config.tacticalCallsign != "") {
|
if (stationCallsignIsValid && Config.tacticalCallsign != "") {
|
||||||
beaconPacket += " de ";
|
aprsisBeaconPacket += " de ";
|
||||||
beaconPacket += Config.callsign;
|
aprsisBeaconPacket += Config.callsign;
|
||||||
secondaryBeaconPacket += " de ";
|
loraBeaconPacket += " de ";
|
||||||
secondaryBeaconPacket += Config.callsign;
|
loraBeaconPacket += Config.callsign;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(BATTERY_PIN) || defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#if defined(BATTERY_PIN) || defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
if (Config.battery.sendInternalVoltage || Config.battery.monitorInternalVoltage) {
|
if (Config.battery.sendInternalVoltage || Config.battery.monitorInternalVoltage) {
|
||||||
float internalVoltage = BATTERY_Utils::checkInternalVoltage();
|
float internalVoltage = BATTERY_Utils::checkInternalVoltage();
|
||||||
if (Config.battery.monitorInternalVoltage && internalVoltage < Config.battery.internalSleepVoltage) {
|
if (Config.battery.monitorInternalVoltage && internalVoltage < Config.battery.internalSleepVoltage) {
|
||||||
beaconPacket += " **IntBatWarning:SLEEP**";
|
aprsisBeaconPacket += " **IntBatWarning:SLEEP**";
|
||||||
secondaryBeaconPacket += " **IntBatWarning:SLEEP**";
|
loraBeaconPacket += " **IntBatWarning:SLEEP**";
|
||||||
shouldSleepLowVoltage = true;
|
shouldSleepLowVoltage = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,10 +234,10 @@ namespace Utils {
|
|||||||
sixthLine = sixthLineBuffer;
|
sixthLine = sixthLineBuffer;
|
||||||
|
|
||||||
if (!Config.battery.sendVoltageAsTelemetry) {
|
if (!Config.battery.sendVoltageAsTelemetry) {
|
||||||
beaconPacket += " Batt=";
|
aprsisBeaconPacket += " Batt=";
|
||||||
beaconPacket += internalVoltageInfo;
|
aprsisBeaconPacket += internalVoltageInfo;
|
||||||
secondaryBeaconPacket += " Batt=";
|
loraBeaconPacket += " Batt=";
|
||||||
secondaryBeaconPacket += internalVoltageInfo;
|
loraBeaconPacket += internalVoltageInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,8 +247,8 @@ namespace Utils {
|
|||||||
if (Config.battery.sendExternalVoltage || Config.battery.monitorExternalVoltage) {
|
if (Config.battery.sendExternalVoltage || Config.battery.monitorExternalVoltage) {
|
||||||
float externalVoltage = BATTERY_Utils::checkExternalVoltage();
|
float externalVoltage = BATTERY_Utils::checkExternalVoltage();
|
||||||
if (Config.battery.monitorExternalVoltage && externalVoltage < Config.battery.externalSleepVoltage) {
|
if (Config.battery.monitorExternalVoltage && externalVoltage < Config.battery.externalSleepVoltage) {
|
||||||
beaconPacket += " **ExtBatWarning:SLEEP**";
|
aprsisBeaconPacket += " **ExtBatWarning:SLEEP**";
|
||||||
secondaryBeaconPacket += " **ExtBatWarning:SLEEP**";
|
loraBeaconPacket += " **ExtBatWarning:SLEEP**";
|
||||||
shouldSleepLowVoltage = true;
|
shouldSleepLowVoltage = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,10 +261,10 @@ namespace Utils {
|
|||||||
sixthLine = sixthLineBuffer;
|
sixthLine = sixthLineBuffer;
|
||||||
|
|
||||||
if (!Config.battery.sendVoltageAsTelemetry) {
|
if (!Config.battery.sendVoltageAsTelemetry) {
|
||||||
beaconPacket += " Ext=";
|
aprsisBeaconPacket += " Ext=";
|
||||||
beaconPacket += externalVoltageInfo;
|
aprsisBeaconPacket += externalVoltageInfo;
|
||||||
secondaryBeaconPacket += " Ext=";
|
loraBeaconPacket += " Ext=";
|
||||||
secondaryBeaconPacket += externalVoltageInfo;
|
loraBeaconPacket += externalVoltageInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,8 +272,8 @@ namespace Utils {
|
|||||||
|
|
||||||
if (Config.battery.sendVoltageAsTelemetry && !Config.wxsensor.active && (Config.battery.sendInternalVoltage || Config.battery.sendExternalVoltage)){
|
if (Config.battery.sendVoltageAsTelemetry && !Config.wxsensor.active && (Config.battery.sendInternalVoltage || Config.battery.sendExternalVoltage)){
|
||||||
String encodedTelemetry = TELEMETRY_Utils::generateEncodedTelemetry();
|
String encodedTelemetry = TELEMETRY_Utils::generateEncodedTelemetry();
|
||||||
beaconPacket += encodedTelemetry;
|
aprsisBeaconPacket += encodedTelemetry;
|
||||||
secondaryBeaconPacket += encodedTelemetry;
|
loraBeaconPacket += encodedTelemetry;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.beacon.sendViaAPRSIS && Config.aprs_is.active && passcodeValid && !backupDigiMode) {
|
if (Config.beacon.sendViaAPRSIS && Config.aprs_is.active && passcodeValid && !backupDigiMode) {
|
||||||
@@ -288,18 +281,19 @@ namespace Utils {
|
|||||||
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0);
|
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0);
|
||||||
seventhLine = " listening...";
|
seventhLine = " listening...";
|
||||||
#ifdef HAS_A7670
|
#ifdef HAS_A7670
|
||||||
A7670_Utils::uploadToAPRSIS(beaconPacket);
|
A7670_Utils::uploadToAPRSIS(aprsisBeaconPacket);
|
||||||
#else
|
#else
|
||||||
APRS_IS_Utils::upload(beaconPacket);
|
APRS_IS_Utils::upload(aprsisBeaconPacket);
|
||||||
#endif
|
#endif
|
||||||
if (Config.syslog.logBeaconOverTCPIP) SYSLOG_Utils::logAPRSISTx(beaconPacket);
|
if (Config.syslog.logBeaconOverTCPIP) SYSLOG_Utils::logAPRSISTx(aprsisBeaconPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.beacon.sendViaRF || backupDigiMode) {
|
if (Config.beacon.sendViaRF || backupDigiMode) {
|
||||||
Utils::println("-- Sending Beacon to RF --");
|
Utils::println("-- Sending Beacon to RF --");
|
||||||
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING DIGI BEACON", 0);
|
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING DIGI BEACON", 0);
|
||||||
seventhLine = " listening...";
|
seventhLine = " listening...";
|
||||||
STATION_Utils::addToOutputPacketBuffer(secondaryBeaconPacket, true);
|
STATION_Utils::addToOutputPacketBuffer(loraBeaconPacket, true);
|
||||||
|
rfBeaconCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastBeaconTx = millis();
|
lastBeaconTx = millis();
|
||||||
@@ -329,6 +323,12 @@ namespace Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String padForDisplay(const String& text) { // left-aligned, 9 chars wide (callsign column on screen)
|
||||||
|
char buffer[10];
|
||||||
|
snprintf(buffer, sizeof(buffer), "%-9s", text.c_str());
|
||||||
|
return String(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
void updateLoRaPacketDisplayInfo(APRSPacket& aprsPacket, const uint8_t packetType) {
|
void updateLoRaPacketDisplayInfo(APRSPacket& aprsPacket, const uint8_t packetType) {
|
||||||
switch (packetType) {
|
switch (packetType) {
|
||||||
case 0: // LoRa-APRS
|
case 0: // LoRa-APRS
|
||||||
@@ -339,11 +339,7 @@ namespace Utils {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
String sender = aprsPacket.sender;
|
sixthLine = padForDisplay(aprsPacket.sender);
|
||||||
for (int i = sender.length(); i < 9; i++) {
|
|
||||||
sender += " ";
|
|
||||||
}
|
|
||||||
sixthLine = sender;
|
|
||||||
|
|
||||||
switch (aprsPacket.type) {
|
switch (aprsPacket.type) {
|
||||||
case 1: // MESSAGE
|
case 1: // MESSAGE
|
||||||
@@ -389,11 +385,7 @@ namespace Utils {
|
|||||||
void updateAPRSISPacketDisplayInfo(const String& packet) {
|
void updateAPRSISPacketDisplayInfo(const String& packet) {
|
||||||
fifthLine = "APRS-IS ----> LoRa Tx";
|
fifthLine = "APRS-IS ----> LoRa Tx";
|
||||||
|
|
||||||
String sender = packet.substring(0,packet.indexOf(">"));
|
sixthLine = padForDisplay(packet.substring(0,packet.indexOf(">")));
|
||||||
for (int i = sender.length(); i < 9; i++) {
|
|
||||||
sender += " ";
|
|
||||||
}
|
|
||||||
sixthLine = sender;
|
|
||||||
|
|
||||||
if (packet.indexOf("::") > 0) {
|
if (packet.indexOf("::") > 0) {
|
||||||
sixthLine += "> MESSAGE";
|
sixthLine += "> MESSAGE";
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ namespace WEB_Utils {
|
|||||||
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);
|
||||||
|
Config.beacon.rfCommentEveryXBeacons = getParamIntSafe("beacon.rfCommentEveryXBeacons", Config.beacon.rfCommentEveryXBeacons);
|
||||||
Config.beacon.overlay = getParamStringSafe("beacon.overlay", Config.beacon.overlay);
|
Config.beacon.overlay = getParamStringSafe("beacon.overlay", Config.beacon.overlay);
|
||||||
Config.beacon.symbol = getParamStringSafe("beacon.symbol", Config.beacon.symbol);
|
Config.beacon.symbol = getParamStringSafe("beacon.symbol", Config.beacon.symbol);
|
||||||
Config.beacon.path = getParamStringSafe("beacon.path", Config.beacon.path);
|
Config.beacon.path = getParamStringSafe("beacon.path", Config.beacon.path);
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ build_flags =
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${common.lib_deps}
|
${common.lib_deps}
|
||||||
${common.display_libs}
|
${common.display_libs}
|
||||||
adafruit/Adafruit SH110X @ 2.1.10
|
adafruit/Adafruit SH110X @ 2.1.15
|
||||||
@@ -11,4 +11,4 @@ build_flags =
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${common.lib_deps}
|
${common.lib_deps}
|
||||||
${common.display_libs}
|
${common.display_libs}
|
||||||
adafruit/Adafruit SHTC3 Library @ 1.0.1
|
adafruit/Adafruit SHTC3 Library @ 1.0.2
|
||||||
@@ -12,4 +12,4 @@ lib_deps =
|
|||||||
${common.lib_deps}
|
${common.lib_deps}
|
||||||
${common.display_libs}
|
${common.display_libs}
|
||||||
lewisxhe/XPowersLib @ 0.2.4
|
lewisxhe/XPowersLib @ 0.2.4
|
||||||
adafruit/Adafruit SH110X @ 2.1.10
|
adafruit/Adafruit SH110X @ 2.1.15
|
||||||
Reference in new issue
Block a user