Compare commits

...

8 Commits
UEM1 ... UEM5

Author SHA1 Message Date
richonguzman
10798d2c9a 8.45mA 2025-05-08 12:53:55 -04:00
richonguzman
3cc8fed15f preparing readme 2025-04-24 19:48:33 -04:00
richonguzman
725be9fed5 HWT works 2025-04-24 19:32:46 -04:00
richonguzman
16d9ef1c06 more testing to do 2025-04-24 18:08:25 -04:00
richonguzman
d2b7c063f7 hwt not ready 2025-04-24 18:02:29 -04:00
richonguzman
eaced15265 pruebas3 2025-04-24 18:01:00 -04:00
richonguzman
af4bc20ac2 t-beam ok 2025-04-24 16:32:58 -04:00
richonguzman
14473cb7c7 Sleep fix when saving Config 2025-04-24 16:17:29 -04:00
10 changed files with 45 additions and 27 deletions

View File

@@ -54,6 +54,7 @@ ____________________________________________________
## Timeline (Versions):
- 2025-04-20000000
- 2025.03.20 Manager List added to enable/disable DigiEcoMode and Tx Control. Thanks LB5JJ.
- 2025.03.03 T-Beam Supreme board added and more BlackList rules added.
- 2025.02.28 Heltec Wireless Paper with Epaper working. Thanks SzymonPriv for pointing to the right library.

View File

@@ -8,6 +8,7 @@ namespace SLEEP_Utils {
void setup();
void checkWakeUpFlag();
void startSleeping();
void checkSerial();
}

View File

@@ -48,7 +48,7 @@ ___________________________________________________________________*/
#endif
String versionDate = "2025-04-24";
String versionDate = "2025-05-08";
Configuration Config;
WiFiClient espClient;
#ifdef HAS_GPS
@@ -105,6 +105,7 @@ void setup() {
#endif
Utils::checkRebootMode();
APRS_IS_Utils::firstConnection();
SLEEP_Utils::checkSerial();
}
void loop() {
@@ -203,4 +204,10 @@ void loop() {
Utils::checkRebootTime();
Utils::checkSleepByLowBatteryVoltage(1);
}
}
}
// ESP32 (and ESPS3) work?
// ESP32C3 :
// - HT-CT62 sleeps??
// - and others?

View File

@@ -2,6 +2,7 @@
#include "configuration.h"
#include "aprs_is_utils.h"
#include "station_utils.h"
#include "board_pinout.h"
#include "syslog_utils.h"
#include "query_utils.h"
#include "A7670_utils.h"
@@ -370,7 +371,6 @@ namespace APRS_IS_Utils {
listenAPRSIS();
}
}
if (Config.digi.ecoMode == 1) displayToggle(false);
}
}

View File

