Compare commits

...

33 Commits

Author SHA1 Message Date
richonguzman
92572245cd beacon Freq on digi mod 2025-10-12 21:45:23 -03:00
richonguzman
152217e71c startup delay added 2025-10-12 14:21:51 -03:00
richonguzman
d334164b6f Beacon Freq on Digi Mode 2025-10-11 18:27:06 -03:00
richonguzman
61409ce683 index correction 2025-10-11 15:57:29 -03:00
richonguzman
742a6b6477 readme update 2025-10-11 13:23:39 -03:00
richonguzman
dd2fce3908 igate beacon over mqtt 2025-10-11 13:22:08 -03:00
richonguzman
90b29b66d5 callsign trim 2025-10-11 12:50:53 -03:00
richonguzman
2a86cdb0d8 Op ntp server 2025-10-11 12:40:07 -03:00
richonguzman
1abaa299e0 update readme 2025-10-10 12:44:15 -03:00
Ricardo Guzman (Richonguzman)
9cbd7c22fd Merge pull request #342 from richonguzman/richonguzman-patch-14
Update README.md
2025-10-10 12:15:18 -03:00
Ricardo Guzman (Richonguzman)
e15e6def91 Update README.md 2025-10-10 12:14:56 -03:00
richonguzman
33c8be4f48 added manual for 3.1.2 2025-10-10 12:11:24 -03:00
Ricardo Guzman (Richonguzman)
c2a7c26d78 Merge pull request #341 from richonguzman/richonguzman-patch-13
Update README.md
2025-10-10 12:08:41 -03:00
Ricardo Guzman (Richonguzman)
387e8a988a Update README.md 2025-10-10 12:08:28 -03:00
Ricardo Guzman (Richonguzman)
48b075a554 Merge pull request #340 from richonguzman/richonguzman-patch-12
Update README.md
2025-10-10 12:06:38 -03:00
Ricardo Guzman (Richonguzman)
7e76e43817 Update README.md 2025-10-10 12:06:25 -03:00
Ricardo Guzman (Richonguzman)
9b7b4e1838 Merge pull request #339 from richonguzman/richonguzman-patch-11
Update README.md
2025-10-10 12:04:17 -03:00
Ricardo Guzman (Richonguzman)
5b9d56843b Update README.md 2025-10-10 12:04:04 -03:00
Ricardo Guzman (Richonguzman)
30eb1023dc Merge pull request #338 from richonguzman/richonguzman-patch-10
Update README.md
2025-10-10 12:03:09 -03:00
Ricardo Guzman (Richonguzman)
1ba86af61b Update README.md 2025-10-10 12:02:54 -03:00
Ricardo Guzman (Richonguzman)
1d475bc8a2 Merge pull request #337 from richonguzman/richonguzman-patch-9
Update README.md
2025-10-10 11:58:13 -03:00
Ricardo Guzman (Richonguzman)
70f9a6fa04 Update README.md 2025-10-10 11:57:50 -03:00
Ricardo Guzman (Richonguzman)
6747511850 Merge pull request #336 from richonguzman/richonguzman-patch-8
Update README.md
2025-10-10 11:56:25 -03:00
Ricardo Guzman (Richonguzman)
96a4394e89 Update README.md 2025-10-10 11:56:10 -03:00
Ricardo Guzman (Richonguzman)
4e009bc14c Merge pull request #332 from richonguzman/richonguzman-patch-7
adding heltec wireless bridge
2025-09-29 15:52:00 -03:00
Ricardo Guzman (Richonguzman)
4c11c66a1c adding heltec wireless bridge 2025-09-29 15:51:41 -03:00
richonguzman
a89181b5df update complete 2025-09-26 11:37:02 -03:00
richonguzman
9a94a193f9 update before release 2025-09-25 22:01:38 -03:00
richonguzman
9c7f6c7934 led update 2025-09-25 17:54:53 -03:00
richonguzman
53e8941262 blue led add 2025-09-25 17:33:59 -03:00
richonguzman
60a148d362 testing1 2025-09-25 15:55:18 -03:00
richonguzman
36cd1578cc adding basic stuff 2025-09-25 15:50:28 -03:00
richonguzman
c3036f290f TCPIP correction 2025-09-25 15:35:38 -03:00
18 changed files with 266 additions and 67 deletions

