diff --git a/platformio.ini b/platformio.ini index e483260..77347d2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,7 @@ default_envs = ttgo-lora32-v21 extra_configs = common_settings.ini - variants/*/platformio.ini + variants/*/platformio.ini [env] platform = espressif32 @ 6.7.0 diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index df4cf96..0438d91 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -48,7 +48,7 @@ ___________________________________________________________________*/ #include "A7670_utils.h" #endif -String versionDate = "2025.02.25"; +String versionDate = "2025.02.28"; Configuration Config; WiFiClient espClient; #ifdef HAS_GPS @@ -68,10 +68,14 @@ uint32_t lastBatteryCheck = 0; bool backUpDigiMode = false; bool modemLoggedToAPRSIS = false; +#ifdef HAS_EPAPER + uint32_t lastEpaperTime = 0; + extern String lastEpaperText; +#endif + std::vector receivedPackets; String firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine; - //#define STARTUP_DELAY 5 //min void setup() { @@ -219,7 +223,19 @@ void loop() { STATION_Utils::processOutputPacketBuffer(); - displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); + #ifdef HAS_EPAPER // Only consider updating every 10 seconds (when data to show is different from before) + if(lastEpaperTime == 0 || millis() - lastEpaperTime > 10000) { + String posibleEpaperText = firstLine + secondLine + thirdLine + fourthLine + fifthLine + sixthLine + seventhLine; + if (lastEpaperText != posibleEpaperText) { + displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); + lastEpaperText = posibleEpaperText; + lastEpaperTime = millis(); + } + } + #else + displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); + #endif + Utils::checkRebootTime(); Utils::checkSleepByLowBatteryVoltage(1); } \ No newline at end of file diff --git a/src/aprs_is_utils.cpp b/src/aprs_is_utils.cpp index e03b60a..27fbdfe 100644 --- a/src/aprs_is_utils.cpp +++ b/src/aprs_is_utils.cpp @@ -322,6 +322,7 @@ namespace APRS_IS_Utils { seventhLine = "QUERY = "; seventhLine += receivedMessage; } + displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); } else { Utils::print("Rx Message (APRS-IS): " + packet); if (STATION_Utils::wasHeard(Addressee) && packet.indexOf("EQNS.") == -1 && packet.indexOf("UNIT.") == -1 && packet.indexOf("PARM.") == -1) { @@ -329,9 +330,9 @@ namespace APRS_IS_Utils { displayToggle(true); lastScreenOn = millis(); Utils::typeOfPacket(packet, 1); // APRS-LoRa + displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); } } - displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); } else if (Config.aprs_is.objectsToRF && packet.indexOf(":;") > 0) { Utils::print("Rx Object (APRS-IS) : " + packet); if (STATION_Utils::checkObjectTime(packet)) { diff --git a/src/display.cpp b/src/display.cpp index 213a813..d8ba7ac 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -24,7 +24,10 @@ uint16_t redColor = 0xc8a2; #else #ifdef HAS_EPAPER - // + #include + #include "Fonts/FreeSansBold9pt7b.h" + EInkDisplay_WirelessPaperV1_1 display; + String lastEpaperText; #else #include #include @@ -63,7 +66,9 @@ void displaySetup() { #endif #else #ifdef HAS_EPAPER - // + display.landscape(); + display.printCenter("LoRa APRS iGate Initialising..."); + display.update(); #else #ifdef OLED_DISPLAY_HAS_RST_PIN pinMode(OLED_RST, OUTPUT); @@ -96,7 +101,8 @@ void displayToggle(bool toggle) { digitalWrite(TFT_BL, HIGH); #else #ifdef HAS_EPAPER - // ... to be continued + display.printCenter("EPAPER Display Disabled by toggle..."); + display.update(); #else if (displayFound) display.ssd1306_command(SSD1306_DISPLAYON); #endif @@ -106,7 +112,8 @@ void displayToggle(bool toggle) { digitalWrite(TFT_BL, LOW); #else #ifdef HAS_EPAPER - // ... to be continued + display.printCenter("Enabled EPAPER Display..."); + display.update(); #else if (displayFound) display.ssd1306_command(SSD1306_DISPLAYOFF); #endif @@ -141,7 +148,16 @@ void displayShow(const String& header, const String& line1, const String& line2, sprite.pushSprite(0,0); #else #ifdef HAS_EPAPER - // ... to be continued + display.clearMemory(); + display.setCursor(5,10); + display.setFont(&FreeSansBold9pt7b); + display.println(header); + display.setFont(NULL); + for (int i = 0; i < 3; i++) { + display.setCursor(0, 25 + (14 * i)); + display.println(*lines[i]); + } + display.update(); #else if (displayFound) { display.clearDisplay(); @@ -189,7 +205,17 @@ void displayShow(const String& header, const String& line1, const String& line2, sprite.pushSprite(0,0); #else #ifdef HAS_EPAPER - // ... to be continued + lastEpaperText = header + line1 + line2 + line3 + line4 + line5 + line6; + display.clearMemory(); + display.setCursor(5,10); + display.setFont(&FreeSansBold9pt7b); + display.println(header); + display.setFont(NULL); + for (int i = 0; i < 6; i++) { + display.setCursor(0, 25 + (14 * i)); + display.println(*lines[i]); + } + display.update(); #else if (displayFound) { display.clearDisplay(); diff --git a/variants/heltec_wireless_paper/platformio.ini b/variants/heltec_wireless_paper/platformio.ini index a6eaeb8..441e67c 100644 --- a/variants/heltec_wireless_paper/platformio.ini +++ b/variants/heltec_wireless_paper/platformio.ini @@ -4,5 +4,7 @@ board_build.mcu = esp32s3 build_flags = ${common.build_flags} -D HELTEC_WP + -D WIRELESS_PAPER lib_deps = - ${common.lib_deps} \ No newline at end of file + ${common.lib_deps} + todd-herbert/heltec-eink-modules@^4.4.0 \ No newline at end of file