diff --git a/arch/nrf52/nrf52.ini b/arch/nrf52/nrf52.ini index 4a77ec4b2..36effe017 100644 --- a/arch/nrf52/nrf52.ini +++ b/arch/nrf52/nrf52.ini @@ -23,7 +23,7 @@ build_flags = -DMESHTASTIC_EXCLUDE_PAXCOUNTER=1 build_src_filter = - ${arduino_base.build_src_filter} - - - - - - - - - - + ${arduino_base.build_src_filter} - - - - - - - - - - - lib_deps= ${arduino_base.lib_deps} diff --git a/platformio.ini b/platformio.ini index 62bbf8a24..528563def 100644 --- a/platformio.ini +++ b/platformio.ini @@ -61,8 +61,8 @@ monitor_filters = direct lib_deps = # renovate: datasource=git-refs depName=meshtastic-esp8266-oled-ssd1306 packageName=https://github.com/meshtastic/esp8266-oled-ssd1306 gitBranch=master https://github.com/meshtastic/esp8266-oled-ssd1306/archive/0119501e9983bd894830b02f545c377ee08d66fe.zip - # renovate: datasource=custom.pio depName=OneButton packageName=mathertel/library/OneButton - mathertel/OneButton@2.6.1 + # renovate: datasource=git-refs depName=meshtastic-OneButton packageName=https://github.com/meshtastic/OneButton gitBranch=master + https://github.com/meshtastic/OneButton/archive/fa352d668c53f290cfa480a5f79ad422cd828c70.zip # renovate: datasource=git-refs depName=meshtastic-arduino-fsm packageName=https://github.com/meshtastic/arduino-fsm gitBranch=master https://github.com/meshtastic/arduino-fsm/archive/7db3702bf0cfe97b783d6c72595e3f38e0b19159.zip # renovate: datasource=git-refs depName=meshtastic-TinyGPSPlus packageName=https://github.com/meshtastic/TinyGPSPlus gitBranch=master @@ -102,6 +102,14 @@ lib_deps = # renovate: datasource=custom.pio depName=Syslog packageName=arcao/library/Syslog arcao/Syslog@2.0.0 +; Minimal networking libs for nrf52 (excludes Syslog to save flash) +[nrf52_networking_base] +lib_deps = + # renovate: datasource=custom.pio depName=TBPubSubClient packageName=thingsboard/library/TBPubSubClient + thingsboard/TBPubSubClient@2.12.1 + # renovate: datasource=custom.pio depName=NTPClient packageName=arduino-libraries/library/NTPClient + arduino-libraries/NTPClient@3.2.1 + [radiolib_base] lib_deps = # renovate: datasource=custom.pio depName=RadioLib packageName=jgromes/library/RadioLib diff --git a/protobufs b/protobufs index e2c0831aa..5dd723fe6 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit e2c0831aa3d34a58a36c2b9fdcb828e58961cbc5 +Subproject commit 5dd723fe6f33a8613ec81acf5e15be26365c7cce diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index da59de6f5..7781d1531 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -403,9 +403,6 @@ void Screen::doDeepSleep() { #ifdef USE_EINK setOn(false, graphics::UIRenderer::drawDeepSleepFrame); -#ifdef PIN_EINK_EN - digitalWrite(PIN_EINK_EN, LOW); // power off backlight -#endif #else // Without E-Ink display: setOn(false); @@ -429,8 +426,12 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) dispdev->displayOn(); #endif -#ifdef ELECROW_ThinkNode_M5 - io.digitalWrite(PCA_PIN_EINK_EN, HIGH); +#ifdef PIN_EINK_EN + if (uiconfig.screen_brightness == 1) + digitalWrite(PIN_EINK_EN, HIGH); +#elif defined(PCA_PIN_EINK_EN) + if (uiconfig.screen_brightness == 1) + io.digitalWrite(PCA_PIN_EINK_EN, HIGH); #endif #if defined(ST7789_CS) && \ @@ -462,13 +463,10 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) // eInkScreensaver parameter is usually NULL (default argument), default frame used instead setScreensaverFrames(einkScreensaver); #endif -#ifdef ELECROW_ThinkNode_M1 - if (digitalRead(PIN_EINK_EN) == HIGH) { - digitalWrite(PIN_EINK_EN, LOW); - } -#endif -#ifdef ELECROW_ThinkNode_M5 +#ifdef PIN_EINK_EN + digitalWrite(PIN_EINK_EN, LOW); +#elif defined(PCA_PIN_EINK_EN) io.digitalWrite(PCA_PIN_EINK_EN, LOW); #endif diff --git a/src/graphics/ScreenFonts.h b/src/graphics/ScreenFonts.h index 92bdb7641..84ec45977 100644 --- a/src/graphics/ScreenFonts.h +++ b/src/graphics/ScreenFonts.h @@ -16,7 +16,7 @@ #include "graphics/fonts/OLEDDisplayFontsCS.h" #endif -#ifdef CROWPANEL_ESP32S3_5_EPAPER +#if defined(CROWPANEL_ESP32S3_5_EPAPER) && defined(USE_EINK) #include "graphics/fonts/EinkDisplayFonts.h" #endif @@ -85,7 +85,7 @@ #define FONT_LARGE FONT_LARGE_LOCAL // Height: 28 #endif -#if defined(CROWPANEL_ESP32S3_5_EPAPER) +#if defined(CROWPANEL_ESP32S3_5_EPAPER) && defined(USE_EINK) #undef FONT_SMALL #undef FONT_MEDIUM #undef FONT_LARGE diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 2427ad42c..c8cbf8cb2 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -321,7 +321,7 @@ void menuHandler::homeBaseMenu() static int optionsEnumArray[enumEnd] = {Back}; int options = 1; -#ifdef PIN_EINK_EN +#if defined(PIN_EINK_EN) || defined(PCA_PIN_EINK_EN) optionsArray[options] = "Toggle Backlight"; optionsEnumArray[options++] = Backlight; #else @@ -345,12 +345,24 @@ void menuHandler::homeBaseMenu() bannerOptions.optionsCount = options; bannerOptions.bannerCallback = [](int selected) -> void { if (selected == Backlight) { -#ifdef PIN_EINK_EN - if (digitalRead(PIN_EINK_EN) == HIGH) { +#if defined(PIN_EINK_EN) + if (uiconfig.screen_brightness == 1) { + uiconfig.screen_brightness = 0; digitalWrite(PIN_EINK_EN, LOW); } else { + uiconfig.screen_brightness = 1; digitalWrite(PIN_EINK_EN, HIGH); } + saveUIConfig(); +#elif defined(PCA_PIN_EINK_EN) + if (uiconfig.screen_brightness == 1) { + uiconfig.screen_brightness = 0; + io.digitalWrite(PCA_PIN_EINK_EN, LOW); + } else { + uiconfig.screen_brightness = 1; + io.digitalWrite(PCA_PIN_EINK_EN, HIGH); + } + saveUIConfig(); #endif } else if (selected == Sleep) { screen->setOn(false); diff --git a/src/graphics/fonts/EinkDisplayFonts.cpp b/src/graphics/fonts/EinkDisplayFonts.cpp index cfe2c931f..497b3b389 100644 --- a/src/graphics/fonts/EinkDisplayFonts.cpp +++ b/src/graphics/fonts/EinkDisplayFonts.cpp @@ -1,3 +1,5 @@ +#ifdef USE_EINK + #include "EinkDisplayFonts.h" // Created by https://oleddisplay.squix.ch/ Consider a donation @@ -1182,3 +1184,5 @@ const uint8_t Monospaced_plain_30[] PROGMEM = { 0xF0, 0xFF, 0x01, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0xE0, 0x00, 0xFE, 0x03, 0x00, 0xE0, 0x80, 0x7F, 0x00, 0x00, 0xE0, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x10 // 255 }; + +#endif // USE_EINK diff --git a/src/graphics/fonts/EinkDisplayFonts.h b/src/graphics/fonts/EinkDisplayFonts.h index 342525a19..a4a44ba47 100644 --- a/src/graphics/fonts/EinkDisplayFonts.h +++ b/src/graphics/fonts/EinkDisplayFonts.h @@ -1,6 +1,8 @@ #ifndef EINKDISPLAYFONTS_h #define EINKDISPLAYFONTS_h +#ifdef USE_EINK + #ifdef ARDUINO #include #elif __MBED__ @@ -11,4 +13,7 @@ * Monospaced Plain 30 */ extern const uint8_t Monospaced_plain_30[] PROGMEM; + +#endif // USE_EINK + #endif diff --git a/src/graphics/fonts/OLEDDisplayFontsCS.cpp b/src/graphics/fonts/OLEDDisplayFontsCS.cpp index 67208b4d9..c8045285e 100644 --- a/src/graphics/fonts/OLEDDisplayFontsCS.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsCS.cpp @@ -1,3 +1,5 @@ +#ifdef OLED_CS + #include "OLEDDisplayFontsCS.h" // Font generated or edited with the glyphEditor @@ -1860,4 +1862,6 @@ const uint8_t ArialMT_Plain_24_CS[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x06, 0xC0, 0xF0, 0x01, 0x06, 0xC0, 0x80, 0x0F, 0x07, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0xFC, 0x00, 0xC0, 0xC0, 0x1F, 0x00, 0xC0, 0xF8, 0x03, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x06, // 255 -}; \ No newline at end of file +}; + +#endif // OLED_CS \ No newline at end of file diff --git a/src/graphics/fonts/OLEDDisplayFontsPL.cpp b/src/graphics/fonts/OLEDDisplayFontsPL.cpp index 0767e24e7..00f0913fe 100644 --- a/src/graphics/fonts/OLEDDisplayFontsPL.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsPL.cpp @@ -1,4 +1,5 @@ // trunk-ignore-all(clang-format): Preserve long lines +#ifdef OLED_PL #include "OLEDDisplayFontsPL.h" const uint8_t ArialMT_Plain_10_PL[] PROGMEM = { @@ -1310,4 +1311,6 @@ const uint8_t ArialMT_Plain_24_PL[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x06, 0x00, 0xF0, 0x01, 0x06, 0x00, 0x80, 0x0F, 0x07, 0x80, 0x00, 0xFE, 0x03, 0xE0, 0x00, 0xFC, 0x00, 0x60, 0xC0, 0x1F, 0x00, 0x20, 0xF8, 0x03, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x06, // 253 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x1C, 0x18, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF0, 0x03, // 254 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x06, 0xC0, 0xF0, 0x01, 0x06, 0xC0, 0x80, 0x0F, 0x07, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0xFC, 0x00, 0xC0, 0xC0, 0x1F, 0x00, 0xC0, 0xF8, 0x03, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x06, // 255 -}; \ No newline at end of file +}; + +#endif // OLED_PL \ No newline at end of file diff --git a/src/graphics/fonts/OLEDDisplayFontsRU.cpp b/src/graphics/fonts/OLEDDisplayFontsRU.cpp index 2b85727c2..3a1159511 100644 --- a/src/graphics/fonts/OLEDDisplayFontsRU.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsRU.cpp @@ -1,3 +1,5 @@ +#ifdef OLED_RU + #include "OLEDDisplayFontsRU.h" // Font generated or edited with the glyphEditor @@ -1762,4 +1764,6 @@ const uint8_t ArialMT_Plain_24_RU[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x30, 0x00, 0x00, 0xFC, 0x38, 0x00, 0x00, 0xCC, 0x1D, 0x00, 0x00, 0x8C, 0x0F, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, // 255 -}; \ No newline at end of file +}; + +#endif // OLED_RU \ No newline at end of file diff --git a/src/graphics/fonts/OLEDDisplayFontsUA.cpp b/src/graphics/fonts/OLEDDisplayFontsUA.cpp index 2a97526ef..8bc56ea94 100644 --- a/src/graphics/fonts/OLEDDisplayFontsUA.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsUA.cpp @@ -1,3 +1,5 @@ +#ifdef OLED_UA + #include "OLEDDisplayFontsUA.h" // Font generated or edited with the glyphEditor @@ -1920,4 +1922,6 @@ const uint8_t ArialMT_Plain_24_UA[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xC1, 0x00, 0x00, 0xF0, 0xE3, 0x00, 0x00, 0x38, 0x7B, 0x00, 0x00, 0x18, 0x1A, 0x00, 0x00, 0x18, 0x0E, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0xF8, 0xFF, 0x00, 0x00, 0xF8, 0xFF, // 1103 -}; \ No newline at end of file +}; + +#endif // OLED_UA \ No newline at end of file diff --git a/src/input/ButtonThread.cpp b/src/input/ButtonThread.cpp index 233bbefe0..f26b3c970 100644 --- a/src/input/ButtonThread.cpp +++ b/src/input/ButtonThread.cpp @@ -92,8 +92,11 @@ bool ButtonThread::initButton(const ButtonConfig &config) if (config.shortLong != INPUT_BROKER_NONE) { _shortLong = config.shortLong; } - +#ifdef USE_EINK + userButton.setDebounceMs(0); +#else userButton.setDebounceMs(1); +#endif userButton.setPressMs(_longPressTime); if (screen) { diff --git a/src/main.cpp b/src/main.cpp index c73db0fcc..5745ecc67 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -306,7 +306,6 @@ void setup() Wire.begin(48, 47); io.pinMode(PCA_PIN_EINK_EN, OUTPUT); io.pinMode(PCA_PIN_POWER_EN, OUTPUT); - io.digitalWrite(PCA_PIN_EINK_EN, HIGH); io.digitalWrite(PCA_PIN_POWER_EN, HIGH); // io.pinMode(C2_PIN, OUTPUT); #endif diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 99e99922b..c210d5d48 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -666,8 +666,10 @@ void RadioInterface::limitPower(int8_t loraMaxPower) void RadioInterface::deliverToReceiver(meshtastic_MeshPacket *p) { - if (router) + if (router) { + p->transport_mechanism = meshtastic_MeshPacket_TransportMechanism_TRANSPORT_LORA; router->enqueueReceivedMessage(p); + } } /*** diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 065d627e9..a54dcb976 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -66,7 +66,6 @@ int32_t Router::runOnce() { meshtastic_MeshPacket *mp; while ((mp = fromRadioQueue.dequeuePtr(0)) != NULL) { - mp->transport_mechanism = meshtastic_MeshPacket_TransportMechanism_TRANSPORT_LORA; // printPacket("handle fromRadioQ", mp); perhapsHandleReceived(mp); } diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 1d1ff47e0..ce3722aa7 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -270,6 +270,8 @@ typedef enum _meshtastic_HardwareModel { /* MeshSolar is an integrated power management and communication solution designed for outdoor low-power devices. https://heltec.org/project/meshsolar/ */ meshtastic_HardwareModel_HELTEC_MESH_SOLAR = 108, + /* Lilygo T-Echo Lite */ + meshtastic_HardwareModel_T_ECHO_LITE = 109, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ diff --git a/src/modules/TraceRouteModule.cpp b/src/modules/TraceRouteModule.cpp index f4eccd667..d7df90bb5 100644 --- a/src/modules/TraceRouteModule.cpp +++ b/src/modules/TraceRouteModule.cpp @@ -602,7 +602,7 @@ void TraceRouteModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state int start = 0; int newlinePos = resultText.indexOf('\n', start); - while (newlinePos != -1 || start < resultText.length()) { + while (newlinePos != -1 || start < static_cast(resultText.length())) { String segment; if (newlinePos != -1) { segment = resultText.substring(start, newlinePos); @@ -624,7 +624,7 @@ void TraceRouteModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state int lastGoodBreak = -1; bool lineComplete = false; - for (int i = 0; i < remaining.length(); i++) { + for (int i = 0; i < static_cast(remaining.length()); i++) { char ch = remaining.charAt(i); String testLine = tempLine + ch; diff --git a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h index 61d6149d2..a55808170 100644 --- a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h +++ b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h @@ -61,7 +61,7 @@ #define LORA_DIO1 SX126X_DIO1 #define USE_EINK -#define PIN_EINK_EN -1 // Note: this is really just backlight power +// Note: this is really just backlight power #define PCA_PIN_EINK_EN 5 // This is the pin number on the GPIO expander #define PIN_EINK_CS 39 #define PIN_EINK_BUSY 42 diff --git a/variants/nrf52840/rak2560/platformio.ini b/variants/nrf52840/rak2560/platformio.ini index 2b73aca03..edc648b9b 100644 --- a/variants/nrf52840/rak2560/platformio.ini +++ b/variants/nrf52840/rak2560/platformio.ini @@ -11,10 +11,10 @@ build_flags = ${nrf52840_base.build_flags} -DRADIOLIB_EXCLUDE_SX127X=1 -DRADIOLIB_EXCLUDE_LR11X0=1 -DHAS_RAKPROT=1 ; Define if RAk OneWireSerial is used (disables GPS) -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak2560> + + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak2560> + + + lib_deps = ${nrf52840_base.lib_deps} - ${networking_base.lib_deps} + ${nrf52_networking_base.lib_deps} melopero/Melopero RV3028@^1.1.0 https://github.com/beegee-tokyo/RAK-OneWireSerial/archive/0.0.2.zip debug_tool = jlink diff --git a/variants/nrf52840/rak4631/platformio.ini b/variants/nrf52840/rak4631/platformio.ini index 199e17570..83feaa06c 100644 --- a/variants/nrf52840/rak4631/platformio.ini +++ b/variants/nrf52840/rak4631/platformio.ini @@ -17,7 +17,7 @@ build_flags = ${nrf52840_base.build_flags} build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631> + + + lib_deps = ${nrf52840_base.lib_deps} - ${networking_base.lib_deps} + ${nrf52_networking_base.lib_deps} melopero/Melopero RV3028@^1.1.0 https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2 diff --git a/variants/nrf52840/rak4631_eth_gw/platformio.ini b/variants/nrf52840/rak4631_eth_gw/platformio.ini index a1c1b4610..79cdb28c7 100644 --- a/variants/nrf52840/rak4631_eth_gw/platformio.ini +++ b/variants/nrf52840/rak4631_eth_gw/platformio.ini @@ -24,7 +24,7 @@ build_flags = ${nrf52840_base.build_flags} -DMESHTASTIC_EXCLUDE_STOREFORWARD=1 -DMESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -DMESHTASTIC_EXCLUDE_WAYPOINT=1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631_eth_gw> + + + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631_eth_gw> + + + + lib_deps = ${nrf52840_base.lib_deps} ${networking_base.lib_deps} diff --git a/variants/nrf52840/rak_wismeshtap/platformio.ini b/variants/nrf52840/rak_wismeshtap/platformio.ini index f6ee8fd23..adf301537 100644 --- a/variants/nrf52840/rak_wismeshtap/platformio.ini +++ b/variants/nrf52840/rak_wismeshtap/platformio.ini @@ -18,7 +18,7 @@ build_flags = ${nrf52840_base.build_flags} build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak_wismeshtap> + + + lib_deps = ${nrf52840_base.lib_deps} - ${networking_base.lib_deps} + ${nrf52_networking_base.lib_deps} melopero/Melopero RV3028@^1.1.0 https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2