@@ -4,6 +4,9 @@
#include "display.h"
bool shouldSleepStop = true;
void Configuration::writeFile() {
Serial.println("Saving config...");
@@ -166,6 +169,7 @@ bool Configuration::readFile() {
digi.mode = data["digi"]["mode"] | 0;
digi.ecoMode = data["digi"]["ecoMode"] | 0;
if (digi.ecoMode == 1) shouldSleepStop = false;
loramodule.txFreq = data["lora"]["txFreq"] | 433775000;
loramodule.rxFreq = data["lora"]["rxFreq"] | 433775000;

View File

@@ -225,7 +225,7 @@ namespace GPS_Utils {
void setup() {
#ifdef HAS_GPS
if (Config.beacon.gpsActive) {
if (Config.beacon.gpsActive && Config.digi.ecoMode != 1) {
gpsSerial.begin(GPS_BAUD, SERIAL_8N1, GPS_TX, GPS_RX);
}
#endif

View File

@@ -133,8 +133,7 @@ namespace LoRa_Utils {
}
#ifdef INTERNAL_LED_PIN
//if (Config.digi.ecoMode != 1)
digitalWrite(INTERNAL_LED_PIN, HIGH); // disabled in Ultra Eco Mode
if (Config.digi.ecoMode != 1) digitalWrite(INTERNAL_LED_PIN, HIGH); // disabled in Ultra Eco Mode
#endif
int state = radio.transmit("\x3c\xff\x01" + newPacket);
transmitFlag = true;
@@ -149,18 +148,13 @@ namespace LoRa_Utils {
Utils::println(String(state));
}
#ifdef INTERNAL_LED_PIN
//if (Config.digi.ecoMode != 1)
digitalWrite(INTERNAL_LED_PIN, LOW); // disabled in Ultra Eco Mode
if (Config.digi.ecoMode != 1) digitalWrite(INTERNAL_LED_PIN, LOW); // disabled in Ultra Eco Mode
#endif
if (Config.loramodule.txFreq != Config.loramodule.rxFreq) {
changeFreqRx();
}
}
/*void startReceive() {
radio.startReceive();
}*/
String receivePacketFromSleep() {
String packet = "";
int state = radio.readData(packet);

View File

@@ -216,6 +216,7 @@ namespace POWER_Utils {
#ifdef INTERNAL_LED_PIN
pinMode(INTERNAL_LED_PIN, OUTPUT);
digitalWrite(INTERNAL_LED_PIN, LOW);
#endif
if (Config.battery.sendExternalVoltage || Config.battery.monitorExternalVoltage) {
@@ -224,20 +225,26 @@ namespace POWER_Utils {
#ifdef VEXT_CTRL
pinMode(VEXT_CTRL,OUTPUT); // GPS + TFT on HELTEC Wireless_Tracker and only for Oled in HELTEC V3
#if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_V3)
digitalWrite(VEXT_CTRL, HIGH);
#if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_V3)
digitalWrite(VEXT_CTRL, Config.digi.ecoMode == 1 ? LOW : HIGH);
#endif
#if defined(HELTEC_WP) || defined(HELTEC_WS) || defined(HELTEC_V3_2)
digitalWrite(VEXT_CTRL, LOW);
#if defined(HELTEC_WP) || defined(HELTEC_WS) || defined(HELTEC_V3_2) || defined(HELTEC_WSL_V3)
digitalWrite(VEXT_CTRL, Config.digi.ecoMode == 1 ? HIGH : LOW);
#endif
#endif
#ifdef HAS_GPS
if (Config.beacon.gpsActive) activateGPS();
if (Config.beacon.gpsActive && Config.digi.ecoMode != 1) activateGPS();
#endif
#ifdef ADC_CTRL
pinMode(ADC_CTRL, OUTPUT);
#if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_V3_2)
digitalWrite(ADC_CTRL, LOW);
#endif
#if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WP)
digitalWrite(ADC_CTRL, HIGH);
#endif
#endif
#if defined(HELTEC_WIRELESS_TRACKER)

View File

@@ -6,6 +6,7 @@
extern Configuration Config;
extern bool shouldSleepStop;
extern uint32_t lastBeaconTx;
bool wakeUpFlag = false;
@@ -31,7 +32,6 @@ namespace SLEEP_Utils {
if (Config.digi.ecoMode == 1) {
pinMode(RADIO_WAKEUP_PIN, INPUT);
attachInterrupt(digitalPinToInterrupt(RADIO_WAKEUP_PIN), wakeUpLoRaPacketReceived, RISING);
LoRa_Utils::wakeRadio();
#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)
esp_sleep_enable_ext1_wakeup(GPIO_WAKEUP_PIN, ESP_EXT1_WAKEUP_ANY_HIGH);
#endif
@@ -48,15 +48,19 @@ namespace SLEEP_Utils {
}
void startSleeping() {
uint32_t timeToSleep = getSecondsToSleep();
esp_sleep_enable_timer_wakeup(timeToSleep * 1000000); // 1 min = 60sec
Serial.print("(Sleeping : "); Serial.print(timeToSleep); Serial.println("seconds)");
if (!shouldSleepStop) {
uint32_t timeToSleep = getSecondsToSleep();
esp_sleep_enable_timer_wakeup(timeToSleep * 1000000); // 1 min = 60sec
Serial.print("(Sleeping : "); Serial.print(timeToSleep); Serial.println("seconds)");
delay(100);
LoRa_Utils::wakeRadio();
esp_light_sleep_start();
}
}
//esp_sleep_enable_timer_wakeup(getSecondsToSleep() * 1000000); // 1 min = 60sec
delay(100);
LoRa_Utils::wakeRadio();
esp_light_sleep_start();
void checkSerial() {
if (Config.digi.ecoMode == 1) Serial.end();
}
}

View File

@@ -88,7 +88,7 @@ namespace Utils {
}
void setupDisplay() {
displaySetup();
if (Config.digi.ecoMode != 1) displaySetup();
#ifdef INTERNAL_LED_PIN
digitalWrite(INTERNAL_LED_PIN,HIGH);
#endif