From ee687e6959891d626ab501143df93daf35f1132d Mon Sep 17 00:00:00 2001 From: richonguzman Date: Fri, 16 Aug 2024 15:52:20 -0400 Subject: [PATCH 01/15] first test --- platformio.ini | 14 +++- src/battery_utils.cpp | 4 +- src/boards_pinout.h | 19 +++++- src/display.cpp | 145 ++++++++++++++++++++++++------------------ src/power_utils.cpp | 5 +- 5 files changed, 120 insertions(+), 67 deletions(-) diff --git a/platformio.ini b/platformio.ini index 52b8dce..fa701a8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -438,4 +438,16 @@ build_flags = lib_deps = ${common.lib_deps} adafruit/Adafruit GFX Library @ 1.11.9 - adafruit/Adafruit SSD1306 @ 2.5.10 \ No newline at end of file + adafruit/Adafruit SSD1306 @ 2.5.10 + +[env:heltec_wireless_paper] +board = esp32-s3-devkitc-1 +board_build.mcu = esp32s3 +build_flags = + -Werror -Wall + -DHELTEC_WP + -DHAS_SX1262 + -DHAS_EPAPER + -DELEGANTOTA_USE_ASYNC_WEBSERVER=1 +lib_deps = + ${common.lib_deps} \ No newline at end of file diff --git a/src/battery_utils.cpp b/src/battery_utils.cpp index 834a5ec..8c0ef92 100644 --- a/src/battery_utils.cpp +++ b/src/battery_utils.cpp @@ -99,7 +99,7 @@ namespace BATTERY_Utils { int sample; int sampleSum = 0; #ifdef ADC_CTRL - #if defined(HELTEC_WIRELESS_TRACKER) + #if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_WP) digitalWrite(ADC_CTRL, HIGH); #endif #if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) @@ -130,7 +130,7 @@ namespace BATTERY_Utils { } #ifdef ADC_CTRL - #if defined(HELTEC_WIRELESS_TRACKER) + #if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_WP) digitalWrite(ADC_CTRL, LOW); #endif #if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) diff --git a/src/boards_pinout.h b/src/boards_pinout.h index 54101fd..b565abb 100644 --- a/src/boards_pinout.h +++ b/src/boards_pinout.h @@ -18,7 +18,7 @@ #define RADIO_BUSY_PIN 26 // GPIO26 - SX1278 IRQ ---->DIO0 #endif -#if defined(HELTEC_V3) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY) || defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_WS) +#if defined(HELTEC_V3) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY) || defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_WS) || defined(HELTEC_WP) #define RADIO_SCLK_PIN 9 // SX1262 SCK #define RADIO_MISO_PIN 11 // SX1262 MISO #define RADIO_MOSI_PIN 10 // SX1262 MOSI @@ -84,7 +84,7 @@ #define RADIO_TXEN 13 #endif -#ifdef HELTEC_HTCT62 +#if defined(HELTEC_HTCT62) #define RADIO_SCLK_PIN 10 // SX1262 SCK #define RADIO_MISO_PIN 6 // SX1262 MISO #define RADIO_MOSI_PIN 7 // SX1262 MOSI @@ -204,6 +204,21 @@ #define BOARD_I2C_SCL 6 #endif +#ifdef HELTEC_WP + #define INTERNAL_LED_PIN 18 + #define BATTERY_PIN 20 + #define ADC_CTRL 19 + #define VEXT_CTRL 45 + #define BOARD_I2C_SDA 37 + #define BOARD_I2C_SCL 36 + #define EPAPER_BUSY 7 + #define EPAPER_RST 6 + #define EPAPER_DC 5 + #define EPAPER_CS 4 + #define EPAPER_SCL 3 + #define EPAPER_SDA 2 +#endif + #ifdef ESP32_C3_DIY_LoRa // just testing! #define OLED_SDA 8 #define OLED_SCL 9 diff --git a/src/display.cpp b/src/display.cpp index ce4270b..ca09176 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -16,15 +16,19 @@ #define lineSpacing 12 #endif #else - #include - #include - #if defined(HELTEC_V3) - #define OLED_DISPLAY_HAS_RST_PIN - #endif - #ifdef HELTEC_WSL_V3_DISPLAY - Adafruit_SSD1306 display(128, 64, &Wire1, OLED_RST); + #if HAS_EPAPER + // #else - Adafruit_SSD1306 display(128, 64, &Wire, OLED_RST); + #include + #include + #if defined(HELTEC_V3) + #define OLED_DISPLAY_HAS_RST_PIN + #endif + #ifdef HELTEC_WSL_V3_DISPLAY + Adafruit_SSD1306 display(128, 64, &Wire1, OLED_RST); + #else + Adafruit_SSD1306 display(128, 64, &Wire, OLED_RST); + #endif #endif #endif #endif @@ -52,32 +56,36 @@ void displaySetup() { } tft.setTextFont(0); tft.fillScreen(TFT_BLACK); - #else - #ifdef OLED_DISPLAY_HAS_RST_PIN - pinMode(OLED_RST, OUTPUT); - digitalWrite(OLED_RST, LOW); - delay(20); - digitalWrite(OLED_RST, HIGH); - #endif + #else + #if HAS_EPAPER + // + #else + #ifdef OLED_DISPLAY_HAS_RST_PIN + pinMode(OLED_RST, OUTPUT); + digitalWrite(OLED_RST, LOW); + delay(20); + digitalWrite(OLED_RST, HIGH); + #endif - #ifndef HELTEC_WSL_V3_DISPLAY - Wire.begin(OLED_SDA, OLED_SCL); - #endif + #ifndef HELTEC_WSL_V3_DISPLAY + Wire.begin(OLED_SDA, OLED_SCL); + #endif - if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) { - Serial.println(F("SSD1306 allocation failed")); - for(;;); // Don't proceed, loop forever - } - if (Config.display.turn180) { - display.setRotation(2); - } - display.clearDisplay(); - display.setTextColor(WHITE); - display.setTextSize(1); - display.setCursor(0, 0); - display.ssd1306_command(SSD1306_SETCONTRAST); - display.ssd1306_command(1); - display.display(); + if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) { + Serial.println(F("SSD1306 allocation failed")); + for(;;); // Don't proceed, loop forever + } + if (Config.display.turn180) { + display.setRotation(2); + } + display.clearDisplay(); + display.setTextColor(WHITE); + display.setTextSize(1); + display.setCursor(0, 0); + display.ssd1306_command(SSD1306_SETCONTRAST); + display.ssd1306_command(1); + display.display(); + #endif #endif delay(1000); #endif @@ -89,13 +97,21 @@ void displayToggle(bool toggle) { #ifdef HAS_TFT digitalWrite(TFT_BL, HIGH); #else - display.ssd1306_command(SSD1306_DISPLAYON); + #if HAS_EPAPER + // ... to be continued + #else + display.ssd1306_command(SSD1306_DISPLAYON); + #endif #endif } else { #ifdef HAS_TFT digitalWrite(TFT_BL, LOW); #else - display.ssd1306_command(SSD1306_DISPLAYOFF); + #if HAS_EPAPER + // ... to be continued + #else + display.ssd1306_command(SSD1306_DISPLAYOFF); + #endif #endif } #endif @@ -145,18 +161,22 @@ void displayShow(const String& header, const String& line1, const String& line2, tft.print(*lines[i]); } #else - display.clearDisplay(); - display.setTextColor(WHITE); - display.setTextSize(1); - display.setCursor(0, 0); - display.println(header); - for (int i = 0; i < 3; i++) { - display.setCursor(0, 8 + (8 * i)); - display.println(*lines[i]); - } - display.ssd1306_command(SSD1306_SETCONTRAST); - display.ssd1306_command(1); - display.display(); + #ifdef HAS_EPAPER + // ... to be continued + #else + display.clearDisplay(); + display.setTextColor(WHITE); + display.setTextSize(1); + display.setCursor(0, 0); + display.println(header); + for (int i = 0; i < 3; i++) { + display.setCursor(0, 8 + (8 * i)); + display.println(*lines[i]); + } + display.ssd1306_command(SSD1306_SETCONTRAST); + display.ssd1306_command(1); + display.display(); + #endif #endif delay(wait); #endif @@ -179,20 +199,23 @@ void displayShow(const String& header, const String& line1, const String& line2, tft.print(*lines[i]); } #else - display.clearDisplay(); - display.setTextColor(WHITE); - display.setTextSize(2); - display.setCursor(0, 0); - display.println(header); - display.setTextSize(1); - for (int i = 0; i < 6; i++) { - display.setCursor(0, 16 + (8 * i)); - display.println(*lines[i]); - } - display.ssd1306_command(SSD1306_SETCONTRAST); - display.ssd1306_command(1); - display.display(); + #ifdef HAS_EPAPER + // ... to be continued + #else + display.clearDisplay(); + display.setTextColor(WHITE); + display.setTextSize(2); + display.setCursor(0, 0); + display.println(header); + display.setTextSize(1); + for (int i = 0; i < 6; i++) { + display.setCursor(0, 16 + (8 * i)); + display.println(*lines[i]); + } + display.ssd1306_command(SSD1306_SETCONTRAST); + display.ssd1306_command(1); + display.display(); + #endif #endif delay(wait); - #endif -} \ No newline at end of file + #endif \ No newline at end of file diff --git a/src/power_utils.cpp b/src/power_utils.cpp index 79f2b81..f4e70a9 100644 --- a/src/power_utils.cpp +++ b/src/power_utils.cpp @@ -154,13 +154,16 @@ namespace POWER_Utils { #ifndef HELTEC_WSL_V3 digitalWrite(VEXT_CTRL, HIGH); #endif + #ifdef HELTEC_WP + digitalWrite(VEXT_CTRL, LOW); + #endif #endif #ifdef ADC_CTRL pinMode(ADC_CTRL, OUTPUT); #endif - #ifdef HELTEC_WIRELESS_TRACKER + #if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_WP) Wire.begin(BOARD_I2C_SDA, BOARD_I2C_SCL); #endif From 55d6bc325f1c40a86582864cc56621b3175441ad Mon Sep 17 00:00:00 2001 From: richonguzman Date: Fri, 16 Aug 2024 15:52:55 -0400 Subject: [PATCH 02/15] version update --- src/LoRa_APRS_iGate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index 4e6f5c7..7340ab8 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -38,7 +38,7 @@ ________________________________________________________________________________ #include "A7670_utils.h" #endif -String versionDate = "2024.08.14"; +String versionDate = "2024.08.16"; Configuration Config; WiFiClient espClient; From f11b6de57a3570c075d061c8cda127f066ea2653 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Fri, 16 Aug 2024 16:00:58 -0400 Subject: [PATCH 03/15] fix for normal display --- src/display.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/display.cpp b/src/display.cpp index ca09176..71a293f 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -218,4 +218,5 @@ void displayShow(const String& header, const String& line1, const String& line2, #endif #endif delay(wait); - #endif \ No newline at end of file + #endif +} \ No newline at end of file From 8863838210736c89f33eccd837c030ec9f6d39bf Mon Sep 17 00:00:00 2001 From: richonguzman Date: Sat, 17 Aug 2024 13:16:44 -0400 Subject: [PATCH 04/15] updated battery readings --- src/battery_utils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battery_utils.cpp b/src/battery_utils.cpp index 8c0ef92..a400739 100644 --- a/src/battery_utils.cpp +++ b/src/battery_utils.cpp @@ -99,10 +99,10 @@ namespace BATTERY_Utils { int sample; int sampleSum = 0; #ifdef ADC_CTRL - #if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_WP) + #if defined(HELTEC_WIRELESS_TRACKER) digitalWrite(ADC_CTRL, HIGH); #endif - #if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) + #if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WP) digitalWrite(ADC_CTRL, LOW); #endif #endif @@ -130,10 +130,10 @@ namespace BATTERY_Utils { } #ifdef ADC_CTRL - #if defined(HELTEC_WIRELESS_TRACKER) || defined(HELTEC_WP) + #if defined(HELTEC_WIRELESS_TRACKER) digitalWrite(ADC_CTRL, LOW); #endif - #if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) + #if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WP) digitalWrite(ADC_CTRL, HIGH); #endif double inputDivider = (1.0 / (390.0 + 100.0)) * 100.0; // The voltage divider is a 390k + 100k resistor in series, 100k on the low side. From 9cc26ccdae345f7dd9f5d168f7caae60dd7bf575 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Sun, 18 Aug 2024 21:06:57 -0400 Subject: [PATCH 05/15] wireless paper battery reading fix --- src/battery_utils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/battery_utils.cpp b/src/battery_utils.cpp index a400739..74a1f12 100644 --- a/src/battery_utils.cpp +++ b/src/battery_utils.cpp @@ -136,7 +136,12 @@ namespace BATTERY_Utils { #if defined(HELTEC_V3) || defined(HELTEC_V2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WP) digitalWrite(ADC_CTRL, HIGH); #endif + + #ifdef HELTEC_WP + double inputDivider = (1.0 / (10.0 + 10.0)) * 10.0; // The voltage divider is a 10k + 10k resistor in series + #else double inputDivider = (1.0 / (390.0 + 100.0)) * 100.0; // The voltage divider is a 390k + 100k resistor in series, 100k on the low side. + #endif return (((sampleSum/100) * adcReadingTransformation) / inputDivider) + 0.285; // Yes, this offset is excessive, but the ADC on the ESP32s3 is quite inaccurate and noisy. Adjust to own measurements. #else #ifdef HAS_ADC_CALIBRATION From bd672857f405b107c1eafde1624e14fd2b815e31 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Mon, 19 Aug 2024 10:41:46 -0400 Subject: [PATCH 06/15] testing for external battery block --- src/battery_utils.cpp | 8 +++++--- src/configuration.cpp | 4 ++-- src/utils.cpp | 36 +++++++++++++++++++----------------- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/battery_utils.cpp b/src/battery_utils.cpp index 74a1f12..e64ec94 100644 --- a/src/battery_utils.cpp +++ b/src/battery_utils.cpp @@ -210,9 +210,11 @@ namespace BATTERY_Utils { shouldSleepLowVoltage = true; } #endif - if (Config.battery.monitorExternalVoltage && checkExternalVoltage() < Config.battery.externalSleepVoltage + 0.1) { - shouldSleepLowVoltage = true; - } + #ifndef HELTEC_WP + if (Config.battery.monitorExternalVoltage && checkExternalVoltage() < Config.battery.externalSleepVoltage + 0.1) { + shouldSleepLowVoltage = true; + } + #endif if (shouldSleepLowVoltage) { Utils::checkSleepByLowBatteryVoltage(0); } diff --git a/src/configuration.cpp b/src/configuration.cpp index 3714b3d..fbf56cc 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -137,8 +137,8 @@ bool Configuration::readFile() { beacon.comment = data["beacon"]["comment"] | "LoRa APRS"; beacon.interval = data["beacon"]["interval"] | 15; beacon.overlay = data["beacon"]["overlay"] | "L"; - beacon.symbol = data["beacon"]["symbol"] | "a"; - beacon.path = data["beacon"]["path"] | "WIDE1-1"; + beacon.symbol = data["beacon"]["symbol"] | "a"; + beacon.path = data["beacon"]["path"] | "WIDE1-1"; beacon.sendViaAPRSIS = data["beacon"]["sendViaAPRSIS"] | false; beacon.sendViaRF = data["beacon"]["sendViaRF"] | false; diff --git a/src/utils.cpp b/src/utils.cpp index 18cb8f5..c0fe460 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -152,24 +152,26 @@ namespace Utils { } #endif - if (Config.battery.sendExternalVoltage || Config.battery.monitorExternalVoltage) { - float externalVoltage = BATTERY_Utils::checkExternalVoltage(); - String externalVoltageInfo = String(externalVoltage,2) + "V"; - if (Config.battery.sendExternalVoltage) { - beaconPacket += " Ext="; - beaconPacket += externalVoltageInfo; - secondaryBeaconPacket += " Ext="; - secondaryBeaconPacket += externalVoltageInfo; - sixthLine = " (Ext V="; - sixthLine += externalVoltageInfo; - sixthLine += ")"; + #ifndef HELTEC_WP + if (Config.battery.sendExternalVoltage || Config.battery.monitorExternalVoltage) { + float externalVoltage = BATTERY_Utils::checkExternalVoltage(); + String externalVoltageInfo = String(externalVoltage,2) + "V"; + if (Config.battery.sendExternalVoltage) { + beaconPacket += " Ext="; + beaconPacket += externalVoltageInfo; + secondaryBeaconPacket += " Ext="; + secondaryBeaconPacket += externalVoltageInfo; + sixthLine = " (Ext V="; + sixthLine += externalVoltageInfo; + sixthLine += ")"; + } + if (Config.battery.monitorExternalVoltage && externalVoltage < Config.battery.externalSleepVoltage) { + beaconPacket += " **ExtBatWarning:SLEEP**"; + secondaryBeaconPacket += " **ExtBatWarning:SLEEP**"; + shouldSleepLowVoltage = true; + } } - if (Config.battery.monitorExternalVoltage && externalVoltage < Config.battery.externalSleepVoltage) { - beaconPacket += " **ExtBatWarning:SLEEP**"; - secondaryBeaconPacket += " **ExtBatWarning:SLEEP**"; - shouldSleepLowVoltage = true; - } - } + #endif if (Config.aprs_is.active && Config.beacon.sendViaAPRSIS && !backUpDigiMode) { displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0); From f4744eab6ad9b622311ba742a032aa698fc831f5 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Mon, 19 Aug 2024 11:37:55 -0400 Subject: [PATCH 07/15] Heltec Wireless Paper base --- README.md | 1 + src/LoRa_APRS_iGate.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fd43a9..0f8041d 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ __(This iGate Firmware works with all LoRa Tracker Firmwares (specially this Date: Tue, 20 Aug 2024 19:01:04 -0400 Subject: [PATCH 08/15] updated config --- src/configuration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configuration.cpp b/src/configuration.cpp index fbf56cc..ce7520b 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -150,7 +150,7 @@ bool Configuration::readFile() { aprs_is.messagesToRF = data["aprs_is"]["messagesToRF"] | false; aprs_is.objectsToRF = data["aprs_is"]["objectsToRF"] | false; - digi.mode = data["digi"]["mode"].as(); + digi.mode = data["digi"]["mode"] | 0; loramodule.txFreq = data["lora"]["txFreq"] | 433775000; loramodule.rxFreq = data["lora"]["rxFreq"] | 433775000; From 702f4abcbbec3a5fee984cee87d3547af80134c5 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Wed, 21 Aug 2024 19:11:05 -0400 Subject: [PATCH 09/15] update for gps beacon with timestamp --- src/LoRa_APRS_iGate.cpp | 2 +- src/utils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index 5094edc..4db000b 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -38,7 +38,7 @@ ________________________________________________________________________________ #include "A7670_utils.h" #endif -String versionDate = "2024.08.19"; +String versionDate = "2024.08.21"; Configuration Config; WiFiClient espClient; diff --git a/src/utils.cpp b/src/utils.cpp index c0fe460..838a7ff 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -246,7 +246,7 @@ namespace Utils { } else if (packet[firstColonIndex + 1] == '>') { sixthLine += "> NEW STATUS"; seventhLine = seventhLineHelper; - } else if (packet[firstColonIndex + 1] == '!' || packet[firstColonIndex + 1] == '=') { + } else if (packet[firstColonIndex + 1] == '!' || packet[firstColonIndex + 1] == '=' || packet[firstColonIndex + 1] == '@') { sixthLine += "> GPS BEACON"; if (!Config.syslog.active) { GPS_Utils::getDistanceAndComment(packet); // to be checked!!! From d5b666f458307538a28b431e5cba277059e6873a Mon Sep 17 00:00:00 2001 From: richonguzman Date: Thu, 22 Aug 2024 13:25:46 -0400 Subject: [PATCH 10/15] HELTEC WS update --- platformio.ini | 2 +- src/boards_pinout.h | 4 ++-- src/display.cpp | 2 +- src/power_utils.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index fa701a8..94b7480 100644 --- a/platformio.ini +++ b/platformio.ini @@ -93,7 +93,7 @@ lib_deps = adafruit/Adafruit SSD1306 @ 2.5.10 [env:heltec_wireless_stick] -board = heltec_wifi_lora_32_V3 +board = esp32-s3-devkitc-1 board_build.mcu = esp32s3 build_flags = -Werror -Wall diff --git a/src/boards_pinout.h b/src/boards_pinout.h index b565abb..c847cda 100644 --- a/src/boards_pinout.h +++ b/src/boards_pinout.h @@ -140,7 +140,7 @@ #define OLED_RST -1 // Reset pin # (or -1 if sharing Arduino reset pin) #endif -#ifdef HELTEC_V2 +#if defined(HELTEC_V2) #define OLED_SDA 4 #define OLED_SCL 15 #define OLED_RST 16 @@ -179,7 +179,7 @@ #define INTERNAL_LED_PIN 35 #define BATTERY_PIN 1 #define VEXT_CTRL 36 - #define ADC_CTRL 37 // Heltec WSL_V3 just like Heltec WT + #define ADC_CTRL 37 #define BOARD_I2C_SDA 41 #define BOARD_I2C_SCL 42 #ifdef HELTEC_WSL_V3_DISPLAY diff --git a/src/display.cpp b/src/display.cpp index 71a293f..60b596c 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -67,7 +67,7 @@ void displaySetup() { digitalWrite(OLED_RST, HIGH); #endif - #ifndef HELTEC_WSL_V3_DISPLAY + #if defined(HELTEC_WS) || defined(HELTEC_WSL_V3_DISPLAY) Wire.begin(OLED_SDA, OLED_SCL); #endif diff --git a/src/power_utils.cpp b/src/power_utils.cpp index f4e70a9..30ee7c8 100644 --- a/src/power_utils.cpp +++ b/src/power_utils.cpp @@ -167,7 +167,7 @@ namespace POWER_Utils { Wire.begin(BOARD_I2C_SDA, BOARD_I2C_SCL); #endif - #if defined(HELTEC_V3) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY) + #if defined(HELTEC_V3) || defined(HELTEC_WSL_V3) || defined(HELTEC_WP) || defined(HELTEC_WSL_V3_DISPLAY) Wire1.begin(BOARD_I2C_SDA, BOARD_I2C_SCL); #endif From 735988ee1cac626c924df0ce9d0cc4f285a76eab Mon Sep 17 00:00:00 2001 From: richonguzman Date: Thu, 22 Aug 2024 14:24:30 -0400 Subject: [PATCH 11/15] adding WEMOS S2 MINI --- platformio.ini | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platformio.ini b/platformio.ini index 94b7480..0d132bc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -392,6 +392,18 @@ lib_deps = adafruit/Adafruit GFX Library @ 1.11.9 adafruit/Adafruit SSD1306 @ 2.5.10 +[env:WEMOS_S2_MINI_DIY_LoRa] +board = wemos_d1_uno32 +build_flags = + -Werror -Wall + -DWEMOS_S2_MINI_DIY_LoRa + -DHAS_SX1278 + -DELEGANTOTA_USE_ASYNC_WEBSERVER=1 +lib_deps = + ${common.lib_deps} + adafruit/Adafruit GFX Library @ 1.11.9 + adafruit/Adafruit SSD1306 @ 2.5.10 + [env:esp32c3_DIY_1W_LoRa] board = esp32-c3-devkitm-1 board_build.mcu = esp32c3 From 5cbdd318a29f7423b10734ba59c2766e9ee71016 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Thu, 22 Aug 2024 15:00:56 -0400 Subject: [PATCH 12/15] test for WEMOS S2 Mini DIY LORA --- src/boards_pinout.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/boards_pinout.h b/src/boards_pinout.h index c847cda..e836200 100644 --- a/src/boards_pinout.h +++ b/src/boards_pinout.h @@ -132,6 +132,15 @@ #define RADIO_TXEN 7 #endif +#ifdef WEMOS_S2_MINI_DIY_LoRa + #define RADIO_SCLK_PIN 36 + #define RADIO_MISO_PIN 37 + #define RADIO_MOSI_PIN 35 + #define RADIO_CS_PIN 34 + #define RADIO_BUSY_PIN 38 + #define RADIO_RST_PIN 33 +#endif + // OLED #if defined(TTGO_T_LORA32_V2_1) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(OE5HWN_MeshCom) || defined(ESP32_DIY_LoRa_A7670) || defined(TTGO_T_LORA32_V2_1_915) || defined(ESP32_DIY_LoRa_915) || defined(TTGO_T_Beam_V1_0_915) || defined(TTGO_T_Beam_V1_2_915) || defined(ESP32_DIY_LoRa_A7670_915) || defined(ESP32_DIY_1W_LoRa_915) || defined(ESP32_DIY_1W_LoRa_Mesh_V1_2) @@ -158,7 +167,7 @@ #define OLED_RST -1 #endif -#if !defined(HELTEC_HTCT62) && !defined(HELTEC_WSL_V3) && !defined(ESP32C3_DIY_1W_LoRa) && !defined(ESP32C3_DIY_1W_LoRa_915) +#if !defined(HELTEC_HTCT62) && !defined(HELTEC_WSL_V3) && !defined(ESP32C3_DIY_1W_LoRa) && !defined(ESP32C3_DIY_1W_LoRa_915) && !defined(WEMOS_S2_MINI_DIY_LoRa) #define HAS_DISPLAY #endif @@ -179,7 +188,7 @@ #define INTERNAL_LED_PIN 35 #define BATTERY_PIN 1 #define VEXT_CTRL 36 - #define ADC_CTRL 37 + #define ADC_CTRL 37 #define BOARD_I2C_SDA 41 #define BOARD_I2C_SCL 42 #ifdef HELTEC_WSL_V3_DISPLAY From ea426f412692f4ed80c8c1dec6da72cd65b8897c Mon Sep 17 00:00:00 2001 From: richonguzman Date: Thu, 22 Aug 2024 16:27:41 -0400 Subject: [PATCH 13/15] board update --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 0d132bc..bb94358 100644 --- a/platformio.ini +++ b/platformio.ini @@ -393,7 +393,7 @@ lib_deps = adafruit/Adafruit SSD1306 @ 2.5.10 [env:WEMOS_S2_MINI_DIY_LoRa] -board = wemos_d1_uno32 +board = lolin_s2_mini build_flags = -Werror -Wall -DWEMOS_S2_MINI_DIY_LoRa From 46e5bdd21e4076b7d33e136eca97f0411f02b4b5 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Fri, 23 Aug 2024 18:00:25 -0400 Subject: [PATCH 14/15] added led --- src/boards_pinout.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/boards_pinout.h b/src/boards_pinout.h index e836200..00275dc 100644 --- a/src/boards_pinout.h +++ b/src/boards_pinout.h @@ -175,6 +175,9 @@ #ifdef HELTEC_HTCT62 #define BATTERY_PIN 1 #endif +#ifdef WEMOS_S2_MINI_DIY_LoRa + #define INTERNAL_LED_PIN 15 +#endif #if defined(TTGO_T_LORA32_V2_1) || defined(TTGO_T_LORA32_V2_1_915) #define INTERNAL_LED_PIN 25 // Green Led #define BATTERY_PIN 35 From 643a18f40ca952345755181f674692aabe0d124d Mon Sep 17 00:00:00 2001 From: richonguzman Date: Fri, 23 Aug 2024 18:05:27 -0400 Subject: [PATCH 15/15] Wemos S2 Mini DIY LoRa added --- .github/workflows/build.yml | 13 +++++++++++++ README.md | 1 + 2 files changed, 14 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d3c464..ed4557f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,6 +61,8 @@ jobs: chip: esp32 - name: WEMOS-D1-R32-RA02 chip: esp32 + - name: WEMOS_S2_MINI_DIY_LoRa + chip: esp32s2 - name: esp32c3_DIY_1W_LoRa chip: esp32c3 - name: esp32c3_DIY_1W_LoRa_915 @@ -108,6 +110,17 @@ jobs: 0xe000 installer/firmware/boot_app0.bin \ 0x10000 installer/firmware/firmware.bin \ 0x3D0000 installer/firmware/spiffs.bin + elif [ "${{ matrix.target.chip }}" == "esp32s2" ]; then + python installer/bin/esptool/esptool.py --chip esp32s2 merge_bin \ + -o installer/web_factory.bin \ + --flash_mode dio \ + --flash_freq 40m \ + --flash_size 4MB \ + 0x1000 installer/firmware/bootloader.bin \ + 0x8000 installer/firmware/partitions.bin \ + 0xe000 installer/firmware/boot_app0.bin \ + 0x10000 installer/firmware/firmware.bin \ + 0x3D0000 installer/firmware/spiffs.bin elif [ "${{ matrix.target.chip }}" == "esp32s3" ]; then python installer/bin/esptool/esptool.py --chip esp32s3 merge_bin \ -o installer/web_factory.bin \ diff --git a/README.md b/README.md index 0f8041d..510c252 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ __(This iGate Firmware works with all LoRa Tracker Firmwares (specially this