From f6e5ed42b2c116123dd3286366288fa5cca4e7cd Mon Sep 17 00:00:00 2001 From: BigDurl Date: Tue, 19 Nov 2024 22:11:03 -0600 Subject: [PATCH 1/9] Changed LoRa default to off --- include/screen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/screen.h b/include/screen.h index 830267c2..796a59ab 100644 --- a/include/screen.h +++ b/include/screen.h @@ -360,7 +360,7 @@ class Screen : public GFXBase SSD1306Screen(int w, int h) : Screen(w, h) { - Heltec.begin(true /*DisplayEnable Enable*/, true /*LoRa Disable*/, false /*Serial Enable*/); + Heltec.begin(true /*DisplayEnable Enable*/, true /*LoRa Enable*/, false /*Serial Enable*/); Heltec.display->screenRotate(ANGLE_180_DEGREE); } From 662e8f328214efc73cbb8bf5b7d56ec61c9a99f1 Mon Sep 17 00:00:00 2001 From: BigDurl Date: Tue, 19 Nov 2024 22:14:07 -0600 Subject: [PATCH 2/9] Added helteclorav3demo Added demo env for heltec wifi lora v3 Is messy and kind of hacked together --- platformio.ini | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index 1c4b752c..a82c4e5d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -19,7 +19,7 @@ ; mesmerizer HUB75 info panel with audio effects, weather, info, etc, [platformio] -default_envs = +default_envs = helteclorav3demo build_cache_dir = .pio/build_cache extra_configs = custom_*.ini ; This file can be created in the root directory to store user defined devices and environments. @@ -30,8 +30,8 @@ extra_configs = ; Options that are used (or extended) in all device sections (and hence environments) are defined here [base] -upload_port = -monitor_port = +upload_port = COM7 +monitor_port = COM7 build_type = release upload_speed = 2000000 build_flags = -std=gnu++2a @@ -127,7 +127,16 @@ build_flags = -DARDUINO_HELTEC_WIFI_KIT_32_V2=1 extends = dev_heltec_wifi board = heltec_wifi_kit_32_V3 build_flags = -DARDUINO_HELTEC_WIFI_KIT_32_V3=1 - -DWIFI_Kit_32=1 + -DWIFI_Kit_32_V3=1 + ${dev_heltec_wifi.build_flags} +lib_deps = ${dev_heltec_wifi.lib_deps} + heltecautomation/Heltec ESP32 Dev-Boards @ ^1.1.1 + +[dev_heltec_wifi_lora_v3] +extends = dev_heltec_wifi +board = heltec_wifi_lora_32_V3 +build_flags = -DARDUINO_HELTEC_WIFI_LoRa_32_V3=1 + -DWIFI_LoRa_32_V3=1 ${dev_heltec_wifi.build_flags} lib_deps = ${dev_heltec_wifi.lib_deps} heltecautomation/Heltec ESP32 Dev-Boards @ ^1.1.1 @@ -394,6 +403,15 @@ build_flags = -DDEMO=1 -DUSE_SSD1306=1 ${dev_heltec_wifi_v3.build_flags} +; Heltec LoRa V3 board, which is an S3 with USB-C and LoRa +[env:helteclorav3demo] +extends = dev_heltec_wifi_lora_v3 +build_flags = -DDEMO=1 + -DENABLE_WIFI=1 + -DUSE_SSD1306=1 + ;-DUSE_OLED=1 + ${dev_heltec_wifi_lora_v3.build_flags} + ; LILYGO T-Display-S3 [env:lilygo-tdisplay-s3-demo] extends = dev_lilygo-tdisplay-s3 From 8b48c78620a83a964e6e1d75c643683d39b9a45b Mon Sep 17 00:00:00 2001 From: BigDurl Date: Tue, 19 Nov 2024 22:23:05 -0600 Subject: [PATCH 3/9] cleanup after adding helteclorav3demo --- platformio.ini | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index a82c4e5d..53385ce3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -19,7 +19,7 @@ ; mesmerizer HUB75 info panel with audio effects, weather, info, etc, [platformio] -default_envs = helteclorav3demo +default_envs = build_cache_dir = .pio/build_cache extra_configs = custom_*.ini ; This file can be created in the root directory to store user defined devices and environments. @@ -30,8 +30,8 @@ extra_configs = ; Options that are used (or extended) in all device sections (and hence environments) are defined here [base] -upload_port = COM7 -monitor_port = COM7 +upload_port = +monitor_port = build_type = release upload_speed = 2000000 build_flags = -std=gnu++2a @@ -409,7 +409,6 @@ extends = dev_heltec_wifi_lora_v3 build_flags = -DDEMO=1 -DENABLE_WIFI=1 -DUSE_SSD1306=1 - ;-DUSE_OLED=1 ${dev_heltec_wifi_lora_v3.build_flags} ; LILYGO T-Display-S3 From 4080694476bc73fc84bf64704141c20c67559b5d Mon Sep 17 00:00:00 2001 From: BigDurl Date: Tue, 19 Nov 2024 22:27:11 -0600 Subject: [PATCH 4/9] Update screen.h --- include/screen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/screen.h b/include/screen.h index 796a59ab..9ae04dd8 100644 --- a/include/screen.h +++ b/include/screen.h @@ -360,7 +360,7 @@ class Screen : public GFXBase SSD1306Screen(int w, int h) : Screen(w, h) { - Heltec.begin(true /*DisplayEnable Enable*/, true /*LoRa Enable*/, false /*Serial Enable*/); + Heltec.begin(true /*DisplayEnable Enable*/, false /*LoRa Enable*/, false /*Serial Enable*/); Heltec.display->screenRotate(ANGLE_180_DEGREE); } From 9882e66495d6a8e7ec6e8a081284ffd7bf4b60e4 Mon Sep 17 00:00:00 2001 From: BigDurl Date: Wed, 20 Nov 2024 14:55:21 -0600 Subject: [PATCH 5/9] Set Correct pins for OLED Set the correct pins for the OLED screen on the Heltec Wifi Lora V3 Board --- include/screen.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/screen.h b/include/screen.h index 9ae04dd8..97dd3c50 100644 --- a/include/screen.h +++ b/include/screen.h @@ -314,8 +314,11 @@ class Screen : public GFXBase U8G2_SSD1306_128X64_NONAME_F_HW_I2C oled; public: - - OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R2, /*reset*/ 16, /*clk*/ 15, /*data*/ 4) + #if ARDUINO_HELTEC_WIFI_LoRa_32_V3 + OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R0, /*reset*/ 21, /*clk*/ 18, /*data*/ 17) + #else + OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R2, /*reset*/ 16, /*clk*/ 15, /*data*/ 4) + #endif { oled.begin(); oled.clear(); From 17c785524378449d810b26299d642530c0008eff Mon Sep 17 00:00:00 2001 From: BigDurl Date: Wed, 20 Nov 2024 15:19:41 -0600 Subject: [PATCH 6/9] Added Color Compatibility Change backColor from 0,0,64 to 0,0,0 when using Heltec Wifi Lora V3 for compatibility with built-in OLED --- src/screen.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/screen.cpp b/src/screen.cpp index 75991371..a258d532 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -251,7 +251,11 @@ void CurrentEffectSummary(bool bRedraw) if (bRedraw) display.fillScreen(BLACK16); - uint16_t backColor = Screen::to16bit(CRGB(0, 0, 64)); + #if ARDUINO_HELTEC_WIFI_LoRa_32_V3 + uint16_t backColor = Screen::to16bit(CRGB(0, 0, 0)); + #else + uint16_t backColor = Screen::to16bit(CRGB(0, 0, 64)); + #endif // We only draw after a page flip or if anything has changed about the information that will be // shown in the page. This avoids flicker, but at the cost that we have to remember what we displayed From 04c7245980a1d458ad171779e56449cd853998cf Mon Sep 17 00:00:00 2001 From: BigDurl Date: Wed, 20 Nov 2024 16:05:46 -0600 Subject: [PATCH 7/9] Added SCREEN_ROTATION definition option --- include/screen.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/screen.h b/include/screen.h index 97dd3c50..cd31dbef 100644 --- a/include/screen.h +++ b/include/screen.h @@ -315,7 +315,7 @@ class Screen : public GFXBase public: #if ARDUINO_HELTEC_WIFI_LoRa_32_V3 - OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R0, /*reset*/ 21, /*clk*/ 18, /*data*/ 17) + OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R2, /*reset*/ 21, /*clk*/ 18, /*data*/ 17) #else OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R2, /*reset*/ 16, /*clk*/ 15, /*data*/ 4) #endif @@ -364,7 +364,9 @@ class Screen : public GFXBase SSD1306Screen(int w, int h) : Screen(w, h) { Heltec.begin(true /*DisplayEnable Enable*/, false /*LoRa Enable*/, false /*Serial Enable*/); - Heltec.display->screenRotate(ANGLE_180_DEGREE); + #ifdef SCREEN_ROTATION + Heltec.display->screenRotate(SCREEN_ROTATION); + #endif } virtual void StartFrame() override From 6c380e350ea44ca5ffe4edffcd69b9617577774f Mon Sep 17 00:00:00 2001 From: BigDurl Date: Thu, 21 Nov 2024 17:11:00 -0600 Subject: [PATCH 8/9] Fixed capitalization error --- include/screen.h | 2 +- platformio.ini | 2 +- src/screen.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/screen.h b/include/screen.h index cd31dbef..e3822bd3 100644 --- a/include/screen.h +++ b/include/screen.h @@ -314,7 +314,7 @@ class Screen : public GFXBase U8G2_SSD1306_128X64_NONAME_F_HW_I2C oled; public: - #if ARDUINO_HELTEC_WIFI_LoRa_32_V3 + #if ARDUINO_HELTEC_WIFI_LORA_32_V3 OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R2, /*reset*/ 21, /*clk*/ 18, /*data*/ 17) #else OLEDScreen(int w, int h) : Screen(w, h), oled(U8G2_R2, /*reset*/ 16, /*clk*/ 15, /*data*/ 4) diff --git a/platformio.ini b/platformio.ini index 53385ce3..7cee558f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -135,7 +135,7 @@ lib_deps = ${dev_heltec_wifi.lib_deps} [dev_heltec_wifi_lora_v3] extends = dev_heltec_wifi board = heltec_wifi_lora_32_V3 -build_flags = -DARDUINO_HELTEC_WIFI_LoRa_32_V3=1 +build_flags = -DARDUINO_HELTEC_WIFI_LORA_32_V3=1 -DWIFI_LoRa_32_V3=1 ${dev_heltec_wifi.build_flags} lib_deps = ${dev_heltec_wifi.lib_deps} diff --git a/src/screen.cpp b/src/screen.cpp index a258d532..28a4721c 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -251,7 +251,7 @@ void CurrentEffectSummary(bool bRedraw) if (bRedraw) display.fillScreen(BLACK16); - #if ARDUINO_HELTEC_WIFI_LoRa_32_V3 + #if ARDUINO_HELTEC_WIFI_LORA_32_V3 uint16_t backColor = Screen::to16bit(CRGB(0, 0, 0)); #else uint16_t backColor = Screen::to16bit(CRGB(0, 0, 64)); From 073e4ffb8b2cc9bb7254a6041ae20da4f2bed754 Mon Sep 17 00:00:00 2001 From: Rutger van Bergen Date: Sat, 23 Nov 2024 12:37:39 +0100 Subject: [PATCH 9/9] Update use of Heltec WiFi Kit/LoRa V3 defines --- include/screen.h | 4 ++-- platformio.ini | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/screen.h b/include/screen.h index e3822bd3..2d133d96 100644 --- a/include/screen.h +++ b/include/screen.h @@ -364,8 +364,8 @@ class Screen : public GFXBase SSD1306Screen(int w, int h) : Screen(w, h) { Heltec.begin(true /*DisplayEnable Enable*/, false /*LoRa Enable*/, false /*Serial Enable*/); - #ifdef SCREEN_ROTATION - Heltec.display->screenRotate(SCREEN_ROTATION); + #if ROTATE_SCREEN + Heltec.display->screenRotate(ANGLE_180_DEGREE); #endif } diff --git a/platformio.ini b/platformio.ini index 7cee558f..d3400da1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -127,7 +127,7 @@ build_flags = -DARDUINO_HELTEC_WIFI_KIT_32_V2=1 extends = dev_heltec_wifi board = heltec_wifi_kit_32_V3 build_flags = -DARDUINO_HELTEC_WIFI_KIT_32_V3=1 - -DWIFI_Kit_32_V3=1 + -DUSE_SSD1306=1 ${dev_heltec_wifi.build_flags} lib_deps = ${dev_heltec_wifi.lib_deps} heltecautomation/Heltec ESP32 Dev-Boards @ ^1.1.1 @@ -136,7 +136,7 @@ lib_deps = ${dev_heltec_wifi.lib_deps} extends = dev_heltec_wifi board = heltec_wifi_lora_32_V3 build_flags = -DARDUINO_HELTEC_WIFI_LORA_32_V3=1 - -DWIFI_LoRa_32_V3=1 + -DUSE_SSD1306=1 ${dev_heltec_wifi.build_flags} lib_deps = ${dev_heltec_wifi.lib_deps} heltecautomation/Heltec ESP32 Dev-Boards @ ^1.1.1 @@ -400,7 +400,7 @@ build_flags = -DDEMO=1 extends = dev_heltec_wifi_v3 build_flags = -DDEMO=1 -DENABLE_WIFI=1 - -DUSE_SSD1306=1 + -DROTATE_SCREEN=1 ${dev_heltec_wifi_v3.build_flags} ; Heltec LoRa V3 board, which is an S3 with USB-C and LoRa @@ -408,7 +408,6 @@ build_flags = -DDEMO=1 extends = dev_heltec_wifi_lora_v3 build_flags = -DDEMO=1 -DENABLE_WIFI=1 - -DUSE_SSD1306=1 ${dev_heltec_wifi_lora_v3.build_flags} ; LILYGO T-Display-S3