From c531ea86014a7e88cdf0f0bdcca6a56f8e855ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 30 Dec 2021 22:16:46 +0100 Subject: [PATCH 1/5] new Configuration section --- src/configuration.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/configuration.h b/src/configuration.h index 597f60094..473a92114 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -323,6 +323,41 @@ along with this program. If not, see . #endif +#elif defined(ARDUINO_HELTEC_WIFI_LORA_32) + +// the default ESP32 Pin of 15 is the Oled SCL, set to 36 and 37 and works fine. +// Tested on Neo6m module. +#undef GPS_RX_PIN +#undef GPS_TX_PIN +#define GPS_RX_PIN 36 +#define GPS_TX_PIN 37 + +#ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag +#define I2C_SDA 4 // I2C pins for this board +#define I2C_SCL 15 +#endif + +#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller + +#define LED_PIN 25 // If defined we will blink this LED +#define BUTTON_PIN 0 // If defined, this will be used for user button presses + +#define USE_RF95 +#define LORA_DIO0 26 // a No connect on the SX1262 module +#ifndef USE_JTAG +#define LORA_RESET 14 +#endif +#define LORA_DIO1 33 // Not really used +#define LORA_DIO2 32 // Not really used + +// ratio of voltage divider = 3.20 (R1=100k, R2=220k) +#define ADC_MULTIPLIER 3.2 + +// This string must exactly match the case used in release file names or the android updater won't work +#define HW_VENDOR HardwareModel_HELTEC_V1 + +#define BATTERY_PIN 13 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage + #elif defined(TLORA_V1) // This string must exactly match the case used in release file names or the android updater won't work #define HW_VENDOR HardwareModel_TLORA_V1 From 9c7121df3e9f05e97ec0e2607ef26ce810574ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 30 Dec 2021 22:18:08 +0100 Subject: [PATCH 2/5] Update platformio.ini add new board to platform.io definition --- platformio.ini | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platformio.ini b/platformio.ini index 1d35ddeb9..9c301ea33 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,6 +12,7 @@ default_envs = tbeam ;default_envs = tbeam0.7 ;default_envs = heltec-v2.0 +;default_envs = heltec-v1 ;default_envs = tlora-v1 ;default_envs = tlora_v1_3 ;default_envs = tlora-v2 @@ -158,6 +159,13 @@ board = ttgo-t-beam build_flags = ${esp32_base.build_flags} -D TBEAM_V07 +[env:heltec-v1] +;build_type = debug ; to make it possible to step through our jtag debugger +extends = esp32_base +board = heltec_wifi_lora_32 +build_flags = + ${esp32_base.build_flags} -D HELTEC_V1 + [env:heltec-v2.0] ;build_type = debug ; to make it possible to step through our jtag debugger extends = esp32_base From e24a2116d836c0dd2c5fdb9d0ac6ae139072c2d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 30 Dec 2021 22:19:04 +0100 Subject: [PATCH 3/5] build the new board with build_all --- bin/build-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build-all.sh b/bin/build-all.sh index 922fd4b7d..1cf83c62f 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -5,7 +5,7 @@ set -e VERSION=`bin/buildinfo.py long` SHORT_VERSION=`bin/buildinfo.py short` -BOARDS_ESP32="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1" +BOARDS_ESP32="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1" #BOARDS_ESP32=tbeam # FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine From 20497335c27983a78cf3e829ce2452e3df88879a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 30 Dec 2021 22:20:15 +0100 Subject: [PATCH 4/5] stop old chip from crashing --- src/sleep.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sleep.cpp b/src/sleep.cpp index 558dbf1d4..998645dcd 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -65,7 +65,11 @@ void setCPUFast(bool on) return; } - setCpuFrequencyMhz(on ? 240 : 80); + // The Heltec LORA32 V1 runs at 26 MHz base frequency and doesn't react well to switching to 80 MHz... + #ifndef ARDUINO_HELTEC_WIFI_LORA_32 + setCpuFrequencyMhz(on ? 240 : 80); + #endif + #endif } From 3857dd7e5228d45953ce648b7df7edd2accee67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 2 Jan 2022 14:41:41 +0100 Subject: [PATCH 5/5] regen protobuf headers --- src/mesh/generated/mesh.pb.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 27e7d53cd..c5c980a35 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -23,6 +23,7 @@ typedef enum _HardwareModel { HardwareModel_TLORA_V1_1p3 = 8, HardwareModel_RAK4631 = 9, HardwareModel_HELTEC_V2_1 = 10, + HardwareModel_HELTEC_V1 = 11, HardwareModel_LORA_RELAY_V1 = 32, HardwareModel_NRF52840DK = 33, HardwareModel_PPR = 34,