mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-07-15 14:21:30 +02:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4349019f7b | |||
| 411753c0aa | |||
| ad6aed7f0d | |||
| f325c54fc3 | |||
| 1a3966eadc | |||
| ffd3eaeb49 | |||
| df03a49123 | |||
| 58d647bad1 | |||
| 59988fbaf1 | |||
| 1ad13e3c09 | |||
| ffe1a2f830 | |||
| a0fdd78cb1 | |||
| 95e437cb50 | |||
| 9c488991e2 | |||
| ddcd33b94a | |||
| b688391a0e | |||
| 56d63d0389 | |||
| ad5a5ccf18 | |||
| 92bc0a7667 | |||
| ffcfc42b8a | |||
| f3e0830473 | |||
| 62107a5b4a | |||
| 9801545965 | |||
| dd89f56436 | |||
| 27593d8718 | |||
| 008575b422 | |||
| b8eedabe9a | |||
| 7371b8e37a | |||
| 44605e82c2 | |||
| 0360085131 | |||
| 57f720b0d1 | |||
| 3d01ea03c0 |
@@ -21,6 +21,8 @@ jobs:
|
|||||||
chip: esp32
|
chip: esp32
|
||||||
- name: heltec_wifi_lora_32_V3
|
- name: heltec_wifi_lora_32_V3
|
||||||
chip: esp32s3
|
chip: esp32s3
|
||||||
|
- name: heltec_wifi_lora_32_V3_2
|
||||||
|
chip: esp32s3
|
||||||
- name: heltec_wireless_stick
|
- name: heltec_wireless_stick
|
||||||
chip: esp32s3
|
chip: esp32s3
|
||||||
- name: heltec_wireless_stick_lite_v3
|
- name: heltec_wireless_stick_lite_v3
|
||||||
@@ -77,6 +79,10 @@ jobs:
|
|||||||
chip: esp32c3
|
chip: esp32c3
|
||||||
- name: QRPLabs_LightGateway_1_0
|
- name: QRPLabs_LightGateway_1_0
|
||||||
chip: esp32s3
|
chip: esp32s3
|
||||||
|
- name: XIAO_ESP32S3_WIO_SX1262
|
||||||
|
chip: esp32s3
|
||||||
|
- name: TROY_LoRa_APRS
|
||||||
|
chip: esp32
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,11 @@ ____________________________________________________
|
|||||||
|
|
||||||
## Timeline (Versions):
|
## Timeline (Versions):
|
||||||
|
|
||||||
|
- 2025.01.11 Added HELTEC V3.2 board support.
|
||||||
|
- 2025.01.07 TROY_LoRa_APRS board added. GMT in quarter hour fix and Beacon fix for TNC.
|
||||||
|
- 2025.01.02 Callsign Black List added.
|
||||||
|
- 2024.12.30 Fixed missing validation for correct Digipeater mode when not connected to APRS-IS.
|
||||||
|
- 2024.12.06 APRS-IS connnection and passcode validation added.
|
||||||
- 2024.11.06 (Silent Update) Working now with Board "VARIANTS".
|
- 2024.11.06 (Silent Update) Working now with Board "VARIANTS".
|
||||||
- 2024.10.29 Added LILYGO Lora32 T3S3 support.
|
- 2024.10.29 Added LILYGO Lora32 T3S3 support.
|
||||||
- 2024.10.25 Added QRP Labs LightGateway 1.0 support.
|
- 2024.10.25 Added QRP Labs LightGateway 1.0 support.
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ lib_deps =
|
|||||||
arduino-libraries/NTPClient @ 3.2.1
|
arduino-libraries/NTPClient @ 3.2.1
|
||||||
ayushsharma82/ElegantOTA @ 3.1.5
|
ayushsharma82/ElegantOTA @ 3.1.5
|
||||||
bblanchon/ArduinoJson @ 6.21.3
|
bblanchon/ArduinoJson @ 6.21.3
|
||||||
jgromes/RadioLib @ 6.6.0
|
jgromes/RadioLib @ 7.1.0
|
||||||
mathieucarbou/AsyncTCP @ 3.2.5
|
mathieucarbou/AsyncTCP @ 3.2.5
|
||||||
mathieucarbou/ESPAsyncWebServer @ 3.2.3
|
mathieucarbou/ESPAsyncWebServer @ 3.2.3
|
||||||
mikalhart/TinyGPSPlus @ 1.0.3
|
mikalhart/TinyGPSPlus @ 1.0.3
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
"externalSleepVoltage": 10.9,
|
"externalSleepVoltage": 10.9,
|
||||||
"voltageDividerR1": 100.0,
|
"voltageDividerR1": 100.0,
|
||||||
"voltageDividerR2": 27.0,
|
"voltageDividerR2": 27.0,
|
||||||
"sendVoltageAsTelemetry": true
|
"sendVoltageAsTelemetry": false
|
||||||
},
|
},
|
||||||
"wxsensor": {
|
"wxsensor": {
|
||||||
"active": false,
|
"active": false,
|
||||||
@@ -65,8 +65,8 @@
|
|||||||
},
|
},
|
||||||
"syslog": {
|
"syslog": {
|
||||||
"active": false,
|
"active": false,
|
||||||
"server": "192.168.0.100",
|
"server": "lora.link9.net",
|
||||||
"port": 514
|
"port": 1514
|
||||||
},
|
},
|
||||||
"tnc": {
|
"tnc": {
|
||||||
"enableServer": false,
|
"enableServer": false,
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
"password": ""
|
"password": ""
|
||||||
},
|
},
|
||||||
"ntp": {
|
"ntp": {
|
||||||
"gmtCorrection": 0
|
"gmtCorrection": 0.0
|
||||||
},
|
},
|
||||||
"other": {
|
"other": {
|
||||||
"rememberStationTime": 30,
|
"rememberStationTime": 30,
|
||||||
@@ -92,5 +92,6 @@
|
|||||||
"rebootMode": false,
|
"rebootMode": false,
|
||||||
"rebootModeTime": 6
|
"rebootModeTime": 6
|
||||||
},
|
},
|
||||||
"personalNote": ""
|
"personalNote": "",
|
||||||
|
"blackList": ""
|
||||||
}
|
}
|
||||||
+46
-5
@@ -77,7 +77,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<span>List refresh automatically every 15 seconds.</span><br>
|
<span>List refresh automatically every 15 seconds.</span><br>
|
||||||
<small>(Local Time is NPT-Time adjusted with your GMT Offset)</small>
|
<small>(Local Time is NTP-Time adjusted with your GMT Offset)</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
@@ -573,6 +573,47 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
<div class="row my-5 d-flex align-items-top">
|
||||||
|
<div class="col-lg-3 col-sm-12">
|
||||||
|
<h5>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="20"
|
||||||
|
height="20"
|
||||||
|
fill="currentColor"
|
||||||
|
class="bi bi-broadcast-pin"
|
||||||
|
viewBox="0 0 16 16"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M3.05 3.05a7 7 0 0 0 0 9.9.5.5 0 0 1-.707.707 8 8 0 0 1 0-11.314.5.5 0 0 1 .707.707m2.122 2.122a4 4 0 0 0 0 5.656.5.5 0 1 1-.708.708 5 5 0 0 1 0-7.072.5.5 0 0 1 .708.708m5.656-.708a.5.5 0 0 1 .708 0 5 5 0 0 1 0 7.072.5.5 0 1 1-.708-.708 4 4 0 0 0 0-5.656.5.5 0 0 1 0-.708m2.122-2.12a.5.5 0 0 1 .707 0 8 8 0 0 1 0 11.313.5.5 0 0 1-.707-.707 7 7 0 0 0 0-9.9.5.5 0 0 1 0-.707zM6 8a2 2 0 1 1 2.5 1.937V15.5a.5.5 0 0 1-1 0V9.937A2 2 0 0 1 6 8"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
Black List
|
||||||
|
</h5>
|
||||||
|
<small>Add Callsigns with space between them to Black List them (* wild card allowed)</small>
|
||||||
|
</div>
|
||||||
|
<div class="col-9 mt-2">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<label
|
||||||
|
for="blackList"
|
||||||
|
class="form-label"
|
||||||
|
>Black List</label
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="blackList"
|
||||||
|
id="blackList"
|
||||||
|
class="form-control"
|
||||||
|
placeholder="Station Callsign"
|
||||||
|
oninput="this.value = this.value.toUpperCase();"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
|
||||||
<div class="row my-5 d-flex align-items-top">
|
<div class="row my-5 d-flex align-items-top">
|
||||||
<div class="col-lg-3 col-sm-12">
|
<div class="col-lg-3 col-sm-12">
|
||||||
<h5>
|
<h5>
|
||||||
@@ -1310,7 +1351,7 @@
|
|||||||
type="text"
|
type="text"
|
||||||
name="syslog.port"
|
name="syslog.port"
|
||||||
id="syslog.port"
|
id="syslog.port"
|
||||||
placeholder="514"
|
placeholder="1514"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
@@ -1703,9 +1744,9 @@
|
|||||||
id="ntp.gmtCorrection"
|
id="ntp.gmtCorrection"
|
||||||
placeholder="0"
|
placeholder="0"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
step="1"
|
step="0.25"
|
||||||
min="-23"
|
min="-23.75"
|
||||||
max="23"
|
max="23.75"
|
||||||
/>
|
/>
|
||||||
<span class="input-group-text"
|
<span class="input-group-text"
|
||||||
>hours</span
|
>hours</span
|
||||||
|
|||||||
@@ -137,6 +137,9 @@ function loadSettings(settings) {
|
|||||||
document.getElementById("beacon.gpsActive").checked = settings.beacon.gpsActive;
|
document.getElementById("beacon.gpsActive").checked = settings.beacon.gpsActive;
|
||||||
document.getElementById("beacon.gpsAmbiguity").checked = settings.beacon.gpsAmbiguity;
|
document.getElementById("beacon.gpsAmbiguity").checked = settings.beacon.gpsAmbiguity;
|
||||||
|
|
||||||
|
// Black List
|
||||||
|
document.getElementById("blackList").value = settings.blackList;
|
||||||
|
|
||||||
// Digi
|
// Digi
|
||||||
document.getElementById("digi.mode").value = settings.digi.mode;
|
document.getElementById("digi.mode").value = settings.digi.mode;
|
||||||
document.getElementById("digi.ecoMode").checked = settings.digi.ecoMode;
|
document.getElementById("digi.ecoMode").checked = settings.digi.ecoMode;
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
|
|
||||||
This directory is intended for project header files.
|
|
||||||
|
|
||||||
A header file is a file containing C declarations and macro definitions
|
|
||||||
to be shared between several project source files. You request the use of a
|
|
||||||
header file in your project source file (C, C++, etc) located in `src` folder
|
|
||||||
by including it, with the C preprocessing directive `#include'.
|
|
||||||
|
|
||||||
```src/main.c
|
|
||||||
|
|
||||||
#include "header.h"
|
|
||||||
|
|
||||||
int main (void)
|
|
||||||
{
|
|
||||||
...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Including a header file produces the same results as copying the header file
|
|
||||||
into each source file that needs it. Such copying would be time-consuming
|
|
||||||
and error-prone. With a header file, the related declarations appear
|
|
||||||
in only one place. If they need to be changed, they can be changed in one
|
|
||||||
place, and programs that include the header file will automatically use the
|
|
||||||
new version when next recompiled. The header file eliminates the labor of
|
|
||||||
finding and changing all the copies as well as the risk that a failure to
|
|
||||||
find one copy will result in inconsistencies within a program.
|
|
||||||
|
|
||||||
In C, the usual convention is to give header files names that end with `.h'.
|
|
||||||
It is most portable to use only letters, digits, dashes, and underscores in
|
|
||||||
header file names, and at most one dot.
|
|
||||||
|
|
||||||
Read more about using header files in official GCC documentation:
|
|
||||||
|
|
||||||
* Include Syntax
|
|
||||||
* Include Operation
|
|
||||||
* Once-Only Headers
|
|
||||||
* Computed Includes
|
|
||||||
|
|
||||||
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
|
|
||||||
@@ -8,6 +8,7 @@ namespace APRS_IS_Utils {
|
|||||||
|
|
||||||
void upload(const String& line);
|
void upload(const String& line);
|
||||||
void connect();
|
void connect();
|
||||||
|
|
||||||
void checkStatus();
|
void checkStatus();
|
||||||
String checkForStartingBytes(const String& packet);
|
String checkForStartingBytes(const String& packet);
|
||||||
|
|
||||||
@@ -19,6 +20,8 @@ namespace APRS_IS_Utils {
|
|||||||
void processAPRSISPacket(const String& packet);
|
void processAPRSISPacket(const String& packet);
|
||||||
void listenAPRSIS();
|
void listenAPRSIS();
|
||||||
|
|
||||||
|
void firstConnection();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -50,7 +50,6 @@ public:
|
|||||||
bool ecoMode;
|
bool ecoMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class LoraModule {
|
class LoraModule {
|
||||||
public:
|
public:
|
||||||
long txFreq;
|
long txFreq;
|
||||||
@@ -120,11 +119,10 @@ public:
|
|||||||
|
|
||||||
class NTP {
|
class NTP {
|
||||||
public:
|
public:
|
||||||
int gmtCorrection;
|
float gmtCorrection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Configuration {
|
class Configuration {
|
||||||
public:
|
public:
|
||||||
String callsign;
|
String callsign;
|
||||||
@@ -135,6 +133,7 @@ public:
|
|||||||
bool rebootMode;
|
bool rebootMode;
|
||||||
int rebootModeTime;
|
int rebootModeTime;
|
||||||
String personalNote;
|
String personalNote;
|
||||||
|
String blackList;
|
||||||
std::vector<WiFi_AP> wifiAPs;
|
std::vector<WiFi_AP> wifiAPs;
|
||||||
WiFi_Auto_AP wifiAutoAP;
|
WiFi_Auto_AP wifiAutoAP;
|
||||||
BEACON beacon;
|
BEACON beacon;
|
||||||
@@ -18,6 +18,8 @@ struct LastHeardStation {
|
|||||||
|
|
||||||
namespace STATION_Utils {
|
namespace STATION_Utils {
|
||||||
|
|
||||||
|
void loadBlackList();
|
||||||
|
bool checkBlackList(const String& callsign);
|
||||||
void deleteNotHeard();
|
void deleteNotHeard();
|
||||||
void updateLastHeard(const String& station);
|
void updateLastHeard(const String& station);
|
||||||
bool wasHeard(const String& station);
|
bool wasHeard(const String& station);
|
||||||
@@ -48,7 +48,7 @@ ___________________________________________________________________*/
|
|||||||
#include "A7670_utils.h"
|
#include "A7670_utils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
String versionDate = "2024.11.06";
|
String versionDate = "2025.01.11";
|
||||||
Configuration Config;
|
Configuration Config;
|
||||||
WiFiClient espClient;
|
WiFiClient espClient;
|
||||||
#ifdef HAS_GPS
|
#ifdef HAS_GPS
|
||||||
@@ -79,6 +79,7 @@ void setup() {
|
|||||||
LoRa_Utils::setup();
|
LoRa_Utils::setup();
|
||||||
Utils::validateFreqs();
|
Utils::validateFreqs();
|
||||||
GPS_Utils::setup();
|
GPS_Utils::setup();
|
||||||
|
STATION_Utils::loadBlackList();
|
||||||
|
|
||||||
#ifdef STARTUP_DELAY // (TEST) just to wait for WiFi init of Routers
|
#ifdef STARTUP_DELAY // (TEST) just to wait for WiFi init of Routers
|
||||||
displayShow("", " STARTUP DELAY ...", "", "", 0);
|
displayShow("", " STARTUP DELAY ...", "", "", 0);
|
||||||
@@ -136,6 +137,7 @@ void setup() {
|
|||||||
A7670_Utils::setup();
|
A7670_Utils::setup();
|
||||||
#endif
|
#endif
|
||||||
Utils::checkRebootMode();
|
Utils::checkRebootMode();
|
||||||
|
APRS_IS_Utils::firstConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
@@ -149,14 +151,13 @@ void loop() {
|
|||||||
if (Config.lowVoltageCutOff > 0) {
|
if (Config.lowVoltageCutOff > 0) {
|
||||||
BATTERY_Utils::checkIfShouldSleep();
|
BATTERY_Utils::checkIfShouldSleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
thirdLine = Utils::getLocalIP();
|
thirdLine = Utils::getLocalIP();
|
||||||
|
|
||||||
WIFI_Utils::checkWiFi();
|
|
||||||
|
|
||||||
#ifdef HAS_A7670
|
#ifdef HAS_A7670
|
||||||
if (Config.aprs_is.active && !modemLoggedToAPRSIS) A7670_Utils::APRS_IS_connect();
|
if (Config.aprs_is.active && !modemLoggedToAPRSIS) A7670_Utils::APRS_IS_connect();
|
||||||
#else
|
#else
|
||||||
|
WIFI_Utils::checkWiFi();
|
||||||
if (Config.aprs_is.active && (WiFi.status() == WL_CONNECTED) && !espClient.connected()) APRS_IS_Utils::connect();
|
if (Config.aprs_is.active && (WiFi.status() == WL_CONNECTED) && !espClient.connected()) APRS_IS_Utils::connect();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -191,10 +192,10 @@ void loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.aprs_is.active) { // If APRSIS enabled
|
if (Config.aprs_is.active) {
|
||||||
APRS_IS_Utils::listenAPRSIS(); // listen received packet from APRSIS
|
APRS_IS_Utils::listenAPRSIS(); // listen received packet from APRSIS
|
||||||
}
|
}
|
||||||
|
|
||||||
STATION_Utils::processOutputPacketBuffer();
|
STATION_Utils::processOutputPacketBuffer();
|
||||||
|
|
||||||
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
|
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
|
||||||
|
|||||||
+25
-9
@@ -22,7 +22,8 @@ extern String seventhLine;
|
|||||||
extern bool modemLoggedToAPRSIS;
|
extern bool modemLoggedToAPRSIS;
|
||||||
extern bool backUpDigiMode;
|
extern bool backUpDigiMode;
|
||||||
|
|
||||||
uint32_t lastRxTime = millis();
|
uint32_t lastRxTime = millis();
|
||||||
|
bool passcodeValid = false;
|
||||||
|
|
||||||
#ifdef HAS_A7670
|
#ifdef HAS_A7670
|
||||||
extern bool stationBeacon;
|
extern bool stationBeacon;
|
||||||
@@ -50,11 +51,9 @@ namespace APRS_IS_Utils {
|
|||||||
}
|
}
|
||||||
if (count == 20) {
|
if (count == 20) {
|
||||||
Serial.println("Tried: " + String(count) + " FAILED!");
|
Serial.println("Tried: " + String(count) + " FAILED!");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Serial.println("Connected!\n(Server: " + String(Config.aprs_is.server) + " / Port: " + String(Config.aprs_is.port) + ")");
|
Serial.println("Connected!\n(Server: " + String(Config.aprs_is.server) + " / Port: " + String(Config.aprs_is.port) + ")");
|
||||||
// String filter = "t/m/" + Config.callsign + "/" + (String)Config.aprs_is.reportingDistance;
|
// String filter = "t/m/" + Config.callsign + "/" + (String)Config.aprs_is.reportingDistance;
|
||||||
|
|
||||||
String aprsAuth = "user ";
|
String aprsAuth = "user ";
|
||||||
aprsAuth += Config.callsign;
|
aprsAuth += Config.callsign;
|
||||||
aprsAuth += " pass ";
|
aprsAuth += " pass ";
|
||||||
@@ -62,7 +61,6 @@ namespace APRS_IS_Utils {
|
|||||||
aprsAuth += " vers CA2RXU_LoRa_iGate 2.0 filter ";
|
aprsAuth += " vers CA2RXU_LoRa_iGate 2.0 filter ";
|
||||||
aprsAuth += Config.aprs_is.filter;
|
aprsAuth += Config.aprs_is.filter;
|
||||||
upload(aprsAuth);
|
upload(aprsAuth);
|
||||||
delay(200);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,13 +172,13 @@ namespace APRS_IS_Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void processLoRaPacket(const String& packet) {
|
void processLoRaPacket(const String& packet) {
|
||||||
if (espClient.connected() || modemLoggedToAPRSIS) {
|
if (passcodeValid && (espClient.connected() || modemLoggedToAPRSIS)) {
|
||||||
if (packet != "") {
|
if (packet != "") {
|
||||||
if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("NOGATE") == -1) && (packet.indexOf("RFONLY") == -1)) {
|
if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("NOGATE") == -1) && (packet.indexOf("RFONLY") == -1)) {
|
||||||
int firstColonIndex = packet.indexOf(":");
|
int firstColonIndex = packet.indexOf(":");
|
||||||
if (firstColonIndex > 5 && firstColonIndex < (packet.length() - 1) && packet[firstColonIndex + 1] != '}' && packet.indexOf("TCPIP") == -1) {
|
if (firstColonIndex > 5 && firstColonIndex < (packet.length() - 1) && packet[firstColonIndex + 1] != '}' && packet.indexOf("TCPIP") == -1) {
|
||||||
const String& Sender = packet.substring(3, packet.indexOf(">"));
|
const String& Sender = packet.substring(3, packet.indexOf(">"));
|
||||||
if (Sender != Config.callsign && Utils::checkValidCallsign(Sender)) {
|
if (Sender != Config.callsign && Utils::checkValidCallsign(Sender) && !STATION_Utils::checkBlackList(Sender)) {
|
||||||
STATION_Utils::updateLastHeard(Sender);
|
STATION_Utils::updateLastHeard(Sender);
|
||||||
Utils::typeOfPacket(packet.substring(3), 0); // LoRa-APRS
|
Utils::typeOfPacket(packet.substring(3), 0); // LoRa-APRS
|
||||||
const String& AddresseeAndMessage = packet.substring(packet.indexOf("::") + 2);
|
const String& AddresseeAndMessage = packet.substring(packet.indexOf("::") + 2);
|
||||||
@@ -259,13 +257,22 @@ namespace APRS_IS_Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void processAPRSISPacket(const String& packet) {
|
void processAPRSISPacket(const String& packet) {
|
||||||
if (!packet.startsWith("#")) {
|
if (!passcodeValid && packet.indexOf(Config.callsign) != -1) {
|
||||||
|
if (packet.indexOf("unverified") != -1 ) {
|
||||||
|
Serial.println("\n****APRS PASSCODE NOT VALID****\n");
|
||||||
|
displayShow(firstLine, "", " APRS PASSCODE", " NOT VALID !!!", "", "", "", 0);
|
||||||
|
while (1) {};
|
||||||
|
} else if (packet.indexOf("verified") != -1 ) {
|
||||||
|
passcodeValid = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (passcodeValid && !packet.startsWith("#")) {
|
||||||
if (Config.aprs_is.messagesToRF && packet.indexOf("::") > 0) {
|
if (Config.aprs_is.messagesToRF && packet.indexOf("::") > 0) {
|
||||||
String Sender = packet.substring(0, packet.indexOf(">"));
|
String Sender = packet.substring(0, packet.indexOf(">"));
|
||||||
const String& AddresseeAndMessage = packet.substring(packet.indexOf("::") + 2);
|
const String& AddresseeAndMessage = packet.substring(packet.indexOf("::") + 2);
|
||||||
String Addressee = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf(":"));
|
String Addressee = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf(":"));
|
||||||
Addressee.trim();
|
Addressee.trim();
|
||||||
if (Addressee == Config.callsign) { // its for me!
|
if (Addressee == Config.callsign) { // its for me!
|
||||||
String receivedMessage;
|
String receivedMessage;
|
||||||
if (AddresseeAndMessage.indexOf("{") > 0) { // ack?
|
if (AddresseeAndMessage.indexOf("{") > 0) { // ack?
|
||||||
String ackMessage = "ack";
|
String ackMessage = "ack";
|
||||||
@@ -350,4 +357,13 @@ namespace APRS_IS_Utils {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void firstConnection() {
|
||||||
|
if (Config.aprs_is.active && (WiFi.status() == WL_CONNECTED) && !espClient.connected()) {
|
||||||
|
connect();
|
||||||
|
while (!passcodeValid) {
|
||||||
|
listenAPRSIS();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ namespace BATTERY_Utils {
|
|||||||
int sample;
|
int sample;
|
||||||
int sampleSum = 0;
|
int sampleSum = 0;
|
||||||
#ifdef ADC_CTRL
|
#ifdef ADC_CTRL
|
||||||
#if defined(HELTEC_WIRELESS_TRACKER)
|
#if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_V3_2)
|
||||||
digitalWrite(ADC_CTRL, HIGH);
|
digitalWrite(ADC_CTRL, HIGH);
|
||||||
#endif
|
#endif
|
||||||
#if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WP)
|
#if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WP)
|
||||||
@@ -132,7 +132,7 @@ namespace BATTERY_Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ADC_CTRL
|
#ifdef ADC_CTRL
|
||||||
#if defined(HELTEC_WIRELESS_TRACKER)
|
#if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_V3_2)
|
||||||
digitalWrite(ADC_CTRL, LOW);
|
digitalWrite(ADC_CTRL, LOW);
|
||||||
#endif
|
#endif
|
||||||
#if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WP)
|
#if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WP)
|
||||||
|
|||||||
+11
-5
@@ -99,6 +99,8 @@ void Configuration::writeFile() {
|
|||||||
|
|
||||||
data["personalNote"] = personalNote;
|
data["personalNote"] = personalNote;
|
||||||
|
|
||||||
|
data["blackList"] = blackList;
|
||||||
|
|
||||||
data["webadmin"]["active"] = webadmin.active;
|
data["webadmin"]["active"] = webadmin.active;
|
||||||
data["webadmin"]["username"] = webadmin.username;
|
data["webadmin"]["username"] = webadmin.username;
|
||||||
data["webadmin"]["password"] = webadmin.password;
|
data["webadmin"]["password"] = webadmin.password;
|
||||||
@@ -196,7 +198,7 @@ bool Configuration::readFile() {
|
|||||||
|
|
||||||
syslog.active = data["syslog"]["active"] | false;
|
syslog.active = data["syslog"]["active"] | false;
|
||||||
syslog.server = data["syslog"]["server"] | "lora.link9.net";
|
syslog.server = data["syslog"]["server"] | "lora.link9.net";
|
||||||
syslog.port = data["syslog"]["port"] | 514;
|
syslog.port = data["syslog"]["port"] | 1514;
|
||||||
|
|
||||||
tnc.enableServer = data["tnc"]["enableServer"] | false;
|
tnc.enableServer = data["tnc"]["enableServer"] | false;
|
||||||
tnc.enableSerial = data["tnc"]["enableSerial"] | false;
|
tnc.enableSerial = data["tnc"]["enableSerial"] | false;
|
||||||
@@ -209,7 +211,7 @@ bool Configuration::readFile() {
|
|||||||
webadmin.username = data["webadmin"]["username"] | "admin";
|
webadmin.username = data["webadmin"]["username"] | "admin";
|
||||||
webadmin.password = data["webadmin"]["password"] | "";
|
webadmin.password = data["webadmin"]["password"] | "";
|
||||||
|
|
||||||
ntp.gmtCorrection = data["ntp"]["gmtCorrection"] | 0;
|
ntp.gmtCorrection = data["ntp"]["gmtCorrection"] | 0.0;
|
||||||
|
|
||||||
lowPowerMode = data["other"]["lowPowerMode"] | false;
|
lowPowerMode = data["other"]["lowPowerMode"] | false;
|
||||||
lowVoltageCutOff = data["other"]["lowVoltageCutOff"] | 0;
|
lowVoltageCutOff = data["other"]["lowVoltageCutOff"] | 0;
|
||||||
@@ -219,7 +221,9 @@ bool Configuration::readFile() {
|
|||||||
rebootMode = data["other"]["rebootMode"] | false;
|
rebootMode = data["other"]["rebootMode"] | false;
|
||||||
rebootModeTime = data["other"]["rebootModeTime"] | 6;
|
rebootModeTime = data["other"]["rebootModeTime"] | 6;
|
||||||
|
|
||||||
personalNote = data["personalNote"] | "personal note here...";
|
personalNote = data["personalNote"] | "personal note here";
|
||||||
|
|
||||||
|
blackList = data["blackList"] | "station callsign";
|
||||||
|
|
||||||
if (wifiAPs.size() == 0) { // If we don't have any WiFi's from config we need to add "empty" SSID for AUTO AP
|
if (wifiAPs.size() == 0) { // If we don't have any WiFi's from config we need to add "empty" SSID for AUTO AP
|
||||||
WiFi_AP wifiap;
|
WiFi_AP wifiap;
|
||||||
@@ -293,7 +297,7 @@ void Configuration::init() {
|
|||||||
|
|
||||||
syslog.active = false;
|
syslog.active = false;
|
||||||
syslog.server = "lora.link9.net";
|
syslog.server = "lora.link9.net";
|
||||||
syslog.port = 514;
|
syslog.port = 1514;
|
||||||
|
|
||||||
wxsensor.active = false;
|
wxsensor.active = false;
|
||||||
wxsensor.heightCorrection = 0;
|
wxsensor.heightCorrection = 0;
|
||||||
@@ -327,11 +331,13 @@ void Configuration::init() {
|
|||||||
|
|
||||||
personalNote = "";
|
personalNote = "";
|
||||||
|
|
||||||
|
blackList = "";
|
||||||
|
|
||||||
webadmin.active = false;
|
webadmin.active = false;
|
||||||
webadmin.username = "admin";
|
webadmin.username = "admin";
|
||||||
webadmin.password = "";
|
webadmin.password = "";
|
||||||
|
|
||||||
ntp.gmtCorrection = 0;
|
ntp.gmtCorrection = 0.0;
|
||||||
|
|
||||||
Serial.println("All is Written!");
|
Serial.println("All is Written!");
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -130,7 +130,7 @@ namespace DIGI_Utils {
|
|||||||
temp = packet.substring(3);
|
temp = packet.substring(3);
|
||||||
Sender = packet.substring(3, packet.indexOf(">"));
|
Sender = packet.substring(3, packet.indexOf(">"));
|
||||||
}
|
}
|
||||||
if (Sender != Config.callsign) { // Avoid listening to own packets
|
if (Sender != Config.callsign && !STATION_Utils::checkBlackList(Sender)) { // Avoid listening to own packets
|
||||||
if (!thirdPartyPacket && !Utils::checkValidCallsign(Sender)) {
|
if (!thirdPartyPacket && !Utils::checkValidCallsign(Sender)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
#else
|
#else
|
||||||
#include <Adafruit_GFX.h>
|
#include <Adafruit_GFX.h>
|
||||||
#include <Adafruit_SSD1306.h>
|
#include <Adafruit_SSD1306.h>
|
||||||
#if defined(HELTEC_V3) || defined(HELTEC_WS)
|
|
||||||
#define OLED_DISPLAY_HAS_RST_PIN
|
|
||||||
#endif
|
|
||||||
#ifdef HELTEC_WSL_V3_DISPLAY
|
#ifdef HELTEC_WSL_V3_DISPLAY
|
||||||
Adafruit_SSD1306 display(128, 64, &Wire1, OLED_RST);
|
Adafruit_SSD1306 display(128, 64, &Wire1, OLED_RST);
|
||||||
#else
|
#else
|
||||||
|
|||||||
+2
-1
@@ -197,7 +197,8 @@ namespace GPS_Utils {
|
|||||||
encodedBytePosition = packet.indexOf(":=") + 14;
|
encodedBytePosition = packet.indexOf(":=") + 14;
|
||||||
}
|
}
|
||||||
if (encodedBytePosition != 0) {
|
if (encodedBytePosition != 0) {
|
||||||
if (String(packet[encodedBytePosition]) == "G" || String(packet[encodedBytePosition]) == "Q" || String(packet[encodedBytePosition]) == "[" || String(packet[encodedBytePosition]) == "H") {
|
char currentChar = packet[encodedBytePosition];
|
||||||
|
if (currentChar == 'G' || currentChar == 'Q' || currentChar == '[' || currentChar == 'H' || currentChar == 'X') {
|
||||||
return decodeEncodedGPS(packet);
|
return decodeEncodedGPS(packet);
|
||||||
} else {
|
} else {
|
||||||
return getReceivedGPS(packet);
|
return getReceivedGPS(packet);
|
||||||
|
|||||||
+7
-7
@@ -181,10 +181,10 @@ namespace POWER_Utils {
|
|||||||
|
|
||||||
#ifdef VEXT_CTRL
|
#ifdef VEXT_CTRL
|
||||||
pinMode(VEXT_CTRL,OUTPUT); // GPS + TFT on HELTEC Wireless_Tracker and only for Oled in HELTEC V3
|
pinMode(VEXT_CTRL,OUTPUT); // GPS + TFT on HELTEC Wireless_Tracker and only for Oled in HELTEC V3
|
||||||
#ifndef HELTEC_WSL_V3
|
#if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_V3)
|
||||||
digitalWrite(VEXT_CTRL, HIGH);
|
digitalWrite(VEXT_CTRL, HIGH);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HELTEC_WP
|
#if defined(HELTEC_WP) || defined(HELTEC_WS) || defined(HELTEC_V3_2)
|
||||||
digitalWrite(VEXT_CTRL, LOW);
|
digitalWrite(VEXT_CTRL, LOW);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -201,13 +201,13 @@ namespace POWER_Utils {
|
|||||||
Wire.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
|
Wire.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HELTEC_V3) || defined(HELTEC_WP) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY)
|
#if defined(HELTEC_V3) || defined(HELTEC_V3_2) || defined(HELTEC_WS) || defined(LIGHTGATEWAY_1_0) || defined(TTGO_LORA32_T3S3_V1_2) || defined(HELTEC_V2)
|
||||||
Wire1.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HELTEC_V3) || defined(HELTEC_WS) || defined(LIGHTGATEWAY_1_0) || defined(TTGO_LORA32_T3S3_V1_2)
|
|
||||||
Wire.begin(OLED_SDA, OLED_SCL);
|
Wire.begin(OLED_SDA, OLED_SCL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HELTEC_V3) || defined(HELTEC_V3_2) || defined(HELTEC_WP) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY)
|
||||||
|
Wire1.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
|
||||||
|
#endif
|
||||||
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
BATTERY_Utils::setup();
|
BATTERY_Utils::setup();
|
||||||
|
|||||||
+11
-4
@@ -1,4 +1,5 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "battery_utils.h"
|
||||||
#include "station_utils.h"
|
#include "station_utils.h"
|
||||||
#include "query_utils.h"
|
#include "query_utils.h"
|
||||||
#include "lora_utils.h"
|
#include "lora_utils.h"
|
||||||
@@ -10,6 +11,8 @@ extern String versionDate;
|
|||||||
extern int rssi;
|
extern int rssi;
|
||||||
extern float snr;
|
extern float snr;
|
||||||
extern int freqError;
|
extern int freqError;
|
||||||
|
extern bool shouldSleepLowVoltage;
|
||||||
|
extern bool saveNewDigiEcoModeConfig;
|
||||||
|
|
||||||
|
|
||||||
namespace QUERY_Utils {
|
namespace QUERY_Utils {
|
||||||
@@ -53,12 +56,16 @@ namespace QUERY_Utils {
|
|||||||
answer.concat("?WHERE on development 73!");
|
answer.concat("?WHERE on development 73!");
|
||||||
} else if (queryQuestion.indexOf("?APRSEEM") == 0 && Config.digi.ecoMode == true) { // Exit Digipeater EcoMode
|
} else if (queryQuestion.indexOf("?APRSEEM") == 0 && Config.digi.ecoMode == true) { // Exit Digipeater EcoMode
|
||||||
answer = "DigiEcoMode:Stop";
|
answer = "DigiEcoMode:Stop";
|
||||||
Config.digi.ecoMode = false;
|
Config.digi.ecoMode = false;
|
||||||
Config.display.alwaysOn = true;
|
Config.display.alwaysOn = true;
|
||||||
Config.display.timeout = 10;
|
Config.display.timeout = 10;
|
||||||
|
shouldSleepLowVoltage = true; // to make sure all packets in outputPacketBuffer are sended before restart.
|
||||||
|
saveNewDigiEcoModeConfig = true;
|
||||||
} else if (queryQuestion.indexOf("?APRSSEM") == 0 && Config.digi.ecoMode == false) { // Start Digipeater EcoMode
|
} else if (queryQuestion.indexOf("?APRSSEM") == 0 && Config.digi.ecoMode == false) { // Start Digipeater EcoMode
|
||||||
answer = "DigiEcoMode:Start";
|
answer = "DigiEcoMode:Start";
|
||||||
Config.digi.ecoMode = true;
|
Config.digi.ecoMode = true;
|
||||||
|
shouldSleepLowVoltage = true; // to make sure all packets in outputPacketBuffer are sended before restart.
|
||||||
|
saveNewDigiEcoModeConfig = true;
|
||||||
} else if (queryQuestion.indexOf("?APRSEMS") == 0) { // Digipeater EcoMode Status
|
} else if (queryQuestion.indexOf("?APRSEMS") == 0) { // Digipeater EcoMode Status
|
||||||
answer = (Config.digi.ecoMode) ? "DigiEcoMode:ON" : "DigiEcoMode:OFF";
|
answer = (Config.digi.ecoMode) ? "DigiEcoMode:ON" : "DigiEcoMode:OFF";
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-24
@@ -16,10 +16,41 @@ uint32_t lastTxTime = millis();
|
|||||||
std::vector<LastHeardStation> lastHeardStations;
|
std::vector<LastHeardStation> lastHeardStations;
|
||||||
std::vector<String> outputPacketBuffer;
|
std::vector<String> outputPacketBuffer;
|
||||||
std::vector<Packet25SegBuffer> packet25SegBuffer;
|
std::vector<Packet25SegBuffer> packet25SegBuffer;
|
||||||
|
std::vector<String> blackList;
|
||||||
|
|
||||||
|
bool saveNewDigiEcoModeConfig = false;
|
||||||
|
|
||||||
|
|
||||||
namespace STATION_Utils {
|
namespace STATION_Utils {
|
||||||
|
|
||||||
|
void loadBlackList() {
|
||||||
|
if (Config.blackList != "") {
|
||||||
|
String callsigns = Config.blackList;
|
||||||
|
int spaceIndex = callsigns.indexOf(" ");
|
||||||
|
|
||||||
|
while (spaceIndex >= 0) {
|
||||||
|
blackList.push_back(callsigns.substring(0, spaceIndex));
|
||||||
|
callsigns = callsigns.substring(spaceIndex + 1);
|
||||||
|
spaceIndex = callsigns.indexOf(" ");
|
||||||
|
}
|
||||||
|
callsigns.trim();
|
||||||
|
if (callsigns.length() > 0) blackList.push_back(callsigns); // Add the last word if available
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool checkBlackList(const String& callsign) {
|
||||||
|
for (int i = 0; i < blackList.size(); i++) {
|
||||||
|
if (blackList[i].indexOf("*") >= 0) { // use wild card
|
||||||
|
String wildCard = blackList[i].substring(0, blackList[i].indexOf("*"));
|
||||||
|
if (callsign.startsWith(wildCard))return true;
|
||||||
|
} else {
|
||||||
|
if (blackList[i] == callsign) return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void deleteNotHeard() {
|
void deleteNotHeard() {
|
||||||
std::vector<LastHeardStation> lastHeardStation_temp;
|
std::vector<LastHeardStation> lastHeardStation_temp;
|
||||||
for (int i = 0; i < lastHeardStations.size(); i++) {
|
for (int i = 0; i < lastHeardStations.size(); i++) {
|
||||||
@@ -72,45 +103,29 @@ namespace STATION_Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void clean25SegBuffer() {
|
void clean25SegBuffer() {
|
||||||
if (!packet25SegBuffer.empty()) {
|
if (!packet25SegBuffer.empty() && (millis() - packet25SegBuffer[0].receivedTime) > 25 * 1000) packet25SegBuffer.erase(packet25SegBuffer.begin());
|
||||||
if ((millis() - packet25SegBuffer[0].receivedTime) > 25 * 1000) {
|
|
||||||
packet25SegBuffer.erase(packet25SegBuffer.begin());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool check25SegBuffer(const String& station, const String& textMessage) {
|
bool check25SegBuffer(const String& station, const String& textMessage) {
|
||||||
bool shouldBeIgnored = false;
|
|
||||||
if (!packet25SegBuffer.empty()) {
|
if (!packet25SegBuffer.empty()) {
|
||||||
for (int i = 0; i < packet25SegBuffer.size(); i++) {
|
for (int i = 0; i < packet25SegBuffer.size(); i++) {
|
||||||
if (packet25SegBuffer[i].station == station && packet25SegBuffer[i].payload == textMessage) {
|
if (packet25SegBuffer[i].station == station && packet25SegBuffer[i].payload == textMessage) return false;
|
||||||
shouldBeIgnored = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (shouldBeIgnored) {
|
Packet25SegBuffer packet;
|
||||||
return false;
|
packet.receivedTime = millis();
|
||||||
} else {
|
packet.station = station;
|
||||||
Packet25SegBuffer packet;
|
packet.payload = textMessage;
|
||||||
packet.receivedTime = millis();
|
packet25SegBuffer.push_back(packet);
|
||||||
packet.station = station;
|
return true;
|
||||||
packet.payload = textMessage;
|
|
||||||
packet25SegBuffer.push_back(packet);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void processOutputPacketBuffer() {
|
void processOutputPacketBuffer() {
|
||||||
int timeToWait = 3 * 1000; // 3 segs between packet Tx and also Rx ???
|
int timeToWait = 3 * 1000; // 3 segs between packet Tx and also Rx ???
|
||||||
uint32_t lastRx = millis() - lastRxTime;
|
uint32_t lastRx = millis() - lastRxTime;
|
||||||
uint32_t lastTx = millis() - lastTxTime;
|
uint32_t lastTx = millis() - lastTxTime;
|
||||||
bool saveNewDigiEcoModeConfig = false;
|
|
||||||
if (outputPacketBuffer.size() > 0 && lastTx > timeToWait && lastRx > timeToWait) {
|
if (outputPacketBuffer.size() > 0 && lastTx > timeToWait && lastRx > timeToWait) {
|
||||||
LoRa_Utils::sendNewPacket(outputPacketBuffer[0]);
|
LoRa_Utils::sendNewPacket(outputPacketBuffer[0]);
|
||||||
if (outputPacketBuffer[0].indexOf("DigiEcoMode:Start") != -1 || outputPacketBuffer[0].indexOf("DigiEcoMode:Stop") != -1) {
|
|
||||||
saveNewDigiEcoModeConfig = true;
|
|
||||||
shouldSleepLowVoltage = true; // to make sure all packets in outputPacketBuffer are sended before restart.
|
|
||||||
}
|
|
||||||
outputPacketBuffer.erase(outputPacketBuffer.begin());
|
outputPacketBuffer.erase(outputPacketBuffer.begin());
|
||||||
lastTxTime = millis();
|
lastTxTime = millis();
|
||||||
}
|
}
|
||||||
@@ -122,7 +137,9 @@ namespace STATION_Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (saveNewDigiEcoModeConfig) {
|
if (saveNewDigiEcoModeConfig) {
|
||||||
|
setCpuFrequencyMhz(80);
|
||||||
Config.writeFile();
|
Config.writeFile();
|
||||||
|
delay(1000);
|
||||||
displayToggle(false);
|
displayToggle(false);
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-5
@@ -37,12 +37,13 @@ extern int wxModuleType;
|
|||||||
extern bool backUpDigiMode;
|
extern bool backUpDigiMode;
|
||||||
extern bool shouldSleepLowVoltage;
|
extern bool shouldSleepLowVoltage;
|
||||||
extern bool transmitFlag;
|
extern bool transmitFlag;
|
||||||
|
extern bool passcodeValid;
|
||||||
|
|
||||||
extern std::vector<LastHeardStation> lastHeardStations;
|
extern std::vector<LastHeardStation> lastHeardStations;
|
||||||
|
|
||||||
bool statusAfterBoot = true;
|
bool statusAfterBoot = true;
|
||||||
bool sendStartTelemetry = true;
|
bool sendStartTelemetry = true;
|
||||||
bool beaconUpdate = true;
|
bool beaconUpdate = false;
|
||||||
uint32_t lastBeaconTx = 0;
|
uint32_t lastBeaconTx = 0;
|
||||||
uint32_t lastScreenOn = millis();
|
uint32_t lastScreenOn = millis();
|
||||||
String beaconPacket;
|
String beaconPacket;
|
||||||
@@ -197,9 +198,7 @@ namespace Utils {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (beaconUpdate) {
|
if (beaconUpdate) {
|
||||||
if (!Config.display.alwaysOn && Config.display.timeout != 0) {
|
if (!Config.display.alwaysOn && Config.display.timeout != 0) displayToggle(true);
|
||||||
displayToggle(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sendStartTelemetry && Config.battery.sendVoltageAsTelemetry && !Config.wxsensor.active && (Config.battery.sendInternalVoltage || Config.battery.sendExternalVoltage)) {
|
if (sendStartTelemetry && Config.battery.sendVoltageAsTelemetry && !Config.wxsensor.active && (Config.battery.sendInternalVoltage || Config.battery.sendExternalVoltage)) {
|
||||||
sendInitialTelemetryPackets();
|
sendInitialTelemetryPackets();
|
||||||
@@ -288,7 +287,7 @@ namespace Utils {
|
|||||||
secondaryBeaconPacket += encodedTelemetry;
|
secondaryBeaconPacket += encodedTelemetry;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.aprs_is.active && Config.beacon.sendViaAPRSIS && !backUpDigiMode) {
|
if (Config.beacon.sendViaAPRSIS && Config.aprs_is.active && passcodeValid && !backUpDigiMode) {
|
||||||
Utils::println("-- Sending Beacon to APRSIS --");
|
Utils::println("-- Sending Beacon to APRSIS --");
|
||||||
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...";
|
||||||
|
|||||||
+3
-1
@@ -206,13 +206,15 @@ namespace WEB_Utils {
|
|||||||
|
|
||||||
Config.personalNote = request->getParam("personalNote", true)->value();
|
Config.personalNote = request->getParam("personalNote", true)->value();
|
||||||
|
|
||||||
|
Config.blackList = request->getParam("blackList", true)->value();
|
||||||
|
|
||||||
Config.webadmin.active = request->hasParam("webadmin.active", true);
|
Config.webadmin.active = request->hasParam("webadmin.active", true);
|
||||||
if (Config.webadmin.active) {
|
if (Config.webadmin.active) {
|
||||||
Config.webadmin.username = request->getParam("webadmin.username", true)->value();
|
Config.webadmin.username = request->getParam("webadmin.username", true)->value();
|
||||||
Config.webadmin.password = request->getParam("webadmin.password", true)->value();
|
Config.webadmin.password = request->getParam("webadmin.password", true)->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
Config.ntp.gmtCorrection = request->getParam("ntp.gmtCorrection", true)->value().toInt();
|
Config.ntp.gmtCorrection = request->getParam("ntp.gmtCorrection", true)->value().toFloat();
|
||||||
|
|
||||||
Config.writeFile();
|
Config.writeFile();
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -16,7 +16,7 @@ float newHum, newTemp, newPress, newGas;
|
|||||||
|
|
||||||
|
|
||||||
Adafruit_BME280 bme280;
|
Adafruit_BME280 bme280;
|
||||||
#ifdef HELTEC_V3
|
#if defined(HELTEC_V3) || defined(HELTEC_V3_2)
|
||||||
Adafruit_BMP280 bmp280(&Wire1);
|
Adafruit_BMP280 bmp280(&Wire1);
|
||||||
Adafruit_Si7021 sensor = Adafruit_Si7021();
|
Adafruit_Si7021 sensor = Adafruit_Si7021();
|
||||||
#else
|
#else
|
||||||
@@ -32,7 +32,7 @@ namespace WX_Utils {
|
|||||||
void getWxModuleAddres() {
|
void getWxModuleAddres() {
|
||||||
uint8_t err, addr;
|
uint8_t err, addr;
|
||||||
for(addr = 1; addr < 0x7F; addr++) {
|
for(addr = 1; addr < 0x7F; addr++) {
|
||||||
#if defined(HELTEC_V3) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY)
|
#if defined(HELTEC_V3) || defined(HELTEC_V3_2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY)
|
||||||
Wire1.beginTransmission(addr);
|
Wire1.beginTransmission(addr);
|
||||||
err = Wire1.endTransmission();
|
err = Wire1.endTransmission();
|
||||||
#else
|
#else
|
||||||
@@ -58,7 +58,7 @@ namespace WX_Utils {
|
|||||||
if (wxModuleAddress != 0x00) {
|
if (wxModuleAddress != 0x00) {
|
||||||
bool wxModuleFound = false;
|
bool wxModuleFound = false;
|
||||||
if (wxModuleAddress == 0x76 || wxModuleAddress == 0x77) {
|
if (wxModuleAddress == 0x76 || wxModuleAddress == 0x77) {
|
||||||
#if defined(HELTEC_V3) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY)
|
#if defined(HELTEC_V3) || defined(HELTEC_V3_2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY)
|
||||||
if (bme280.begin(wxModuleAddress, &Wire1)) {
|
if (bme280.begin(wxModuleAddress, &Wire1)) {
|
||||||
Serial.println("BME280 sensor found");
|
Serial.println("BME280 sensor found");
|
||||||
wxModuleType = 1;
|
wxModuleType = 1;
|
||||||
@@ -115,7 +115,7 @@ namespace WX_Utils {
|
|||||||
Serial.println("BMP280 Module init done!");
|
Serial.println("BMP280 Module init done!");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
#ifndef HELTEC_V3
|
#if !defined(HELTEC_V3) && !defined(HELTEC_V3_2)
|
||||||
bme680.setTemperatureOversampling(BME680_OS_1X);
|
bme680.setTemperatureOversampling(BME680_OS_1X);
|
||||||
bme680.setHumidityOversampling(BME680_OS_1X);
|
bme680.setHumidityOversampling(BME680_OS_1X);
|
||||||
bme680.setPressureOversampling(BME680_OS_1X);
|
bme680.setPressureOversampling(BME680_OS_1X);
|
||||||
@@ -195,7 +195,7 @@ namespace WX_Utils {
|
|||||||
newHum = 0;
|
newHum = 0;
|
||||||
break;
|
break;
|
||||||
case 3: // BME680
|
case 3: // BME680
|
||||||
#ifndef HELTEC_V3
|
#if !defined(HELTEC_V3) && !defined(HELTEC_V3_2)
|
||||||
bme680.performReading();
|
bme680.performReading();
|
||||||
delay(50);
|
delay(50);
|
||||||
if (bme680.endReading()) {
|
if (bme680.endReading()) {
|
||||||
|
|||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
This directory is intended for PlatformIO Test Runner and project tests.
|
|
||||||
|
|
||||||
Unit Testing is a software testing method by which individual units of
|
|
||||||
source code, sets of one or more MCU program modules together with associated
|
|
||||||
control data, usage procedures, and operating procedures, are tested to
|
|
||||||
determine whether they are fit for use. Unit testing finds problems early
|
|
||||||
in the development cycle.
|
|
||||||
|
|
||||||
More information about PlatformIO Unit Testing:
|
|
||||||
- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
#ifndef BOARD_PINOUT_H_
|
||||||
|
#define BOARD_PINOUT_H_
|
||||||
|
|
||||||
|
// LoRa Radio
|
||||||
|
#define HAS_SX1278
|
||||||
|
#define RADIO_SCLK_PIN 5
|
||||||
|
#define RADIO_MISO_PIN 19
|
||||||
|
#define RADIO_MOSI_PIN 27
|
||||||
|
#define RADIO_CS_PIN 18
|
||||||
|
#define RADIO_RST_PIN 23
|
||||||
|
#define RADIO_BUSY_PIN 26
|
||||||
|
|
||||||
|
// Display
|
||||||
|
#define HAS_DISPLAY
|
||||||
|
|
||||||
|
#undef OLED_SDA
|
||||||
|
#undef OLED_SCL
|
||||||
|
#undef OLED_RST
|
||||||
|
|
||||||
|
#define OLED_SDA 21
|
||||||
|
#define OLED_SCL 22
|
||||||
|
#define OLED_RST -1
|
||||||
|
|
||||||
|
// GPS
|
||||||
|
#define HAS_GPS
|
||||||
|
#define GPS_RX 12
|
||||||
|
#define GPS_TX 34
|
||||||
|
|
||||||
|
// OTHER
|
||||||
|
#define INTERNAL_LED_PIN 2
|
||||||
|
#define BATTERY_PIN 35
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[env:TROY_LoRa_APRS]
|
||||||
|
board = esp32dev
|
||||||
|
build_flags =
|
||||||
|
${common.build_flags}
|
||||||
|
-D TROY_LoRa_APRS
|
||||||
|
lib_deps =
|
||||||
|
${common.lib_deps}
|
||||||
|
${common.display_libs}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef BOARD_PINOUT_H_
|
||||||
|
#define BOARD_PINOUT_H_
|
||||||
|
|
||||||
|
// LoRa Radio
|
||||||
|
#define HAS_SX1262
|
||||||
|
#define RADIO_SCLK_PIN 7
|
||||||
|
#define RADIO_MISO_PIN 8
|
||||||
|
#define RADIO_MOSI_PIN 9
|
||||||
|
#define RADIO_CS_PIN 41
|
||||||
|
#define RADIO_RST_PIN 42
|
||||||
|
#define RADIO_DIO1_PIN 39
|
||||||
|
#define RADIO_BUSY_PIN 40
|
||||||
|
|
||||||
|
#define RADIO_HAS_RF_SWITCH // DIO02
|
||||||
|
#define RADIO_RF_SWITCH 38
|
||||||
|
|
||||||
|
#define BUTTON_PIN 21
|
||||||
|
#define INTERNAL_LED_PIN 48
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[env:XIAO_ESP32S3_WIO_SX1262]
|
||||||
|
board = seeed_xiao_esp32s3
|
||||||
|
build_flags =
|
||||||
|
${common.build_flags}
|
||||||
|
${common.usb_flags}
|
||||||
|
-D XIAO_ESP32S3_LORA
|
||||||
|
lib_deps =
|
||||||
|
${common.lib_deps}
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
#define OLED_SDA 4
|
#define OLED_SDA 4
|
||||||
#define OLED_SCL 15
|
#define OLED_SCL 15
|
||||||
#define OLED_RST 16
|
#define OLED_RST 16
|
||||||
|
#define OLED_DISPLAY_HAS_RST_PIN
|
||||||
|
|
||||||
// Aditional Config
|
// Aditional Config
|
||||||
#define INTERNAL_LED_PIN 25
|
#define INTERNAL_LED_PIN 25
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#define OLED_SDA 17
|
#define OLED_SDA 17
|
||||||
#define OLED_SCL 18
|
#define OLED_SCL 18
|
||||||
#define OLED_RST 21
|
#define OLED_RST 21
|
||||||
|
#define OLED_DISPLAY_HAS_RST_PIN
|
||||||
|
|
||||||
// Aditional Config
|
// Aditional Config
|
||||||
#define INTERNAL_LED_PIN 35
|
#define INTERNAL_LED_PIN 35
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#ifndef BOARD_PINOUT_H_
|
||||||
|
#define BOARD_PINOUT_H_
|
||||||
|
|
||||||
|
// LoRa Radio
|
||||||
|
#define HAS_SX1262
|
||||||
|
#define RADIO_SCLK_PIN 9
|
||||||
|
#define RADIO_MISO_PIN 11
|
||||||
|
#define RADIO_MOSI_PIN 10
|
||||||
|
#define RADIO_CS_PIN 8
|
||||||
|
#define RADIO_RST_PIN 12
|
||||||
|
#define RADIO_DIO1_PIN 14
|
||||||
|
#define RADIO_BUSY_PIN 13
|
||||||
|
|
||||||
|
// Display
|
||||||
|
#define HAS_DISPLAY
|
||||||
|
|
||||||
|
#undef OLED_SDA
|
||||||
|
#undef OLED_SCL
|
||||||
|
#undef OLED_RST
|
||||||
|
|
||||||
|
#define OLED_SDA 17
|
||||||
|
#define OLED_SCL 18
|
||||||
|
#define OLED_RST 21
|
||||||
|
#define OLED_DISPLAY_HAS_RST_PIN
|
||||||
|
|
||||||
|
// Aditional Config
|
||||||
|
#define INTERNAL_LED_PIN 35
|
||||||
|
#define BATTERY_PIN 1
|
||||||
|
#define VEXT_CTRL 36
|
||||||
|
#define ADC_CTRL 37
|
||||||
|
#define BOARD_I2C_SDA 41
|
||||||
|
#define BOARD_I2C_SCL 42
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
[env:heltec_wifi_lora_32_V3_2]
|
||||||
|
board = heltec_wifi_lora_32_V3
|
||||||
|
board_build.mcu = esp32s3
|
||||||
|
build_flags =
|
||||||
|
${common.build_flags}
|
||||||
|
-D HELTEC_V3_2
|
||||||
|
lib_deps =
|
||||||
|
${common.lib_deps}
|
||||||
|
${common.display_libs}
|
||||||
@@ -18,9 +18,10 @@
|
|||||||
#undef OLED_SCL
|
#undef OLED_SCL
|
||||||
#undef OLED_RST
|
#undef OLED_RST
|
||||||
|
|
||||||
#define OLED_SDA 4
|
#define OLED_SDA 17
|
||||||
#define OLED_SCL 15
|
#define OLED_SCL 18
|
||||||
#define OLED_RST 16
|
#define OLED_RST 21
|
||||||
|
#define OLED_DISPLAY_HAS_RST_PIN
|
||||||
|
|
||||||
// Aditional Config
|
// Aditional Config
|
||||||
#define INTERNAL_LED_PIN 35
|
#define INTERNAL_LED_PIN 35
|
||||||
|
|||||||
Reference in New Issue
Block a user