From 501067cd36cfc20a7b711c4a60430b1126240a0f Mon Sep 17 00:00:00 2001 From: amerinoj <60507916+amerinoj@users.noreply.github.com> Date: Fri, 25 Mar 2022 13:24:56 +0100 Subject: [PATCH 1/2] Added the last mac address bytes in bluetooth device and default notification pinout to tlora_v2_1_16 (#1320) * Added the last mac address bytes in bluetooth device name ESP32Bluetooth.cpp Add default notification pinout to tlora_v2_1_16/variant.h * updated ADC_MULTIPLIER value for more accuracy --- src/esp32/ESP32Bluetooth.cpp | 2 +- variants/tlora_v2_1_16/variant.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/esp32/ESP32Bluetooth.cpp b/src/esp32/ESP32Bluetooth.cpp index b7e8d47aa..1816e7f6d 100644 --- a/src/esp32/ESP32Bluetooth.cpp +++ b/src/esp32/ESP32Bluetooth.cpp @@ -170,7 +170,7 @@ void ESP32Bluetooth::setup() //NimBLEDevice::deleteAllBonds(); - NimBLEDevice::init("Meshtastic_1234"); + NimBLEDevice::init(getDeviceName()); NimBLEDevice::setPower(ESP_PWR_LVL_P9); NimBLEDevice::setSecurityAuth(true, true, true); diff --git a/variants/tlora_v2_1_16/variant.h b/variants/tlora_v2_1_16/variant.h index 1a888b46f..958127b76 100644 --- a/variants/tlora_v2_1_16/variant.h +++ b/variants/tlora_v2_1_16/variant.h @@ -3,9 +3,11 @@ #define GPS_RX_PIN 15 // per @der_bear on the forum, 36 is incorrect for this board type and 15 is a better pick #define GPS_TX_PIN 13 +#define EXT_NOTIFY_OUT 2 // Default pin to use for Ext Notify Module. + #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage // ratio of voltage divider = 2.0 (R42=100k, R43=100k) -#define ADC_MULTIPLIER 2.2 // 2.0 + 10% for correction of display undervoltage. +#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage. #define I2C_SDA 21 // I2C pins for this board #define I2C_SCL 22 @@ -23,3 +25,4 @@ #define LORA_RESET 14 #define LORA_DIO1 35 // Not really used #define LORA_DIO2 34 // Not really used + From 54d802f15d072138d38f2f801054ad95a14e2293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 25 Mar 2022 23:06:31 +0100 Subject: [PATCH 2/2] Wait up to 2 seconds for port being connected. This will send serial debug log from the beginning and not somewhere in between. --- src/SerialConsole.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/SerialConsole.cpp b/src/SerialConsole.cpp index 8f652e3fd..1ec1d5acf 100644 --- a/src/SerialConsole.cpp +++ b/src/SerialConsole.cpp @@ -28,6 +28,16 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port) // setDestination(&noopPrint); for testing, try turning off 'all' debug output and see what leaks Port.begin(SERIAL_BAUD); +#ifdef NRF52_SERIES + time_t timeout = millis(); + while (!Port) { + if ((millis() - timeout) < 2000) { + delay(100); + } else { + break; + } + } +#endif emitRebooted(); }