View File

@@ -29,6 +29,8 @@ jobs:
chip: esp32s3
- name: heltec_wireless_stick_lite_v3_display
chip: esp32s3
- name: heltec_wireless_bridge
chip: esp32
- name: ESP32_DIY_LoRa
chip: esp32
- name: ESP32_DIY_LoRa_915

View File

@@ -9,46 +9,38 @@ __(This iGate Firmware works with all LoRa Tracker Firmwares (specially this <a
____________________________________________________
# <a href="https://richonguzman.github.io/lora-igate-web-flasher/installer.html" target="_blank">WEB FLASHER/INSTALLER</a>
# <a href="https://github.com/richonguzman/LoRa_APRS_iGate/blob/main/manual/LoRa_APRS_iGate_CA2RXU_Firmware_Manual.pdf" target="_blank">LoRa APRS iGate CA2RXU Firmware Manual</a>
____________________________________________________
## You can support this project to continue to grow:
[<img src="https://github.com/richonguzman/LoRa_APRS_Tracker/blob/main/images/github-sponsors.png">](https://github.com/sponsors/richonguzman) [<img src="https://github.com/richonguzman/LoRa_APRS_Tracker/blob/main/images/paypalme.png">](http://paypal.me/richonguzman)
<br />
# WEB FLASHER/INSTALLER is <a href="https://richonguzman.github.io/lora-igate-web-flasher/installer.html" target="_blank">here</a>
____________________________________________________
# WIKI
### FAQ, BME280, TNC and more --> <a href="https://github.com/richonguzman/LoRa_APRS_iGate/wiki/00.-FAQ-(frequently-asked-questions)" target="_blank">here</a>.
### Installation Guide --> <a href="https://github.com/richonguzman/LoRa_APRS_iGate/wiki/01.-Installation-Guide" target="_blank">here</a>.
<br />
# SUPPORTED BOARDS
### Buying links --> <a href="https://github.com/richonguzman/LoRa_APRS_iGate/wiki/108.-Supported-Boards-and-Buying-Links" target="_blank">here</a>.
## SUPPORTED BOARDS (<a href="https://github.com/richonguzman/LoRa_APRS_iGate/wiki/Supported-Boards-and-Buying-Links" target="_blank">Buying links</a>).
(NOTE: all boards with 433-868-915 MHz versions)
- TTGO Lilygo LoRa32 T3S3 V1.2 and LoRa32 V2.1 (V1.6 is the same).
- TTGO T-Beam V1.0 , V1.1, V1.2 (also variations with SX1262 and SX1268 LoRa Modules).
- TTGO T-Beam V1.0 , V1.1, V1.2 (also variations with SX1262 and SX1268 LoRa Modules) and Supreme V3.
- T-Deck Plus (and also regular T-Deck with/without GPS).
- HELTEC V2, V3, V3.2, T114, Wireless Stick, Wireless Stick Lite, HT-CT62, Wireless Tracker, Wireless Paper.
- RAK Wireless 4631 + 19007(19003)
- RAK Wireless 4631 + 19007(or 19003)
- Faketec (NRF52840 + Heltec HTRA62(SX1262))
- Faketec V3 (NRF52840 + Heltec HTRA62(SX1262))
- QRP Labs LightGateway 1.0 and Plus 1.0.
- Faketec V3 (NRF52840 + Heltec HTRA62 SX1262)
- ESP32 Wroom + SX1278 LoRa Module or Ebyte 400M30S (or 900M30S) 1W LoRa Module for a DIY Versions.
- ESP32 + SX1278 LoRa Module or Ebyte 400M30S (or 900M30S) 1W LoRa Module for a DIY Versions.
- ESP32C3 + Ebyte 400M30S(or 900M30S) 1W LoRa Module for another DIY version.
@@ -58,8 +50,11 @@ ____________________________________________________
<br />
## Timeline (Versions):
# Timeline (Versions):
- 2025-10-11 User defined NTP server and send beacon over MQTT added.
- 2025-10-10 Changed Wiki into a pdf manual.
- 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-06-20 Digipeaters now with updated EcoMode (Board Sleeps until packet Rx reducing current consumption to almost 10% at idle).
- 2025-06-20 New Boards Added: Heltec T114 MeshNode, Faketec V3 as Digipeaters and QRP Labs LightGateway Plus 1.0.

View File

@@ -35,7 +35,8 @@
"blacklist": "",
"digi": {
"mode": 0,
"ecoMode": 0
"ecoMode": 0,
"beaconOnRxFreq": false
},
"lora": {
"txFreq": 433775000,
@@ -86,7 +87,8 @@
"topic": "",
"username": "",
"password": "",
"port": 1883
"port": 1883,
"beaconOverMqtt": false
},
"ota": {
"username": "",
@@ -101,12 +103,14 @@
"rfOnly": true
},
"ntp": {
"server": "pool.ntp.org",
"gmtCorrection": 0.0
},
"other": {
"rememberStationTime": 30,
"backupDigiMode": false,
"rebootMode": false,
"rebootModeTime": 6
"rebootModeTime": 6,
"startupDelay": 0
}
}

View File

@@ -344,6 +344,28 @@
</button>
</div>
</div>
<div class="col-6">
<label
for="startupDelay"
class="form-label"
>Startup Delay<small>(To Allow Router/Modem to start WiFiAP before connection)</small></label
>
<div class="input-group">
<input
type="number"
name="startupDelay"
id="startupDelay"
placeholder="0"
class="form-control"
step="1"
min="0"
max="5"
/>
<span class="input-group-text"
>minutes</span
>
</div>
</div>
</div>
</div>
<hr>
@@ -716,6 +738,28 @@
</option>
</select>
</div>
<div class="col-12 mt-3">
<label
for="digi.beaconOnRxFreq"
class="form-label"
>Digipeater Beacon Frequency
<small
>(If Rx Freq different from Tx Freq).</small
></label
>
<select
class="form-select form-select"
name="digi.beaconOnRxFreq"
id="digi.beaconOnRxFreq"
>
<option value="false">
Beacon on Tx Freq
</option>
<option value="true">
Beacon on Rx Freq
</option>
</select>
</div>
</div>
</div>
</div>
@@ -1416,7 +1460,7 @@
<label
for="syslog.logBeaconOverTCPIP"
class="form-label"
>Log Beacon over TPCIP</label
>Log Beacon over TCP/IP</label
>
</div>
</div>
@@ -1641,6 +1685,21 @@
Default is <strong>1883</strong>
</div>
</div>
<div class="col-12 mt-3">
<div class="form-check form-switch">
<input
type="checkbox"
name="mqtt.beaconOverMqtt"
id="mqtt.beaconOverMqtt"
class="form-check-input"
/>
<label
for="mqtt.beaconOverMqtt"
class="form-label"
>Send iGate Beacon to MQTT</label
>
</div>
</div>
</div>
</div>
</div>
@@ -1990,6 +2049,21 @@
</small>
</div>
<div class="col-lg-9 col-sm-12">
<div class="col-12">
<label
for="ntp.server"
class="form-label"
>NTP Server hostname</label
>
<div class="input-group">
<input
type="text"
name="ntp.server"
id="ntp.server"
class="form-control"
/>
</div>
</div>
<div class="col-12">
<label
for="ntp.gmtCorrection"

View File

@@ -95,6 +95,7 @@ function loadSettings(settings) {
networksContainer.appendChild(networkElement);
networkCount++;
});
document.getElementById("startupDelay").value = settings.startupDelay;
// APRS-IS
document.getElementById("aprs_is.active").checked = settings.aprs_is.active;
@@ -134,6 +135,7 @@ function loadSettings(settings) {
// Digi
document.getElementById("digi.mode").value = settings.digi.mode;
document.getElementById("digi.ecoMode").value = settings.digi.ecoMode;
document.getElementById("digi.beaconOnRxFreq").value = settings.digi.beaconOnRxFreq;
// LoRa
document.getElementById("lora.txFreq").value = settings.lora.txFreq;
@@ -207,12 +209,14 @@ function loadSettings(settings) {
document.getElementById("mqtt.username").value = settings.mqtt.username;
document.getElementById("mqtt.password").value = settings.mqtt.password;
document.getElementById("mqtt.port").value = settings.mqtt.port;
MqttCheckbox.checked = settings.mqtt.active;
MqttServer.disabled = !MqttCheckbox.check;
MqttTopic.disabled = !MqttCheckbox.check;
MqttUsername.disabled = !MqttCheckbox.check;
MqttPassword.disabled = !MqttCheckbox.check;
MqttPort.disabled = !MqttCheckbox.check;
document.getElementById("mqtt.beaconOverMqtt").value = settings.mqtt.beaconOverMqtt;
MqttCheckbox.checked = settings.mqtt.active;
MqttServer.disabled = !MqttCheckbox.check;
MqttTopic.disabled = !MqttCheckbox.check;
MqttUsername.disabled = !MqttCheckbox.check;
MqttPassword.disabled = !MqttCheckbox.check;
MqttPort.disabled = !MqttCheckbox.check;
MqttBeaconOverMqtt.disabled = !MqttCheckbox.check;
// Reboot
document.getElementById("other.rebootMode").checked = settings.other.rebootMode;
@@ -241,6 +245,7 @@ function loadSettings(settings) {
document.getElementById("remoteManagement.rfOnly").checked = settings.remoteManagement.rfOnly;
// NTP
document.getElementById("ntp.server").value = settings.ntp.server;
document.getElementById("ntp.gmtCorrection").value = settings.ntp.gmtCorrection;
// Experimental
@@ -379,12 +384,14 @@ const MqttTopic = document.querySelector('input[name="mqtt.topic
const MqttUsername = document.querySelector('input[name="mqtt.username"]');
const MqttPassword = document.querySelector('input[name="mqtt.password"]');
const MqttPort = document.querySelector('input[name="mqtt.port"]');
const MqttBeaconOverMqtt = document.querySelector('input[name="mqtt.beaconOverMqtt"]');
MqttCheckbox.addEventListener("change", function () {
MqttServer.disabled = !this.checked;
MqttTopic.disabled = !this.checked;
MqttUsername.disabled = !this.checked;
MqttPassword.disabled = !this.checked;
MqttPort.disabled = !this.checked;
MqttBeaconOverMqtt.disabled = !this.checked;
});
// Reboot Switches

View File

@@ -68,6 +68,7 @@ class DIGI {
public:
int mode;
int ecoMode; // 0 = Not Active | 1 = Ultra EcoMode | 2 = Not Active (WiFi OFF, Serial ON)
bool beaconOnRxFreq;
};
class LoraModule {
@@ -140,6 +141,7 @@ public:
class NTP {
public:
String server;
float gmtCorrection;
};
@@ -157,6 +159,7 @@ public:
String username;
String password;
int port;
bool beaconOverMqtt;
};
class Configuration {
@@ -166,6 +169,7 @@ public:
bool backupDigiMode;
bool rebootMode;
int rebootModeTime;
int startupDelay;
String personalNote;
String blacklist;
std::vector<WiFi_AP> wifiAPs;

View File

@@ -23,12 +23,6 @@
#include <Arduino.h>
struct Packet25SegBuffer {
uint32_t receivedTime;
String station;
String payload;
};
struct LastHeardStation {
uint32_t lastHeardTime;
String station;
@@ -47,7 +41,7 @@ namespace STATION_Utils {
bool check25SegBuffer(const String& station, const String& textMessage);
void processOutputPacketBufferUltraEcoMode();
void processOutputPacketBuffer();
void addToOutputPacketBuffer(const String& packet);
void addToOutputPacketBuffer(const String& packet, bool flag = false);
}

View File

@@ -35,7 +35,7 @@ namespace Utils {
void processStatus();
String getLocalIP();
void setupDisplay();
void activeStations();
void showActiveStations();
void checkBeaconInterval();
void checkDisplayInterval();
void validateFreqs();
@@ -46,6 +46,7 @@ namespace Utils {
void checkRebootTime();
void checkSleepByLowBatteryVoltage(uint8_t mode);
bool checkValidCallsign(const String& callsign);
void startupDelay();
}

Binary file not shown.

View File

@@ -67,8 +67,8 @@ ___________________________________________________________________*/
#endif
String versionDate = "2025-09-17";
String versionNumber = "3.1.2";
String versionDate = "2025-10-12";
String versionNumber = "3.1.3";
Configuration Config;
WiFiClient aprsIsClient;
WiFiClient mqttClient;
@@ -97,7 +97,6 @@ bool modemLoggedToAPRSIS = false;
std::vector<ReceivedPacket> receivedPackets;
String firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine;
//#define STARTUP_DELAY 5 //min
void setup() {
@@ -108,12 +107,7 @@ void setup() {
Utils::validateFreqs();
GPS_Utils::setup();
STATION_Utils::loadBlacklistAndManagers();
#ifdef STARTUP_DELAY // (TEST) just to wait for WiFi init of Routers
displayShow("", " STARTUP DELAY ...", "", "", 0);
delay(STARTUP_DELAY * 60 * 1000);
#endif
Utils::startupDelay();
SLEEP_Utils::setup();
WIFI_Utils::setup();
NTP_Utils::setup();

View File

@@ -45,9 +45,13 @@ bool Configuration::writeFile() {
}
}
data["other"]["startupDelay"] = startupDelay;
data["wifi"]["autoAP"]["password"] = wifiAutoAP.password;
data["wifi"]["autoAP"]["timeout"] = wifiAutoAP.timeout;
callsign.trim();
callsign.toUpperCase();
data["callsign"] = callsign;
data["aprs_is"]["active"] = aprs_is.active;
@@ -83,6 +87,7 @@ bool Configuration::writeFile() {
#if defined(HAS_A7670)
if (digi.ecoMode == 1) data["digi"]["ecoMode"] = 2;
#endif
data["digi"]["beaconOnRxFreq"] = digi.beaconOnRxFreq;
data["lora"]["rxFreq"] = loramodule.rxFreq;
data["lora"]["txFreq"] = loramodule.txFreq;
@@ -129,6 +134,7 @@ bool Configuration::writeFile() {
data["mqtt"]["username"] = mqtt.username;
data["mqtt"]["password"] = mqtt.password;
data["mqtt"]["port"] = mqtt.port;
data["mqtt"]["beaconOverMqtt"] = mqtt.beaconOverMqtt;
data["ota"]["username"] = ota.username;
data["ota"]["password"] = ota.password;
@@ -140,6 +146,7 @@ bool Configuration::writeFile() {
data["remoteManagement"]["managers"] = remoteManagement.managers;
data["remoteManagement"]["rfOnly"] = remoteManagement.rfOnly;
data["ntp"]["server"] = ntp.server;
data["ntp"]["gmtCorrection"] = ntp.gmtCorrection;
data["other"]["rebootMode"] = rebootMode;
@@ -181,6 +188,9 @@ bool Configuration::readFile() {
wifiAPs.push_back(wifiap);
}
if (!data["other"].containsKey("startupDelay")) needsRewrite = true;
startupDelay = data["other"]["startupDelay"] | 0;
if (!data["wifi"]["autoAP"].containsKey("password") ||
!data["wifi"]["autoAP"].containsKey("timeout")) needsRewrite = true;
wifiAutoAP.password = data["wifi"]["autoAP"]["password"] | "1234567890";
@@ -238,10 +248,12 @@ bool Configuration::readFile() {
blacklist = data["blacklist"] | "station callsign";
if (!data["digi"].containsKey("mode") ||
!data["digi"].containsKey("ecoMode")) needsRewrite = true;
!data["digi"].containsKey("ecoMode") ||
!data["digi"].containsKey("beaconOnRxFreq")) needsRewrite = true;
digi.mode = data["digi"]["mode"] | 0;
digi.ecoMode = data["digi"]["ecoMode"] | 0;
if (digi.ecoMode == 1) shouldSleepStop = false;
digi.beaconOnRxFreq = data["digi"]["beaconOnRxFreq"] | false;
#if defined(HAS_A7670)
if (digi.ecoMode == 1) digi.ecoMode = 2;
@@ -320,13 +332,15 @@ bool Configuration::readFile() {
!data["mqtt"].containsKey("topic") ||
!data["mqtt"].containsKey("username") ||
!data["mqtt"].containsKey("password") ||
!data["mqtt"].containsKey("port")) needsRewrite = true;
!data["mqtt"].containsKey("port") ||
!data["mqtt"].containsKey("beaconOverMqtt")) needsRewrite = true;
mqtt.active = data["mqtt"]["active"] | false;
mqtt.server = data["mqtt"]["server"] | "";
mqtt.topic = data["mqtt"]["topic"] | "aprs-igate";
mqtt.username = data["mqtt"]["username"] | "";
mqtt.password = data["mqtt"]["password"] | "";
mqtt.port = data["mqtt"]["port"] | 1883;
mqtt.beaconOverMqtt = data["mqtt"]["beaconOverMqtt"] | false;
if (!data["ota"].containsKey("username") ||
!data["ota"].containsKey("password")) needsRewrite = true;
@@ -345,7 +359,9 @@ bool Configuration::readFile() {
remoteManagement.managers = data["remoteManagement"]["managers"] | "";
remoteManagement.rfOnly = data["remoteManagement"]["rfOnly"] | true;
if (!data["ntp"].containsKey("gmtCorrection")) needsRewrite = true;
if (!data["ntp"].containsKey("server") ||
!data["ntp"].containsKey("gmtCorrection")) needsRewrite = true;
ntp.server = data["ntp"]["server"] | "pool.ntp.org";
ntp.gmtCorrection = data["ntp"]["gmtCorrection"] | 0.0;
if (!data["other"].containsKey("rebootMode") ||
@@ -371,7 +387,7 @@ bool Configuration::readFile() {
if (needsRewrite) {
Serial.println("Config JSON incomplete, rewriting...");
writeFile();
delay(500);
delay(1000);
ESP.restart();
}
Serial.println("Config read successfuly");
@@ -390,6 +406,8 @@ void Configuration::setDefaultValues() {
wifiAPs.push_back(wifiap);
startupDelay = 0;
wifiAutoAP.password = "1234567890";
wifiAutoAP.timeout = 10;
@@ -425,6 +443,7 @@ void Configuration::setDefaultValues() {
digi.mode = 0;
digi.ecoMode = 0;
digi.beaconOnRxFreq = false;
loramodule.txFreq = 433775000;
loramodule.rxFreq = 433775000;
@@ -471,6 +490,7 @@ void Configuration::setDefaultValues() {
mqtt.username = "";
mqtt.password = "";
mqtt.port = 1883;
mqtt.beaconOverMqtt = false;
ota.username = "";
ota.password = "";
@@ -482,6 +502,7 @@ void Configuration::setDefaultValues() {
remoteManagement.managers = "";
remoteManagement.rfOnly = true;
ntp.server = "pool.ntp.org";
ntp.gmtCorrection = 0.0;
rebootMode = false;
@@ -506,7 +527,7 @@ Configuration::Configuration() {
if (!exists) {
setDefaultValues();
writeFile();
delay(500);
delay(1000);
ESP.restart();
}

View File

@@ -30,6 +30,7 @@
extern Configuration Config;
extern uint32_t lastRxTime;
extern bool packetIsBeacon;
extern std::vector<ReceivedPacket> receivedPackets;
@@ -143,7 +144,9 @@ namespace LoRa_Utils {
if (!Config.loramodule.txActive) return;
if (Config.loramodule.txFreq != Config.loramodule.rxFreq) {
changeFreqTx();
if (!packetIsBeacon || (packetIsBeacon && !Config.digi.beaconOnRxFreq)) {
changeFreqTx();
}
}
#ifdef INTERNAL_LED_PIN
@@ -165,7 +168,9 @@ namespace LoRa_Utils {
if (Config.digi.ecoMode != 1) digitalWrite(INTERNAL_LED_PIN, LOW); // disabled in Ultra Eco Mode
#endif
if (Config.loramodule.txFreq != Config.loramodule.rxFreq) {
changeFreqRx();
if (!packetIsBeacon || (packetIsBeacon && !Config.digi.beaconOnRxFreq)) {
changeFreqRx();
}
}
}

View File

@@ -27,7 +27,7 @@
extern Configuration Config;
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "pool.ntp.org", 0, 15 * 60 * 1000); // Update interval 15 min
NTPClient timeClient(ntpUDP, Config.ntp.server.c_str(), 0, 15 * 60 * 1000); // Update interval 15 min
namespace NTP_Utils {

View File

@@ -33,13 +33,26 @@ extern bool shouldSleepLowVoltage;
uint32_t lastTxTime = millis();
std::vector<LastHeardStation> lastHeardStations;
std::vector<String> outputPacketBuffer;
std::vector<Packet25SegBuffer> packet25SegBuffer;
std::vector<String> blacklist;
std::vector<String> managers;
std::vector<LastHeardStation> lastHeardObjects;
struct OutputPacketBuffer {
String packet;
bool isBeacon;
};
std::vector<OutputPacketBuffer> outputPacketBuffer;
struct Packet25SegBuffer {
uint32_t receivedTime;
String station;
String payload;
};
std::vector<Packet25SegBuffer> packet25SegBuffer;
bool saveNewDigiEcoModeConfig = false;
bool packetIsBeacon = false;
namespace STATION_Utils {
@@ -138,7 +151,7 @@ namespace STATION_Utils {
}
}
if (!stationHeard) lastHeardStations.emplace_back(LastHeardStation{millis(), station});
Utils::activeStations();
Utils::showActiveStations();
}
bool wasHeard(const String& station) {
@@ -171,7 +184,9 @@ namespace STATION_Utils {
size_t currentIndex = 0;
while (currentIndex < outputPacketBuffer.size()) { // this sends all packets from output buffer
delay(3000); // and cleans buffer to avoid sending packets with time offset
LoRa_Utils::sendNewPacket(outputPacketBuffer[currentIndex]); // next time it wakes up
if (outputPacketBuffer[currentIndex].isBeacon) packetIsBeacon = true;
LoRa_Utils::sendNewPacket(outputPacketBuffer[currentIndex].packet); // next time it wakes up
if (outputPacketBuffer[currentIndex].isBeacon) packetIsBeacon = false;
currentIndex++;
}
outputPacketBuffer.clear();
@@ -190,13 +205,17 @@ namespace STATION_Utils {
uint32_t lastRx = millis() - lastRxTime;
uint32_t lastTx = millis() - lastTxTime;
if (outputPacketBuffer.size() > 0 && lastTx > timeToWait && lastRx > timeToWait) {
LoRa_Utils::sendNewPacket(outputPacketBuffer[0]);
if (outputPacketBuffer[0].isBeacon) packetIsBeacon = true;
LoRa_Utils::sendNewPacket(outputPacketBuffer[0].packet);
if (outputPacketBuffer[0].isBeacon) packetIsBeacon = false;
outputPacketBuffer.erase(outputPacketBuffer.begin());
lastTxTime = millis();
}
if (shouldSleepLowVoltage) {
while (outputPacketBuffer.size() > 0) {
LoRa_Utils::sendNewPacket(outputPacketBuffer[0]);
if (outputPacketBuffer[0].isBeacon) packetIsBeacon = true;
LoRa_Utils::sendNewPacket(outputPacketBuffer[0].packet);
if (outputPacketBuffer[0].isBeacon) packetIsBeacon = false;
outputPacketBuffer.erase(outputPacketBuffer.begin());
delay(4000);
}
@@ -209,8 +228,12 @@ namespace STATION_Utils {
}
}
void addToOutputPacketBuffer(const String& packet) {
outputPacketBuffer.push_back(packet);
void addToOutputPacketBuffer(const String& packet, bool flag) {
OutputPacketBuffer entry;
entry.packet = packet;
entry.isBeacon = flag;
outputPacketBuffer.push_back(entry);
}
}

View File

@@ -127,7 +127,7 @@ namespace Utils {
seventhLine = " listening...";
}
void activeStations() {
void showActiveStations() {
char buffer[30]; // Adjust size as needed
sprintf(buffer, "Stations (%dmin) = %2d", Config.rememberStationTime, lastHeardStations.size());
fourthLine = buffer;
@@ -159,7 +159,7 @@ namespace Utils {
STATION_Utils::deleteNotHeard();
activeStations();
showActiveStations();
beaconPacket = iGateBeaconPacket;
secondaryBeaconPacket = iGateLoRaBeaconPacket;
@@ -259,7 +259,7 @@ namespace Utils {
Utils::println("-- Sending Beacon to RF --");
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING DIGI BEACON", 0);
seventhLine = " listening...";
STATION_Utils::addToOutputPacketBuffer(secondaryBeaconPacket);
STATION_Utils::addToOutputPacketBuffer(secondaryBeaconPacket, true);
}
lastBeaconTx = millis();
@@ -436,4 +436,11 @@ namespace Utils {
return true;
}
void startupDelay() {
if (Config.startupDelay > 0) {
displayShow("", " STARTUP DELAY ...", "", "", 0);
delay(Config.startupDelay * 60 * 1000);
}
}
}

View File

@@ -157,6 +157,8 @@ namespace WEB_Utils {
Config.wifiAPs.push_back(wifiap);
}
Config.startupDelay = getParamIntSafe("startupDelay", Config.startupDelay);
Config.callsign = getParamStringSafe("callsign", Config.callsign);
Config.wifiAutoAP.password = getParamStringSafe("wifi.autoAP.password", Config.wifiAutoAP.password);
@@ -196,6 +198,7 @@ namespace WEB_Utils {
Config.digi.mode = getParamIntSafe("digi.mode", Config.digi.mode);
Config.digi.ecoMode = getParamIntSafe("digi.ecoMode", Config.digi.ecoMode);
Config.digi.beaconOnRxFreq = request->hasParam("digi.beaconOnRxFreq", true);
Config.loramodule.txFreq = getParamIntSafe("lora.txFreq", Config.loramodule.txFreq);
Config.loramodule.rxFreq = getParamIntSafe("lora.rxFreq", Config.loramodule.rxFreq);
@@ -261,6 +264,7 @@ namespace WEB_Utils {
Config.mqtt.username = getParamStringSafe("mqtt.username", Config.mqtt.username);
Config.mqtt.password = getParamStringSafe("mqtt.password", Config.mqtt.password);
Config.mqtt.port = getParamIntSafe("mqtt.port", Config.mqtt.port);
Config.mqtt.beaconOverMqtt = request->hasParam("mqtt.beaconOverMqtt", true);
}
@@ -281,6 +285,7 @@ namespace WEB_Utils {
Config.remoteManagement.managers = getParamStringSafe("remoteManagement.managers", Config.remoteManagement.managers);
Config.remoteManagement.rfOnly = request->hasParam("remoteManagement.rfOnly", true);
Config.ntp.server = getParamStringSafe("ntp.server", Config.ntp.server);
Config.ntp.gmtCorrection = getParamFloatSafe("ntp.gmtCorrection", Config.ntp.gmtCorrection);
Config.rememberStationTime = getParamIntSafe("other.rememberStationTime", Config.rememberStationTime);

View File

@@ -0,0 +1,55 @@
/* Copyright (C) 2025 Ricardo Guzman - CA2RXU
*
* This file is part of LoRa APRS iGate.
*
* LoRa APRS iGate is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LoRa APRS iGate is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LoRa APRS iGate. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef BOARD_PINOUT_H_
#define BOARD_PINOUT_H_
// LoRa Radio
#define HAS_SX1276
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 27
#define RADIO_CS_PIN 18
#define RADIO_RST_PIN 14
#define RADIO_BUSY_PIN 26
#define RADIO_WAKEUP_PIN RADIO_BUSY_PIN
#define GPIO_WAKEUP_PIN GPIO_SEL_26
// I2C
#define USE_WIRE_WITH_OLED_PINS
// 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
// Aditional Config
#define INTERNAL_LED_PIN 16
/*
Green LED (Lora): PIN 22 / GPIO2
Yellow LED (Wifi): PIN 23 / GPIO0
Blue LED (BT/BLE): PIN 25 / GPIO16
*/
#endif

View File

@@ -0,0 +1,8 @@
[env:heltec_wireless_bridge]
board = esp32dev
build_flags =
${common.build_flags}
-D HELTEC_WIRELESS_BRIDGE
lib_deps =
${common.lib_deps}
${common.display_libs}