From 3d7dea0606ee6baa3500910b9e80481b15b405d9 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 13 Nov 2022 09:45:16 -0600 Subject: [PATCH 1/6] Added support for Heltec V3 --- protobufs | 2 +- src/mesh/generated/mesh.pb.h | 4 ++++ src/platform/esp32/architecture.h | 2 ++ variants/heltec_v3/platformio.ini | 9 ++++++++ variants/heltec_v3/variant.h | 34 +++++++++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 variants/heltec_v3/platformio.ini create mode 100644 variants/heltec_v3/variant.h diff --git a/protobufs b/protobufs index 5b892e4c..2563c546 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 5b892e4c196f8620f2009cdef219eb2c237cc636 +Subproject commit 2563c546cbe50a1538c11a9e879335ddf409e45c diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 8e73a097..8d96960d 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -78,6 +78,10 @@ typedef enum _HardwareModel { HardwareModel_DR_DEV = 41, /* M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ */ HardwareModel_M5STACK = 42, + /* New Heltec LoRA32 with ESP32-S3 CPU */ + HardwareModel_HELTEC_V3 = 43, + /* New Heltec Wireless Stick Lite with ESP32-S3 CPU */ + HardwareModel_HELTEC_WSL_V3 = 44, /* 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. */ HardwareModel_PRIVATE_HW = 255 } HardwareModel; diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 00d22169..f51b6237 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -84,6 +84,8 @@ #define HW_VENDOR HardwareModel_STATION_G1 #elif defined(DR_DEV) #define HW_VENDOR HardwareModel_DR_DEV +#elif defined(HELTEC_V3) + #define HW_VENDOR HardwareModel_HELTEC_V3 #endif // diff --git a/variants/heltec_v3/platformio.ini b/variants/heltec_v3/platformio.ini new file mode 100644 index 00000000..6cd75bed --- /dev/null +++ b/variants/heltec_v3/platformio.ini @@ -0,0 +1,9 @@ +[env:heltec-v3] +platform = https://github.com/Baptou88/platform-espressif32.git +extends = esp32_base +board = heltec_wifi_lora_32_V3 +# Temporary: https://community.platformio.org/t/heltec-esp32-lora-v3-board-support/30406/2 +platform_packages = + framework-arduinoespressif32@https://github.com/Baptou88/arduino-esp32.git +build_flags = + ${esp32s3_base.build_flags} -D HELTEC_V3 -I variants/heltec_v3 diff --git a/variants/heltec_v3/variant.h b/variants/heltec_v3/variant.h new file mode 100644 index 00000000..a15a2487 --- /dev/null +++ b/variants/heltec_v3/variant.h @@ -0,0 +1,34 @@ +#define LED_PIN LED + +#define RESET_OLED RST_OLED +#define I2C_SDA SDA_OLED // I2C pins for this board +#define I2C_SCL SCL_OLED + +#define VEXT_ENABLE Vext // active low, powers the oled display and the lora antenna boost +#define BUTTON_PIN 0 + +#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage + +#define USE_SX1262 +#define ADC_MULTIPLIER 5.22 + +#define LORA_DIO0 -1 // a No connect on the SX1262 module +#define LORA_RESET 12 +#define LORA_DIO1 14 // SX1262 IRQ +#define LORA_DIO2 13 // SX1262 BUSY +#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled + +#define RF95_SCK 9 +#define RF95_MISO 11 +#define RF95_MOSI 10 +#define RF95_NSS 8 + +#ifdef USE_SX1262 +#define SX126X_CS RF95_NSS +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +#define SX126X_E22 +#endif + + From f22c2e768e3ebfbd36a867ac4006a8f6e15dc19a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 13 Nov 2022 09:47:55 -0600 Subject: [PATCH 2/6] Reorder --- variants/heltec_v3/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/heltec_v3/variant.h b/variants/heltec_v3/variant.h index a15a2487..5a8cad72 100644 --- a/variants/heltec_v3/variant.h +++ b/variants/heltec_v3/variant.h @@ -8,9 +8,9 @@ #define BUTTON_PIN 0 #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage +#define ADC_MULTIPLIER 5.22 #define USE_SX1262 -#define ADC_MULTIPLIER 5.22 #define LORA_DIO0 -1 // a No connect on the SX1262 module #define LORA_RESET 12 From 33cd5ce6c1ec2a928e8caff0faa1d63b44e8e8f5 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 13 Nov 2022 09:48:38 -0600 Subject: [PATCH 3/6] Cleanup --- protobufs | 2 +- variants/heltec_v3/variant.h | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/protobufs b/protobufs index 2563c546..3a7a4fa3 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 2563c546cbe50a1538c11a9e879335ddf409e45c +Subproject commit 3a7a4fa3cbd678b814964c0b4fc3af87ade7ec2e diff --git a/variants/heltec_v3/variant.h b/variants/heltec_v3/variant.h index 5a8cad72..ee5f5519 100644 --- a/variants/heltec_v3/variant.h +++ b/variants/heltec_v3/variant.h @@ -23,12 +23,8 @@ #define RF95_MOSI 10 #define RF95_NSS 8 -#ifdef USE_SX1262 #define SX126X_CS RF95_NSS #define SX126X_DIO1 LORA_DIO1 #define SX126X_BUSY LORA_DIO2 #define SX126X_RESET LORA_RESET -#define SX126X_E22 -#endif - - +#define SX126X_E22 \ No newline at end of file From 8d4c526d161ba50bb4953b603498076eb689454e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 13 Nov 2022 13:28:02 -0600 Subject: [PATCH 4/6] Add Heltec Wireless Stick Lite V3 support --- src/platform/esp32/architecture.h | 2 ++ variants/heltec_v3/variant.h | 2 ++ variants/heltec_wsl_v3/platformio.ini | 9 +++++++++ variants/heltec_wsl_v3/variant.h | 29 +++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 variants/heltec_wsl_v3/platformio.ini create mode 100644 variants/heltec_wsl_v3/variant.h diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index f51b6237..f80008ca 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -86,6 +86,8 @@ #define HW_VENDOR HardwareModel_DR_DEV #elif defined(HELTEC_V3) #define HW_VENDOR HardwareModel_HELTEC_V3 +#elif defined(HELTEC_WSL_V3) + #define HW_VENDOR HardwareModel_HELTEC_WSL_V3 #endif // diff --git a/variants/heltec_v3/variant.h b/variants/heltec_v3/variant.h index ee5f5519..b278704d 100644 --- a/variants/heltec_v3/variant.h +++ b/variants/heltec_v3/variant.h @@ -1,5 +1,7 @@ #define LED_PIN LED +#define HAS_GPS 0 + #define RESET_OLED RST_OLED #define I2C_SDA SDA_OLED // I2C pins for this board #define I2C_SCL SCL_OLED diff --git a/variants/heltec_wsl_v3/platformio.ini b/variants/heltec_wsl_v3/platformio.ini new file mode 100644 index 00000000..8854b1a4 --- /dev/null +++ b/variants/heltec_wsl_v3/platformio.ini @@ -0,0 +1,9 @@ +[env:heltec-wsl-v3] +platform = https://github.com/Baptou88/platform-espressif32.git +extends = esp32_base +board = heltec_wifi_lora_32_V3 +# Temporary: https://community.platformio.org/t/heltec-esp32-lora-v3-board-support/30406/2 +platform_packages = + framework-arduinoespressif32@https://github.com/Baptou88/arduino-esp32.git +build_flags = + ${esp32s3_base.build_flags} -D HELTEC_WSL_V3 -I variants/heltec_wsl_v3 diff --git a/variants/heltec_wsl_v3/variant.h b/variants/heltec_wsl_v3/variant.h new file mode 100644 index 00000000..60f61124 --- /dev/null +++ b/variants/heltec_wsl_v3/variant.h @@ -0,0 +1,29 @@ +#define LED_PIN LED + +#define HAS_SCREEN 0 +#define HAS_GPS 0 + +#define VEXT_ENABLE Vext // active low, powers the oled display and the lora antenna boost +#define BUTTON_PIN 0 + +#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage +#define ADC_MULTIPLIER 5.22 + +#define USE_SX1262 + +#define LORA_DIO0 -1 // a No connect on the SX1262 module +#define LORA_RESET 12 +#define LORA_DIO1 14 // SX1262 IRQ +#define LORA_DIO2 13 // SX1262 BUSY +#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled + +#define RF95_SCK 9 +#define RF95_MISO 11 +#define RF95_MOSI 10 +#define RF95_NSS 8 + +#define SX126X_CS RF95_NSS +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +#define SX126X_E22 \ No newline at end of file From 9b5f3588233df38e53b97fa6fa58d6c8a8cca052 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 13 Nov 2022 14:30:32 -0600 Subject: [PATCH 5/6] Add new heltec targets --- .github/workflows/main_matrix.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 15a372f2..5ec4854d 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -87,6 +87,8 @@ jobs: - board: heltec-v1 - board: heltec-v2.0 - board: heltec-v2.1 + - board: heltec-v3 + - board: heltec-wsl-v3 - board: tbeam0.7 - board: meshtastic-diy-v1 - board: meshtastic-dr-dev From c3c899bc85f861ffe48f25a49c506ae20f7c31f8 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 13 Nov 2022 14:45:26 -0600 Subject: [PATCH 6/6] Upstream protos for resolving conflicts --- protobufs | 2 +- src/mesh/generated/telemetry.pb.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/protobufs b/protobufs index 3a7a4fa3..da9bba9c 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 3a7a4fa3cbd678b814964c0b4fc3af87ade7ec2e +Subproject commit da9bba9c5dd43a98d431cb7a95159b145f0483c4 diff --git a/src/mesh/generated/telemetry.pb.h b/src/mesh/generated/telemetry.pb.h index 38f4f9ca..8c5c68bf 100644 --- a/src/mesh/generated/telemetry.pb.h +++ b/src/mesh/generated/telemetry.pb.h @@ -33,7 +33,9 @@ typedef enum _TelemetrySensorType { /* 3-Axis magnetic sensor */ TelemetrySensorType_QMC6310 = 9, /* 6-Axis inertial measurement sensor */ - TelemetrySensorType_QMI8658 = 10 + TelemetrySensorType_QMI8658 = 10, + /* 3-Axis magnetic sensor */ + TelemetrySensorType_QMC5883L = 11 } TelemetrySensorType; /* Struct definitions */ @@ -85,8 +87,8 @@ typedef struct _Telemetry { /* Helper constants for enums */ #define _TelemetrySensorType_MIN TelemetrySensorType_SENSOR_UNSET -#define _TelemetrySensorType_MAX TelemetrySensorType_QMI8658 -#define _TelemetrySensorType_ARRAYSIZE ((TelemetrySensorType)(TelemetrySensorType_QMI8658+1)) +#define _TelemetrySensorType_MAX TelemetrySensorType_QMC5883L +#define _TelemetrySensorType_ARRAYSIZE ((TelemetrySensorType)(TelemetrySensorType_QMC5883L+1)) #ifdef __cplusplus