mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-07-13 21:31:14 +02:00
Compare commits
9 Commits
UEM6
...
QRP-LG-Plus
| Author | SHA1 | Date | |
|---|---|---|---|
| 194ae94a43 | |||
| 9baf066386 | |||
| 7595da21cd | |||
| 6be28b47ce | |||
| 3ea1a19a06 | |||
| 35cafac601 | |||
| b59153d8df | |||
| 79b967034f | |||
| a40502344f |
@@ -8,10 +8,10 @@ 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);
|
||||||
|
|
||||||
String buildPacketToUpload(const String& packet);
|
String buildPacketToUpload(const String& packet);
|
||||||
bool processReceivedLoRaMessage(const String& sender, const String& packet, bool thirdParty);
|
bool processReceivedLoRaMessage(const String& sender, const String& packet, bool thirdParty);
|
||||||
void processLoRaPacket(const String& packet);
|
void processLoRaPacket(const String& packet);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace BATTERY_Utils {
|
|||||||
|
|
||||||
void adcCalibration();
|
void adcCalibration();
|
||||||
void adcCalibrationCheck();
|
void adcCalibrationCheck();
|
||||||
|
|
||||||
void setup();
|
void setup();
|
||||||
float checkInternalVoltage();
|
float checkInternalVoltage();
|
||||||
float checkExternalVoltage();
|
float checkExternalVoltage();
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ public:
|
|||||||
WEBADMIN webadmin;
|
WEBADMIN webadmin;
|
||||||
NTP ntp;
|
NTP ntp;
|
||||||
REMOTE_MANAGEMENT remoteManagement;
|
REMOTE_MANAGEMENT remoteManagement;
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
void writeFile();
|
void writeFile();
|
||||||
Configuration();
|
Configuration();
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ namespace LoRa_Utils {
|
|||||||
void changeFreqTx();
|
void changeFreqTx();
|
||||||
void changeFreqRx();
|
void changeFreqRx();
|
||||||
void wakeRadio();
|
void wakeRadio();
|
||||||
//void startReceive();
|
|
||||||
void sleepRadio();
|
void sleepRadio();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ namespace TNC_Utils {
|
|||||||
|
|
||||||
void setup();
|
void setup();
|
||||||
void loop();
|
void loop();
|
||||||
|
|
||||||
void sendToClients(const String& packet);
|
void sendToClients(const String& packet);
|
||||||
void sendToSerial(const String& packet);
|
void sendToSerial(const String& packet);
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace WIFI_Utils {
|
|||||||
void startWiFi();
|
void startWiFi();
|
||||||
void checkAutoAPTimeout();
|
void checkAutoAPTimeout();
|
||||||
void setup();
|
void setup();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
+2
-1
@@ -129,7 +129,7 @@
|
|||||||
delayATMessage = 0;
|
delayATMessage = 0;
|
||||||
} else if (ATMessage.indexOf(Config.callsign) >= 3 && !modemLoggedToAPRSIS && response.indexOf("OK") >= 0 && !stationBeacon) { // login info
|
} else if (ATMessage.indexOf(Config.callsign) >= 3 && !modemLoggedToAPRSIS && response.indexOf("OK") >= 0 && !stationBeacon) { // login info
|
||||||
validAT = true;
|
validAT = true;
|
||||||
delayATMessage = 0;
|
delayATMessage = 0;
|
||||||
} else if (ATMessage.indexOf(Config.callsign) == 0 && !beaconSended && response.indexOf("OK") >= 0 && !stationBeacon) { // self beacon or querys
|
} else if (ATMessage.indexOf(Config.callsign) == 0 && !beaconSended && response.indexOf("OK") >= 0 && !stationBeacon) { // self beacon or querys
|
||||||
validAT = true;
|
validAT = true;
|
||||||
i = 1;
|
i = 1;
|
||||||
@@ -203,4 +203,5 @@
|
|||||||
delay(1);
|
delay(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -48,7 +48,7 @@ ___________________________________________________________________*/
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
String versionDate = "2025-05-12";
|
String versionDate = "2025-05-18";
|
||||||
Configuration Config;
|
Configuration Config;
|
||||||
WiFiClient espClient;
|
WiFiClient espClient;
|
||||||
#ifdef HAS_GPS
|
#ifdef HAS_GPS
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ uint32_t lastRxTime = millis();
|
|||||||
bool passcodeValid = false;
|
bool passcodeValid = false;
|
||||||
|
|
||||||
#ifdef HAS_A7670
|
#ifdef HAS_A7670
|
||||||
extern bool stationBeacon;
|
extern bool stationBeacon;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ namespace APRS_IS_Utils {
|
|||||||
aprsAuth += Config.callsign;
|
aprsAuth += Config.callsign;
|
||||||
aprsAuth += " pass ";
|
aprsAuth += " pass ";
|
||||||
aprsAuth += Config.aprs_is.passcode;
|
aprsAuth += Config.aprs_is.passcode;
|
||||||
aprsAuth += " vers CA2RXU_iGate 2.3 filter ";
|
aprsAuth += " vers CA2RXU_iGate 3.0 filter ";
|
||||||
aprsAuth += Config.aprs_is.filter;
|
aprsAuth += Config.aprs_is.filter;
|
||||||
upload(aprsAuth);
|
upload(aprsAuth);
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ namespace APRS_IS_Utils {
|
|||||||
wifiState = "--";
|
wifiState = "--";
|
||||||
} else {
|
} else {
|
||||||
wifiState = "AP";
|
wifiState = "AP";
|
||||||
}
|
}
|
||||||
if (!Config.display.alwaysOn && Config.display.timeout != 0) {
|
if (!Config.display.alwaysOn && Config.display.timeout != 0) {
|
||||||
displayToggle(true);
|
displayToggle(true);
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ namespace APRS_IS_Utils {
|
|||||||
ackMessage.concat(packet.substring(packet.indexOf("{") + 1));
|
ackMessage.concat(packet.substring(packet.indexOf("{") + 1));
|
||||||
ackMessage.trim();
|
ackMessage.trim();
|
||||||
//Serial.println(ackMessage);
|
//Serial.println(ackMessage);
|
||||||
|
|
||||||
String addToBuffer = Config.callsign;
|
String addToBuffer = Config.callsign;
|
||||||
addToBuffer += ">APLRG1";
|
addToBuffer += ">APLRG1";
|
||||||
if (!thirdParty) addToBuffer += ",RFONLY";
|
if (!thirdParty) addToBuffer += ",RFONLY";
|
||||||
|
|||||||
@@ -157,7 +157,12 @@ namespace BATTERY_Utils {
|
|||||||
return (2 * (sampleSum/100) * adcReadingTransformation) + voltageDividerCorrection; // raw voltage without mapping
|
return (2 * (sampleSum/100) * adcReadingTransformation) + voltageDividerCorrection; // raw voltage without mapping
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
return (2 * (sampleSum/100) * adcReadingTransformation) + voltageDividerCorrection; // raw voltage without mapping
|
#ifdef LIGHTGATEWAY_PLUS_1_0
|
||||||
|
double inputDivider = (1.0 / (560.0 + 100.0)) * 100.0; // The voltage divider is a 560k + 100k resistor in series, 100k on the low side.
|
||||||
|
return (((sampleSum/100) * adcReadingTransformation) / inputDivider) + 0.41;
|
||||||
|
#else
|
||||||
|
return (2 * (sampleSum/100) * adcReadingTransformation) + voltageDividerCorrection; // raw voltage without mapping
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
// return mapVoltage(voltage, 3.34, 4.71, 3.0, 4.2); // mapped voltage
|
// return mapVoltage(voltage, 3.34, 4.71, 3.0, 4.2); // mapped voltage
|
||||||
@@ -246,9 +251,7 @@ namespace BATTERY_Utils {
|
|||||||
String telemetry = "|";
|
String telemetry = "|";
|
||||||
telemetry += generateEncodedTelemetryBytes(telemetryCounter, true, 0);
|
telemetry += generateEncodedTelemetryBytes(telemetryCounter, true, 0);
|
||||||
telemetryCounter++;
|
telemetryCounter++;
|
||||||
if (telemetryCounter == 1000) {
|
if (telemetryCounter == 1000) telemetryCounter = 0;
|
||||||
telemetryCounter = 0;
|
|
||||||
}
|
|
||||||
if (Config.battery.sendInternalVoltage) telemetry += generateEncodedTelemetryBytes(checkInternalVoltage(), false, 0);
|
if (Config.battery.sendInternalVoltage) telemetry += generateEncodedTelemetryBytes(checkInternalVoltage(), false, 0);
|
||||||
if (Config.battery.sendExternalVoltage) telemetry += generateEncodedTelemetryBytes(checkExternalVoltage(), false, 1);
|
if (Config.battery.sendExternalVoltage) telemetry += generateEncodedTelemetryBytes(checkExternalVoltage(), false, 1);
|
||||||
telemetry += "|";
|
telemetry += "|";
|
||||||
|
|||||||
+1
-1
@@ -116,7 +116,7 @@ namespace DIGI_Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void processLoRaPacket(const String& packet) {
|
void processLoRaPacket(const String& packet) {
|
||||||
if (packet.indexOf("NOGATE") == -1) {
|
if (packet.indexOf("NOGATE") == -1) {
|
||||||
bool thirdPartyPacket = false;
|
bool thirdPartyPacket = false;
|
||||||
String temp, Sender;
|
String temp, Sender;
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern Configuration Config;
|
extern Configuration Config;
|
||||||
|
|
||||||
bool displayFound = false;
|
bool displayFound = false;
|
||||||
|
|||||||
+1
-1
@@ -101,7 +101,7 @@ namespace GPS_Utils {
|
|||||||
}
|
}
|
||||||
generateBeaconFirstPart();
|
generateBeaconFirstPart();
|
||||||
String encodedGPS = encodeGPS(Config.beacon.latitude, Config.beacon.longitude, Config.beacon.overlay, Config.beacon.symbol);
|
String encodedGPS = encodeGPS(Config.beacon.latitude, Config.beacon.longitude, Config.beacon.overlay, Config.beacon.symbol);
|
||||||
iGateBeaconPacket += encodedGPS;
|
iGateBeaconPacket += encodedGPS;
|
||||||
iGateLoRaBeaconPacket += encodedGPS;
|
iGateLoRaBeaconPacket += encodedGPS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -22,7 +22,7 @@ bool transmitFlag = true;
|
|||||||
SX1262 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
|
SX1262 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_SX1268
|
#ifdef HAS_SX1268
|
||||||
#if defined(LIGHTGATEWAY_1_0)
|
#if defined(LIGHTGATEWAY_1_0) || defined(LIGHTGATEWAY_PLUS_1_0)
|
||||||
SPIClass loraSPI(FSPI);
|
SPIClass loraSPI(FSPI);
|
||||||
SX1268 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN, loraSPI);
|
SX1268 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN, loraSPI);
|
||||||
#else
|
#else
|
||||||
@@ -50,7 +50,7 @@ namespace LoRa_Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
#ifdef LIGHTGATEWAY_1_0
|
#if defined (LIGHTGATEWAY_1_0) || defined(LIGHTGATEWAY_PLUS_1_0)
|
||||||
pinMode(RADIO_VCC_PIN,OUTPUT);
|
pinMode(RADIO_VCC_PIN,OUTPUT);
|
||||||
digitalWrite(RADIO_VCC_PIN,HIGH);
|
digitalWrite(RADIO_VCC_PIN,HIGH);
|
||||||
loraSPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN, RADIO_CS_PIN);
|
loraSPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN, RADIO_CS_PIN);
|
||||||
@@ -80,7 +80,7 @@ namespace LoRa_Utils {
|
|||||||
radio.setCodingRate(Config.loramodule.codingRate4);
|
radio.setCodingRate(Config.loramodule.codingRate4);
|
||||||
radio.setCRC(true);
|
radio.setCRC(true);
|
||||||
|
|
||||||
#if (defined(RADIO_RXEN) && defined(RADIO_TXEN)) || defined(LIGHTGATEWAY_1_0) // QRP Labs LightGateway has 400M22S (SX1268)
|
#if (defined(RADIO_RXEN) && defined(RADIO_TXEN)) // QRP Labs LightGateway has 400M22S (SX1268)
|
||||||
radio.setRfSwitchPins(RADIO_RXEN, RADIO_TXEN);
|
radio.setRfSwitchPins(RADIO_RXEN, RADIO_TXEN);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ namespace LoRa_Utils {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
packet = "";
|
packet = "";
|
||||||
}
|
}
|
||||||
lastRxTime = millis();
|
lastRxTime = millis();
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -14,14 +14,14 @@ unsigned long ota_progress_millis = 0;
|
|||||||
|
|
||||||
|
|
||||||
namespace OTA_Utils {
|
namespace OTA_Utils {
|
||||||
|
|
||||||
void setup(AsyncWebServer *server) {
|
void setup(AsyncWebServer *server) {
|
||||||
if (Config.ota.username != "" && Config.ota.password != "") {
|
if (Config.ota.username != "" && Config.ota.password != "") {
|
||||||
ElegantOTA.begin(server, Config.ota.username.c_str(), Config.ota.password.c_str());
|
ElegantOTA.begin(server, Config.ota.username.c_str(), Config.ota.password.c_str());
|
||||||
} else {
|
} else {
|
||||||
ElegantOTA.begin(server);
|
ElegantOTA.begin(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
ElegantOTA.setAutoReboot(true);
|
ElegantOTA.setAutoReboot(true);
|
||||||
ElegantOTA.onStart(onOTAStart);
|
ElegantOTA.onStart(onOTAStart);
|
||||||
ElegantOTA.onProgress(onOTAProgress);
|
ElegantOTA.onProgress(onOTAProgress);
|
||||||
@@ -55,8 +55,8 @@ namespace OTA_Utils {
|
|||||||
|
|
||||||
Serial.println(success ? "OTA update finished successfully!" : "There was an error during OTA update!");
|
Serial.println(success ? "OTA update finished successfully!" : "There was an error during OTA update!");
|
||||||
displayShow("", "", statusMessage, "", rebootMessage, "", "", 4000);
|
displayShow("", "", statusMessage, "", rebootMessage, "", "", 4000);
|
||||||
|
|
||||||
isUpdatingOTA = false;
|
isUpdatingOTA = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+3
-3
@@ -232,7 +232,7 @@ namespace POWER_Utils {
|
|||||||
digitalWrite(VEXT_CTRL, Config.digi.ecoMode == 1 ? HIGH : LOW);
|
digitalWrite(VEXT_CTRL, Config.digi.ecoMode == 1 ? HIGH : LOW);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_GPS
|
#ifdef HAS_GPS
|
||||||
if (Config.beacon.gpsActive && Config.digi.ecoMode != 1) activateGPS();
|
if (Config.beacon.gpsActive && Config.digi.ecoMode != 1) activateGPS();
|
||||||
#endif
|
#endif
|
||||||
@@ -251,7 +251,7 @@ 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_V3_2) || defined(HELTEC_WS) || defined(LIGHTGATEWAY_1_0) || defined(TTGO_LORA32_T3S3_V1_2) || defined(HELTEC_V2)
|
#if defined(HELTEC_V3) || defined(HELTEC_V3_2) || defined(HELTEC_WS) || defined(LIGHTGATEWAY_1_0) || defined(LIGHTGATEWAY_PLUS_1_0) || defined(TTGO_LORA32_T3S3_V1_2) || defined(HELTEC_V2)
|
||||||
Wire.begin(OLED_SDA, OLED_SCL);
|
Wire.begin(OLED_SDA, OLED_SCL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -274,7 +274,7 @@ namespace POWER_Utils {
|
|||||||
delay(500);
|
delay(500);
|
||||||
Wire.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
|
Wire.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
BATTERY_Utils::setup();
|
BATTERY_Utils::setup();
|
||||||
BATTERY_Utils::startupBatteryHealth();
|
BATTERY_Utils::startupBatteryHealth();
|
||||||
|
|||||||
+2
-2
@@ -24,7 +24,7 @@ namespace QUERY_Utils {
|
|||||||
if (queryQuestion == "?APRS?" || queryQuestion == "H" || queryQuestion == "HELP" || queryQuestion=="?") {
|
if (queryQuestion == "?APRS?" || queryQuestion == "H" || queryQuestion == "HELP" || queryQuestion=="?") {
|
||||||
answer.concat("?APRSV ?APRSP ?APRSL ?APRSSSR ?EM=? ?TX=? "); // ?APRSH ?WHERE callsign
|
answer.concat("?APRSV ?APRSP ?APRSL ?APRSSSR ?EM=? ?TX=? "); // ?APRSH ?WHERE callsign
|
||||||
} else if (queryQuestion == "?APRSV") {
|
} else if (queryQuestion == "?APRSV") {
|
||||||
answer.concat("CA2RXU_LoRa_iGate 2.3 v");
|
answer.concat("CA2RXU_LoRa_iGate 3.0 v");
|
||||||
answer.concat(versionDate);
|
answer.concat(versionDate);
|
||||||
} else if (queryQuestion == "?APRSP") {
|
} else if (queryQuestion == "?APRSP") {
|
||||||
answer.concat("iGate QTH: ");
|
answer.concat("iGate QTH: ");
|
||||||
@@ -113,7 +113,7 @@ namespace QUERY_Utils {
|
|||||||
Config.writeFile();
|
Config.writeFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (answer == "") return "";
|
if (answer == "") return "";
|
||||||
|
|
||||||
String queryAnswer = Config.callsign;
|
String queryAnswer = Config.callsign;
|
||||||
|
|||||||
+2
-3
@@ -27,12 +27,12 @@ namespace SLEEP_Utils {
|
|||||||
wakeUpFlag = false;
|
wakeUpFlag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
if (Config.digi.ecoMode == 1) {
|
if (Config.digi.ecoMode == 1) {
|
||||||
pinMode(RADIO_WAKEUP_PIN, INPUT);
|
pinMode(RADIO_WAKEUP_PIN, INPUT);
|
||||||
attachInterrupt(digitalPinToInterrupt(RADIO_WAKEUP_PIN), wakeUpLoRaPacketReceived, RISING);
|
attachInterrupt(digitalPinToInterrupt(RADIO_WAKEUP_PIN), wakeUpLoRaPacketReceived, RISING);
|
||||||
#if defined(TTGO_LORA32_V2_1) || defined(TTGO_LORA32_V2_1_915) || defined(TTGO_LORA32_T3S3_V1_2) || defined(TTGO_T_BEAM_V1_0) || defined(TTGO_T_BEAM_V1_0_915) || defined(TTGO_T_BEAM_V1_0_SX1268) || defined(TTGO_T_BEAM_V1_2) || defined(TTGO_T_BEAM_V1_2_915) || defined(TTGO_T_BEAM_V1_2_SX1262) || defined(TTGO_T_DECK_PLUS) || defined(TTGO_T_DECK_GPS) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3) || defined(HELTEC_V3_2) || defined(HELTEC_WP) || defined(HELTEC_WS) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY) || defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_V2) || defined(XIAO_ESP32S3_LORA) || defined(LIGHTGATEWAY_1_0) || defined(TROY_LoRa_APRS) || defined(OE5HWN_MeshCom) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_LoRa_915) || defined(ESP32_DIY_1W_LoRa) || defined(ESP32_DIY_1W_LoRa_915) || defined(ESP32_DIY_1W_LoRa_LLCC68) || defined(ESP32_DIY_1W_LoRa_Mesh_V1_2) || defined(WEMOS_S2_MINI_DIY_LoRa) || defined(WEMOS_D1_R32_RA02) || defined(WEMOS_LOLIN32_OLED_DIY_LoRa)
|
#if defined(TTGO_LORA32_V2_1) || defined(TTGO_LORA32_V2_1_915) || defined(TTGO_LORA32_T3S3_V1_2) || defined(TTGO_T_BEAM_V1_0) || defined(TTGO_T_BEAM_V1_0_915) || defined(TTGO_T_BEAM_V1_0_SX1268) || defined(TTGO_T_BEAM_V1_2) || defined(TTGO_T_BEAM_V1_2_915) || defined(TTGO_T_BEAM_V1_2_SX1262) || defined(TTGO_T_DECK_PLUS) || defined(TTGO_T_DECK_GPS) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3) || defined(HELTEC_V3_2) || defined(HELTEC_WP) || defined(HELTEC_WS) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY) || defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_V2) || defined(XIAO_ESP32S3_LORA) || defined(LIGHTGATEWAY_1_0) || defined(LIGHTGATEWAY_PLUS_1_0) || defined(TROY_LoRa_APRS) || defined(OE5HWN_MeshCom) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_LoRa_915) || defined(ESP32_DIY_1W_LoRa) || defined(ESP32_DIY_1W_LoRa_915) || defined(ESP32_DIY_1W_LoRa_LLCC68) || defined(ESP32_DIY_1W_LoRa_Mesh_V1_2) || defined(WEMOS_S2_MINI_DIY_LoRa) || defined(WEMOS_D1_R32_RA02) || defined(WEMOS_LOLIN32_OLED_DIY_LoRa)
|
||||||
esp_sleep_enable_ext1_wakeup(GPIO_WAKEUP_PIN, ESP_EXT1_WAKEUP_ANY_HIGH);
|
esp_sleep_enable_ext1_wakeup(GPIO_WAKEUP_PIN, ESP_EXT1_WAKEUP_ANY_HIGH);
|
||||||
#endif
|
#endif
|
||||||
#if defined(HELTEC_HTCT62) || defined(ESP32C3_DIY_1W_LoRa) || defined(ESP32C3_DIY_1W_LoRa_915) || defined(ESP32_C3_OctopusLab_LoRa)
|
#if defined(HELTEC_HTCT62) || defined(ESP32C3_DIY_1W_LoRa) || defined(ESP32C3_DIY_1W_LoRa_915) || defined(ESP32_C3_OctopusLab_LoRa)
|
||||||
@@ -56,7 +56,6 @@ namespace SLEEP_Utils {
|
|||||||
LoRa_Utils::wakeRadio();
|
LoRa_Utils::wakeRadio();
|
||||||
esp_light_sleep_start();
|
esp_light_sleep_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkSerial() {
|
void checkSerial() {
|
||||||
|
|||||||
@@ -58,10 +58,10 @@ namespace STATION_Utils {
|
|||||||
if (callsign.startsWith(wildcard)) return true;
|
if (callsign.startsWith(wildcard)) return true;
|
||||||
} else {
|
} else {
|
||||||
if (list[i] == callsign) return true;
|
if (list[i] == callsign) return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isBlacklisted(const String& callsign) {
|
bool isBlacklisted(const String& callsign) {
|
||||||
return checkCallsignList(blacklist, callsign);
|
return checkCallsignList(blacklist, callsign);
|
||||||
@@ -94,7 +94,7 @@ namespace STATION_Utils {
|
|||||||
lastHeardObjects.emplace_back(LastHeardStation{millis(), object}); // Add new object and Tx
|
lastHeardObjects.emplace_back(LastHeardStation{millis(), object}); // Add new object and Tx
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
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++) {
|
||||||
@@ -149,13 +149,13 @@ namespace STATION_Utils {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void processOutputPacketBufferUltraEcoMode() {
|
void processOutputPacketBufferUltraEcoMode() {
|
||||||
size_t currentIndex = 0;
|
size_t currentIndex = 0;
|
||||||
while (currentIndex < outputPacketBuffer.size()) { // this sends all packets from output buffer
|
while (currentIndex < outputPacketBuffer.size()) { // this sends all packets from output buffer
|
||||||
delay(3000); // and cleans buffer to avoid sending packets with time offset
|
delay(3000); // and cleans buffer to avoid sending packets with time offset
|
||||||
LoRa_Utils::sendNewPacket(outputPacketBuffer[currentIndex]); // next time it wakes up
|
LoRa_Utils::sendNewPacket(outputPacketBuffer[currentIndex]); // next time it wakes up
|
||||||
currentIndex++;
|
currentIndex++;
|
||||||
}
|
}
|
||||||
outputPacketBuffer.clear();
|
outputPacketBuffer.clear();
|
||||||
//
|
//
|
||||||
if (saveNewDigiEcoModeConfig) {
|
if (saveNewDigiEcoModeConfig) {
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ namespace SYSLOG_Utils {
|
|||||||
if (Config.syslog.active && WiFi.status() == WL_CONNECTED) {
|
if (Config.syslog.active && WiFi.status() == WL_CONNECTED) {
|
||||||
String syslogPacket = "<165>1 - ";
|
String syslogPacket = "<165>1 - ";
|
||||||
syslogPacket.concat(Config.callsign);
|
syslogPacket.concat(Config.callsign);
|
||||||
syslogPacket.concat(" CA2RXU_LoRa_iGate_1.3 - - - "); //RFC5424 The Syslog Protocol
|
syslogPacket.concat(" CA2RXU_LoRa_iGate_3.0 - - - "); //RFC5424 The Syslog Protocol
|
||||||
|
|
||||||
char signalData[35];
|
char signalData[35];
|
||||||
snprintf(signalData, sizeof(signalData), " / %ddBm / %.2fdB / %dHz", rssi, snr, freqError);
|
snprintf(signalData, sizeof(signalData), " / %ddBm / %.2fdB / %dHz", rssi, snr, freqError);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ namespace TNC_Utils {
|
|||||||
void handleInputData(char character, int bufferIndex) {
|
void handleInputData(char character, int bufferIndex) {
|
||||||
String* data = (bufferIndex == -1) ? &inputSerialBuffer : &inputServerBuffer[bufferIndex];
|
String* data = (bufferIndex == -1) ? &inputSerialBuffer : &inputServerBuffer[bufferIndex];
|
||||||
if (data->length() == 0 && character != (char)FEND) return;
|
if (data->length() == 0 && character != (char)FEND) return;
|
||||||
|
|
||||||
data->concat(character);
|
data->concat(character);
|
||||||
|
|
||||||
if (character == (char)FEND && data->length() > 3) {
|
if (character == (char)FEND && data->length() > 3) {
|
||||||
|
|||||||
+2
-2
@@ -189,7 +189,7 @@ namespace Utils {
|
|||||||
void checkBeaconInterval() {
|
void checkBeaconInterval() {
|
||||||
uint32_t lastTx = millis() - lastBeaconTx;
|
uint32_t lastTx = millis() - lastBeaconTx;
|
||||||
if (lastBeaconTx == 0 || lastTx >= Config.beacon.interval * 60 * 1000) {
|
if (lastBeaconTx == 0 || lastTx >= Config.beacon.interval * 60 * 1000) {
|
||||||
beaconUpdate = true;
|
beaconUpdate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAS_GPS
|
#ifdef HAS_GPS
|
||||||
@@ -229,7 +229,7 @@ namespace Utils {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (Config.wxsensor.active) {
|
if (Config.wxsensor.active) {
|
||||||
const char* sensorData = (wxModuleType == 0) ? ".../...g...t..." : WX_Utils::readDataSensor().c_str();
|
String sensorData = (wxModuleType == 0) ? ".../...g...t..." : WX_Utils::readDataSensor();
|
||||||
beaconPacket += sensorData;
|
beaconPacket += sensorData;
|
||||||
secondaryBeaconPacket += sensorData;
|
secondaryBeaconPacket += sensorData;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -115,7 +115,7 @@ namespace WEB_Utils {
|
|||||||
|
|
||||||
Config.wifiAutoAP.password = request->getParam("wifi.autoAP.password", true)->value();
|
Config.wifiAutoAP.password = request->getParam("wifi.autoAP.password", true)->value();
|
||||||
Config.wifiAutoAP.timeout = request->getParam("wifi.autoAP.timeout", true)->value().toInt();
|
Config.wifiAutoAP.timeout = request->getParam("wifi.autoAP.timeout", true)->value().toInt();
|
||||||
|
|
||||||
|
|
||||||
Config.aprs_is.active = request->hasParam("aprs_is.active", true);
|
Config.aprs_is.active = request->hasParam("aprs_is.active", true);
|
||||||
Config.aprs_is.passcode = request->getParam("aprs_is.passcode", true)->value();
|
Config.aprs_is.passcode = request->getParam("aprs_is.passcode", true)->value();
|
||||||
@@ -175,7 +175,7 @@ namespace WEB_Utils {
|
|||||||
Config.battery.externalSleepVoltage = request->getParam("battery.externalSleepVoltage", true)->value().toFloat();
|
Config.battery.externalSleepVoltage = request->getParam("battery.externalSleepVoltage", true)->value().toFloat();
|
||||||
|
|
||||||
Config.battery.sendVoltageAsTelemetry = request->hasParam("battery.sendVoltageAsTelemetry", true);
|
Config.battery.sendVoltageAsTelemetry = request->hasParam("battery.sendVoltageAsTelemetry", true);
|
||||||
|
|
||||||
Config.wxsensor.active = request->hasParam("wxsensor.active", true);
|
Config.wxsensor.active = request->hasParam("wxsensor.active", true);
|
||||||
Config.wxsensor.heightCorrection = request->getParam("wxsensor.heightCorrection", true)->value().toInt();
|
Config.wxsensor.heightCorrection = request->getParam("wxsensor.heightCorrection", true)->value().toInt();
|
||||||
Config.wxsensor.temperatureCorrection = request->getParam("wxsensor.temperatureCorrection", true)->value().toFloat();
|
Config.wxsensor.temperatureCorrection = request->getParam("wxsensor.temperatureCorrection", true)->value().toFloat();
|
||||||
|
|||||||
+54
-23
@@ -1,4 +1,7 @@
|
|||||||
#include <TinyGPS++.h>
|
#include <TinyGPS++.h>
|
||||||
|
#ifdef LIGHTGATEWAY_PLUS_1_0
|
||||||
|
#include "Adafruit_SHTC3.h"
|
||||||
|
#endif
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "board_pinout.h"
|
#include "board_pinout.h"
|
||||||
#include "wx_utils.h"
|
#include "wx_utils.h"
|
||||||
@@ -23,11 +26,14 @@ float newHum, newTemp, newPress, newGas;
|
|||||||
Adafruit_BME280 bme280;
|
Adafruit_BME280 bme280;
|
||||||
#if defined(HELTEC_V3) || defined(HELTEC_V3_2)
|
#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
|
||||||
Adafruit_BMP280 bmp280;
|
Adafruit_BMP280 bmp280;
|
||||||
Adafruit_BME680 bme680;
|
Adafruit_BME680 bme680;
|
||||||
Adafruit_Si7021 sensor = Adafruit_Si7021();
|
Adafruit_Si7021 si7021 = Adafruit_Si7021();
|
||||||
|
#endif
|
||||||
|
#ifdef LIGHTGATEWAY_PLUS_1_0
|
||||||
|
Adafruit_SHTC3 shtc3 = Adafruit_SHTC3();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -41,16 +47,23 @@ namespace WX_Utils {
|
|||||||
err = Wire1.endTransmission();
|
err = Wire1.endTransmission();
|
||||||
#else
|
#else
|
||||||
Wire.beginTransmission(addr);
|
Wire.beginTransmission(addr);
|
||||||
|
#ifdef LIGHTGATEWAY_PLUS_1_0
|
||||||
|
Wire.write(0x35);
|
||||||
|
Wire.write(0x17);
|
||||||
|
#endif
|
||||||
err = Wire.endTransmission();
|
err = Wire.endTransmission();
|
||||||
#endif
|
#endif
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
//Serial.println(addr); this shows any connected board to I2C
|
//Serial.println(addr); //this shows any connected board to I2C
|
||||||
if (addr == 0x76 || addr == 0x77) { // BME/BMP
|
if (addr == 0x76 || addr == 0x77) { // BME or BMP
|
||||||
wxModuleAddress = addr;
|
wxModuleAddress = addr;
|
||||||
return;
|
return;
|
||||||
} else if (addr == 0x40) { // Si7011
|
} else if (addr == 0x40) { // Si7011
|
||||||
wxModuleAddress = addr;
|
wxModuleAddress = addr;
|
||||||
return;
|
return;
|
||||||
|
} else if (addr == 0x70) { // SHTC3
|
||||||
|
wxModuleAddress = addr;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,40 +78,49 @@ namespace WX_Utils {
|
|||||||
#if defined(HELTEC_V3) || defined(HELTEC_V3_2) || 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;
|
||||||
wxModuleFound = true;
|
wxModuleFound = true;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (bme280.begin(wxModuleAddress)) {
|
if (bme280.begin(wxModuleAddress)) {
|
||||||
Serial.println("BME280 sensor found");
|
Serial.println("BME280 sensor found");
|
||||||
wxModuleType = 1;
|
wxModuleType = 1;
|
||||||
wxModuleFound = true;
|
wxModuleFound = true;
|
||||||
}
|
}
|
||||||
if (!wxModuleFound) {
|
if (!wxModuleFound) {
|
||||||
if (bme680.begin(wxModuleAddress)) {
|
if (bme680.begin(wxModuleAddress)) {
|
||||||
Serial.println("BME680 sensor found");
|
Serial.println("BME680 sensor found");
|
||||||
wxModuleType = 3;
|
wxModuleType = 3;
|
||||||
wxModuleFound = true;
|
wxModuleFound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!wxModuleFound) {
|
if (!wxModuleFound) {
|
||||||
if (bmp280.begin(wxModuleAddress)) {
|
if (bmp280.begin(wxModuleAddress)) {
|
||||||
Serial.println("BMP280 sensor found");
|
Serial.println("BMP280 sensor found");
|
||||||
wxModuleType = 2;
|
wxModuleType = 2;
|
||||||
wxModuleFound = true;
|
wxModuleFound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (wxModuleAddress == 0x40) {
|
} else if (wxModuleAddress == 0x40) {
|
||||||
if(sensor.begin()) {
|
if(si7021.begin()) {
|
||||||
Serial.println("Si7021 sensor found");
|
Serial.println("Si7021 sensor found");
|
||||||
wxModuleType = 4;
|
wxModuleType = 4;
|
||||||
wxModuleFound = true;
|
wxModuleFound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef LIGHTGATEWAY_PLUS_1_0
|
||||||
|
else if (wxModuleAddress == 0x70) {
|
||||||
|
if (shtc3.begin()) {
|
||||||
|
Serial.println("SHTC3 sensor found");
|
||||||
|
wxModuleType = 5;
|
||||||
|
wxModuleFound = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!wxModuleFound) {
|
if (!wxModuleFound) {
|
||||||
displayShow("ERROR", "", "BME/BMP/Si7021 sensor active", "but no sensor found...", 2000);
|
displayShow("ERROR", "", "BME/BMP/Si7021/SHTC3 sensor active", "but no sensor found...", 2000);
|
||||||
Serial.println("BME/BMP/Si7021 sensor Active in config but not found! Check Wiring");
|
Serial.println("BME/BMP/Si7021/SHTC3 sensor Active in config but not found! Check Wiring");
|
||||||
} else {
|
} else {
|
||||||
switch (wxModuleType) {
|
switch (wxModuleType) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -211,9 +233,18 @@ namespace WX_Utils {
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case 4: // Si7021
|
case 4: // Si7021
|
||||||
newTemp = sensor.readTemperature();
|
newTemp = si7021.readTemperature();
|
||||||
|
newHum = si7021.readHumidity();
|
||||||
newPress = 0;
|
newPress = 0;
|
||||||
newHum = sensor.readHumidity();
|
break;
|
||||||
|
case 5: // SHTC3
|
||||||
|
#ifdef LIGHTGATEWAY_PLUS_1_0
|
||||||
|
sensors_event_t humidity, temp;
|
||||||
|
shtc3.getEvent(&humidity, &temp);
|
||||||
|
newTemp = temp.temperature;
|
||||||
|
newHum = humidity.relative_humidity;
|
||||||
|
newPress = 0;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,20 +256,20 @@ namespace WX_Utils {
|
|||||||
String tempStr = generateTempString(((newTemp + Config.wxsensor.temperatureCorrection) * 1.8) + 32);
|
String tempStr = generateTempString(((newTemp + Config.wxsensor.temperatureCorrection) * 1.8) + 32);
|
||||||
|
|
||||||
String humStr;
|
String humStr;
|
||||||
if (wxModuleType == 1 || wxModuleType == 3 || wxModuleType == 4) {
|
if (wxModuleType == 1 || wxModuleType == 3 || wxModuleType == 4 || wxModuleType == 5) {
|
||||||
humStr = generateHumString(newHum);
|
humStr = generateHumString(newHum);
|
||||||
} else if (wxModuleType == 2) {
|
} else if (wxModuleType == 2) {
|
||||||
humStr = "..";
|
humStr = "..";
|
||||||
}
|
}
|
||||||
|
|
||||||
String presStr = (wxModuleAddress == 4)
|
String presStr = (wxModuleType == 4 || wxModuleType == 5)
|
||||||
? "....."
|
? "....."
|
||||||
#ifdef HAS_GPS
|
#ifdef HAS_GPS
|
||||||
: generatePresString(newPress + (gps.altitude.meters() / CORRECTION_FACTOR));
|
: generatePresString(newPress + (gps.altitude.meters() / CORRECTION_FACTOR));
|
||||||
#else
|
#else
|
||||||
: generatePresString(newPress + (Config.wxsensor.heightCorrection / CORRECTION_FACTOR));
|
: generatePresString(newPress + (Config.wxsensor.heightCorrection / CORRECTION_FACTOR));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fifthLine = "BME-> ";
|
fifthLine = "BME-> ";
|
||||||
fifthLine += String(int(newTemp + Config.wxsensor.temperatureCorrection));
|
fifthLine += String(int(newTemp + Config.wxsensor.temperatureCorrection));
|
||||||
fifthLine += "C ";
|
fifthLine += "C ";
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
#ifndef BOARD_PINOUT_H_
|
||||||
|
#define BOARD_PINOUT_H_
|
||||||
|
|
||||||
|
// LoRa Radio
|
||||||
|
#define HAS_SX1268
|
||||||
|
#define HAS_1W_LORA
|
||||||
|
#define RADIO_VCC_PIN 21
|
||||||
|
#define RADIO_SCLK_PIN 12
|
||||||
|
#define RADIO_MISO_PIN 13
|
||||||
|
#define RADIO_MOSI_PIN 11
|
||||||
|
#define RADIO_CS_PIN 10
|
||||||
|
#define RADIO_RST_PIN 9
|
||||||
|
#define RADIO_DIO1_PIN 5
|
||||||
|
#define RADIO_BUSY_PIN 6
|
||||||
|
#define RADIO_RXEN 42
|
||||||
|
#define RADIO_TXEN 14
|
||||||
|
#define RADIO_WAKEUP_PIN RADIO_DIO1_PIN
|
||||||
|
#define GPIO_WAKEUP_PIN GPIO_SEL_5
|
||||||
|
|
||||||
|
// Display
|
||||||
|
#define HAS_DISPLAY
|
||||||
|
|
||||||
|
#undef OLED_SDA
|
||||||
|
#undef OLED_SCL
|
||||||
|
#undef OLED_RST
|
||||||
|
|
||||||
|
#define OLED_SDA 3
|
||||||
|
#define OLED_SCL 4
|
||||||
|
#define OLED_RST -1 // Reset pin # (or -1 if sharing Arduino reset pin)
|
||||||
|
|
||||||
|
// Aditional Config
|
||||||
|
#define INTERNAL_LED_PIN 16
|
||||||
|
#define BATTERY_PIN 1
|
||||||
|
#define BUTTON_PIN 0
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
[env:QRPLabs_LightGateway_Plus_1_0]
|
||||||
|
board = esp32-s3-devkitc-1
|
||||||
|
board_build.mcu = esp32s3
|
||||||
|
build_flags =
|
||||||
|
${common.build_flags}
|
||||||
|
${common.usb_flags}
|
||||||
|
-D LIGHTGATEWAY_PLUS_1_0
|
||||||
|
lib_deps =
|
||||||
|
${common.lib_deps}
|
||||||
|
${common.display_libs}
|
||||||
|
adafruit/Adafruit SHTC3 Library @ 1.0.1
|
||||||
Reference in New Issue
Block a user