Compare commits

..

6 Commits

Author SHA1 Message Date
richonguzman
84e70afda2 no licence 2025-06-19 09:45:28 -04:00
richonguzman
46a3dc0d39 beforeLicenceChange 2025-06-19 09:44:55 -04:00
richonguzman
50b3094de9 dateUpdate 2025-06-12 23:08:46 -04:00
richonguzman
48c919f3f2 ready 2025-06-11 19:47:56 -04:00
richonguzman
5cda9a2285 HT_CT62 fixed 2025-05-18 12:22:49 -04:00
richonguzman
194ae94a43 kill white spaces 2025-05-18 08:44:46 -04:00
30 changed files with 51 additions and 101 deletions

21
LICENSE
View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2023 Ricardo Guzman (Richonguzman)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -669,13 +669,13 @@
id="digi.ecoMode"
>
<option value="0">
OFF (Normal Mode)
OFF (Normal Mode - WiFiAP enabled)
</option>
<option value="1">
Ultra Eco Mode (Sleep till Packet Rx (WiFiAP/WebUI & Display disabled))
</option>
<option value="2">
OFF (Normal Mode without WiFiAP)
OFF (Normal Mode - WiFiAP disabled)
</option>
</select>
</div>

View File

@@ -8,10 +8,10 @@ namespace APRS_IS_Utils {
void upload(const String& line);
void connect();
void checkStatus();
String checkForStartingBytes(const String& packet);
String buildPacketToUpload(const String& packet);
bool processReceivedLoRaMessage(const String& sender, const String& packet, bool thirdParty);
void processLoRaPacket(const String& packet);

View File

@@ -8,7 +8,7 @@ namespace BATTERY_Utils {
void adcCalibration();
void adcCalibrationCheck();
void setup();
float checkInternalVoltage();
float checkExternalVoltage();

View File

@@ -152,7 +152,7 @@ public:
WEBADMIN webadmin;
NTP ntp;
REMOTE_MANAGEMENT remoteManagement;
void init();
void writeFile();
Configuration();

View File

@@ -13,7 +13,6 @@ namespace LoRa_Utils {
void changeFreqTx();
void changeFreqRx();
void wakeRadio();
//void startReceive();
void sleepRadio();
}

View File

@@ -8,7 +8,7 @@ namespace TNC_Utils {
void setup();
void loop();
void sendToClients(const String& packet);
void sendToSerial(const String& packet);

View File

@@ -11,7 +11,7 @@ namespace WIFI_Utils {
void startWiFi();
void checkAutoAPTimeout();
void setup();
}
#endif

View File

@@ -129,7 +129,7 @@
delayATMessage = 0;
} else if (ATMessage.indexOf(Config.callsign) >= 3 && !modemLoggedToAPRSIS && response.indexOf("OK") >= 0 && !stationBeacon) { // login info
validAT = true;
delayATMessage = 0;
delayATMessage = 0;
} else if (ATMessage.indexOf(Config.callsign) == 0 && !beaconSended && response.indexOf("OK") >= 0 && !stationBeacon) { // self beacon or querys
validAT = true;
i = 1;
@@ -203,4 +203,5 @@
delay(1);
}
}
#endif

View File

@@ -48,7 +48,7 @@ ___________________________________________________________________*/
#endif
String versionDate = "2025-05-18";
String versionDate = "2025-06-20";
Configuration Config;
WiFiClient espClient;
#ifdef HAS_GPS

View File

@@ -28,7 +28,7 @@ uint32_t lastRxTime = millis();
bool passcodeValid = false;
#ifdef HAS_A7670
extern bool stationBeacon;
extern bool stationBeacon;
#endif
@@ -75,7 +75,7 @@ namespace APRS_IS_Utils {
wifiState = "--";
} else {
wifiState = "AP";
}
}
if (!Config.display.alwaysOn && Config.display.timeout != 0) {
displayToggle(true);
}
@@ -136,7 +136,7 @@ namespace APRS_IS_Utils {
ackMessage.concat(packet.substring(packet.indexOf("{") + 1));
ackMessage.trim();
//Serial.println(ackMessage);
String addToBuffer = Config.callsign;
addToBuffer += ">APLRG1";
if (!thirdParty) addToBuffer += ",RFONLY";

View File

@@ -116,7 +116,7 @@ namespace DIGI_Utils {
}
}
void processLoRaPacket(const String& packet) {
void processLoRaPacket(const String& packet) {
if (packet.indexOf("NOGATE") == -1) {
bool thirdPartyPacket = false;
String temp, Sender;

View File

@@ -44,7 +44,7 @@
#endif
#endif
#endif
extern Configuration Config;
bool displayFound = false;

View File

@@ -101,7 +101,7 @@ namespace GPS_Utils {
}
generateBeaconFirstPart();
String encodedGPS = encodeGPS(Config.beacon.latitude, Config.beacon.longitude, Config.beacon.overlay, Config.beacon.symbol);
iGateBeaconPacket += encodedGPS;
iGateBeaconPacket += encodedGPS;
iGateLoRaBeaconPacket += encodedGPS;
}

View File

@@ -23,9 +23,8 @@ bool transmitFlag = true;
#endif
#ifdef HAS_SX1268
#if defined(LIGHTGATEWAY_1_0) || defined(LIGHTGATEWAY_PLUS_1_0)
//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);
SPIClass loraSPI(FSPI);
SX1268 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN, loraSPI);
#else
SX1268 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
#endif
@@ -54,8 +53,7 @@ namespace LoRa_Utils {
#if defined (LIGHTGATEWAY_1_0) || defined(LIGHTGATEWAY_PLUS_1_0)
pinMode(RADIO_VCC_PIN,OUTPUT);
digitalWrite(RADIO_VCC_PIN,HIGH);
//loraSPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN, RADIO_CS_PIN);
SPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN);
loraSPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN, RADIO_CS_PIN);
#else
SPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN);
#endif
@@ -201,7 +199,7 @@ namespace LoRa_Utils {
}
} else {
packet = "";
}
}
lastRxTime = millis();
return packet;
}

View File

@@ -14,14 +14,14 @@ unsigned long ota_progress_millis = 0;
namespace OTA_Utils {
void setup(AsyncWebServer *server) {
if (Config.ota.username != "" && Config.ota.password != "") {
ElegantOTA.begin(server, Config.ota.username.c_str(), Config.ota.password.c_str());
} else {
ElegantOTA.begin(server);
}
ElegantOTA.setAutoReboot(true);
ElegantOTA.onStart(onOTAStart);
ElegantOTA.onProgress(onOTAProgress);
@@ -55,8 +55,8 @@ namespace OTA_Utils {
Serial.println(success ? "OTA update finished successfully!" : "There was an error during OTA update!");
displayShow("", "", statusMessage, "", rebootMessage, "", "", 4000);
isUpdatingOTA = false;
}
}

View File

@@ -232,7 +232,7 @@ namespace POWER_Utils {
digitalWrite(VEXT_CTRL, Config.digi.ecoMode == 1 ? HIGH : LOW);
#endif
#endif
#ifdef HAS_GPS
if (Config.beacon.gpsActive && Config.digi.ecoMode != 1) activateGPS();
#endif
@@ -274,7 +274,7 @@ namespace POWER_Utils {
delay(500);
Wire.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
#endif
delay(1000);
BATTERY_Utils::setup();
BATTERY_Utils::startupBatteryHealth();

View File

@@ -58,8 +58,8 @@ namespace QUERY_Utils {
else if (STATION_Utils::isManager(station) && (!queryFromAPRSIS || !Config.remoteManagement.rfOnly)) {
if (queryQuestion.indexOf("?EM=OFF") == 0) {
if ((Config.digi.mode == 2 || Config.digi.mode == 3) && Config.loramodule.txActive && Config.loramodule.rxActive && !Config.aprs_is.active) {
if (Config.digi.ecoMode == 1) { // Exit Digipeater EcoMode
answer = "DigiEcoMode:OFF";
if (Config.digi.ecoMode == 1 || Config.digi.ecoMode == 2) { // Exit Digipeater EcoMode or Digipeater without WiFiAP
answer = (Config.digi.ecoMode == 1) ? "DigiEcoMode:OFF" : "Digipeater + WiFiAP enabled";
Config.digi.ecoMode = 0;
Config.display.alwaysOn = true;
Config.display.timeout = 10;
@@ -69,7 +69,7 @@ namespace QUERY_Utils {
answer = "DigiEcoMode was OFF";
}
} else {
answer = "DigiEcoMode control not possible";
answer = "Digipeater Mode control not possible";
}
} else if (queryQuestion.indexOf("?EM=ON") == 0) {
if ((Config.digi.mode == 2 || Config.digi.mode == 3) && Config.loramodule.txActive && Config.loramodule.rxActive && !Config.aprs_is.active) {
@@ -82,7 +82,7 @@ namespace QUERY_Utils {
answer = "DigiEcoMode was ON";
}
} else {
answer = "DigiEcoMode control not possible";
answer = "Digipeater Mode control not possible";
}
} else if (queryQuestion.indexOf("?EM=?") == 0) { // Digipeater EcoMode Status
if (Config.digi.ecoMode == 0) {
@@ -113,7 +113,7 @@ namespace QUERY_Utils {
Config.writeFile();
}
}
if (answer == "") return "";
String queryAnswer = Config.callsign;

View File

@@ -27,36 +27,16 @@ namespace SLEEP_Utils {
wakeUpFlag = false;
}
}
void setup() {
if (Config.digi.ecoMode == 1) {
pinMode(RADIO_WAKEUP_PIN, INPUT);
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(1ULL << GPIO_WAKEUP_PIN, ESP_EXT1_WAKEUP_ANY_HIGH);
//gpio_wakeup_enable((gpio_num_t)RADIO_WAKEUP_PIN, GPIO_INTR_HIGH_LEVEL); // ?????
#endif
#if defined(HELTEC_HTCT62) || defined(ESP32C3_DIY_1W_LoRa) || defined(ESP32C3_DIY_1W_LoRa_915) || defined(ESP32_C3_OctopusLab_LoRa)
esp_deep_sleep_enable_gpio_wakeup(1ULL << GPIO_WAKEUP_PIN, ESP_GPIO_WAKEUP_GPIO_HIGH);
//gpio_wakeup_enable(GPIO_WAKEUP_PIN, GPIO_INTR_HIGH_LEVEL);
//esp_sleep_enable_gpio_wakeup();
#endif
#if defined(LIGHTGATEWAY_PLUS_1_0)
//esp_sleep_enable_ext1_wakeup(GPIO_WAKEUP_PIN, ESP_EXT1_WAKEUP_ANY_HIGH);
esp_sleep_enable_ext1_wakeup(1ULL << GPIO_WAKEUP_PIN, ESP_EXT1_WAKEUP_ANY_HIGH);
// Configure the GPIO wakeup source
//esp_sleep_enable_gpio_wakeup();
// Set wakeup condition on GPIO5: high level
//gpio_wakeup_enable(GPIO_NUM_5, GPIO_INTR_HIGH_LEVEL);
//gpio_wakeup_enable(GPIO_WAKEUP_PIN, GPIO_INTR_HIGH_LEVEL);
#endif
}
}
@@ -73,15 +53,9 @@ namespace SLEEP_Utils {
esp_sleep_enable_timer_wakeup(timeToSleep * 1000000); // 1 min = 60sec
Serial.print("(Sleeping : "); Serial.print(timeToSleep); Serial.println("seconds)");
delay(100);
//LoRa_Utils::wakeRadio();
LoRa_Utils::sleepRadio();
//esp_light_sleep_start();
delay(500);
digitalWrite(RADIO_VCC_PIN,LOW);
delay(500);
esp_deep_sleep_start();
LoRa_Utils::wakeRadio();
esp_light_sleep_start();
}
}
void checkSerial() {

View File

@@ -58,10 +58,10 @@ namespace STATION_Utils {
if (callsign.startsWith(wildcard)) return true;
} else {
if (list[i] == callsign) return true;
}
}
}
return false;
}
}
bool isBlacklisted(const String& callsign) {
return checkCallsignList(blacklist, callsign);
@@ -94,7 +94,7 @@ namespace STATION_Utils {
lastHeardObjects.emplace_back(LastHeardStation{millis(), object}); // Add new object and Tx
return true;
}
void deleteNotHeard() {
std::vector<LastHeardStation> lastHeardStation_temp;
for (int i = 0; i < lastHeardStations.size(); i++) {
@@ -149,13 +149,13 @@ namespace STATION_Utils {
return true;
}
void processOutputPacketBufferUltraEcoMode() {
void processOutputPacketBufferUltraEcoMode() {
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
currentIndex++;
}
}
outputPacketBuffer.clear();
//
if (saveNewDigiEcoModeConfig) {

View File

@@ -17,7 +17,7 @@ namespace SYSLOG_Utils {
String syslogPacket = "<165>1 - ";
syslogPacket.concat(Config.callsign);
syslogPacket.concat(" CA2RXU_LoRa_iGate_3.0 - - - "); //RFC5424 The Syslog Protocol
char signalData[35];
snprintf(signalData, sizeof(signalData), " / %ddBm / %.2fdB / %dHz", rssi, snr, freqError);

View File

@@ -47,7 +47,7 @@ namespace TNC_Utils {
void handleInputData(char character, int bufferIndex) {
String* data = (bufferIndex == -1) ? &inputSerialBuffer : &inputServerBuffer[bufferIndex];
if (data->length() == 0 && character != (char)FEND) return;
data->concat(character);
if (character == (char)FEND && data->length() > 3) {

View File

@@ -189,7 +189,7 @@ namespace Utils {
void checkBeaconInterval() {
uint32_t lastTx = millis() - lastBeaconTx;
if (lastBeaconTx == 0 || lastTx >= Config.beacon.interval * 60 * 1000) {
beaconUpdate = true;
beaconUpdate = true;
}
#ifdef HAS_GPS

View File

@@ -115,7 +115,7 @@ namespace WEB_Utils {
Config.wifiAutoAP.password = request->getParam("wifi.autoAP.password", true)->value();
Config.wifiAutoAP.timeout = request->getParam("wifi.autoAP.timeout", true)->value().toInt();
Config.aprs_is.active = request->hasParam("aprs_is.active", true);
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.sendVoltageAsTelemetry = request->hasParam("battery.sendVoltageAsTelemetry", true);
Config.wxsensor.active = request->hasParam("wxsensor.active", true);
Config.wxsensor.heightCorrection = request->getParam("wxsensor.heightCorrection", true)->value().toInt();
Config.wxsensor.temperatureCorrection = request->getParam("wxsensor.temperatureCorrection", true)->value().toFloat();

View File

@@ -71,7 +71,7 @@ namespace WX_Utils {
void setup() {
if (Config.wxsensor.active) {
getWxModuleAddres();
getWxModuleAddres();
if (wxModuleAddress != 0x00) {
bool wxModuleFound = false;
if (wxModuleAddress == 0x76 || wxModuleAddress == 0x77) {

View File

@@ -12,7 +12,7 @@
#define RADIO_RST_PIN -1
#define RADIO_BUSY_PIN 8
#define RADIO_WAKEUP_PIN RADIO_DIO1_PIN
#define GPIO_WAKEUP_PIN RADIO_DIO1_PIN
#define GPIO_WAKEUP_PIN GPIO_NUM_3
// Display
#define HAS_DISPLAY

View File

@@ -16,7 +16,6 @@
#define RADIO_TXEN 14
#define RADIO_WAKEUP_PIN RADIO_DIO1_PIN
#define GPIO_WAKEUP_PIN GPIO_SEL_5
//#define GPIO_WAKEUP_PIN GPIO_NUM_5
// Display
#define HAS_DISPLAY

View File

@@ -14,6 +14,6 @@
#define RADIO_RXEN 6
#define RADIO_TXEN 7
#define RADIO_WAKEUP_PIN RADIO_DIO1_PIN
#define GPIO_WAKEUP_PIN RADIO_DIO1_PIN
#define GPIO_WAKEUP_PIN GPIO_NUM_2
#endif

View File

@@ -14,6 +14,6 @@
#define RADIO_RXEN 6
#define RADIO_TXEN 7
#define RADIO_WAKEUP_PIN RADIO_DIO1_PIN
#define GPIO_WAKEUP_PIN RADIO_DIO1_PIN
#define GPIO_WAKEUP_PIN GPIO_NUM_2
#endif

View File

@@ -1,5 +1,5 @@
[env:heltec_ht-ct62]
board = heltec_wireless_stick_lite
board = esp32-c3-devkitm-1
board_build.mcu = esp32c3
build_flags =
${common.build_flags}