From 0a9f7147f3b9b313f8a6ecb41e9832891f0ead47 Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 8 Sep 2020 10:25:37 -0700 Subject: [PATCH 1/5] probably fix #341 enable internal pullup on lora-v2 button --- src/configuration.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/configuration.h b/src/configuration.h index 50e16e6a..e70f1fda 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -255,6 +255,7 @@ along with this program. If not, see . // #define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost #define LED_PIN 2 // If defined we will blink this LED #define BUTTON_PIN 0 // If defined, this will be used for user button presses +#define BUTTON_NEED_PULLUP #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module @@ -281,6 +282,7 @@ along with this program. If not, see . #define BUTTON_PIN \ 0 // If defined, this will be used for user button presses, if your board doesn't have a physical switch, you can wire one // between this pin and ground +#define BUTTON_NEED_PULLUP #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module From c0073025649fb586ae28ea48c8fd903558f661a5 Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 8 Sep 2020 10:28:53 -0700 Subject: [PATCH 2/5] fix #363 gps altitude - based on tip by @a-f-G-U-C --- src/gps/UBloxGPS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gps/UBloxGPS.cpp b/src/gps/UBloxGPS.cpp index 80d7064b..36203964 100644 --- a/src/gps/UBloxGPS.cpp +++ b/src/gps/UBloxGPS.cpp @@ -165,7 +165,7 @@ void UBloxGPS::doTask() latitude = ublox.getLatitude(0); longitude = ublox.getLongitude(0); - altitude = ublox.getAltitude(0) / 1000; // in mm convert to meters + altitude = ublox.getAltitudeMSL(0) / 1000; // in mm convert to meters dop = ublox.getPDOP(0); // PDOP (an accuracy metric) is reported in 10^2 units so we have to scale down when we use it heading = ublox.getHeading(0); numSatellites = ublox.getSIV(0); From 076f8bd77bf6a122230c1efae9676cc89395f08e Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 9 Sep 2020 14:15:43 -0700 Subject: [PATCH 3/5] fix #370 by pulling in my bugfix to ESP32-Nimble --- platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 72ae1af9..4329d037 100644 --- a/platformio.ini +++ b/platformio.ini @@ -85,8 +85,8 @@ build_flags = # board_build.ldscript = linker/esp32.extram.bss.ld lib_ignore = segger_rtt platform_packages = - framework-arduinoespressif32 @ https://github.com/meshtastic/arduino-esp32.git#1adba3f11ca8406ac0a704d151697b572058b53d - + framework-arduinoespressif32 @ https://github.com/meshtastic/arduino-esp32.git#2814f110aa618429bdd9a0a2d6a93c55f29f87a6 + ; not needed included in ttgo-t-beam board file ; also to use PSRAM https://docs.platformio.org/en/latest/platforms/espressif32.html#external-ram-psram ; -DBOARD_HAS_PSRAM From ee27c15c2c085f1dbe327f0140d45fd15ad5c36a Mon Sep 17 00:00:00 2001 From: geeksville Date: Thu, 10 Sep 2020 09:24:48 -0700 Subject: [PATCH 4/5] likely fix for bug #373. fix #339. great gps fixes from @a-f-G-U-C fixes described in bug #376 --- proto | 2 +- src/gps/UBloxGPS.cpp | 16 ++++++++++------ src/mesh/mesh.pb.h | 4 ++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/proto b/proto index 3caee2e5..ce422b7c 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 3caee2e5b92d4429c6cf47a4c88d4615001f300b +Subproject commit ce422b7c448906c6fee3eef64bbd41adfbc990f0 diff --git a/src/gps/UBloxGPS.cpp b/src/gps/UBloxGPS.cpp index 36203964..624ab77b 100644 --- a/src/gps/UBloxGPS.cpp +++ b/src/gps/UBloxGPS.cpp @@ -46,8 +46,9 @@ bool UBloxGPS::setup() // ublox.enableDebugging(Serial); // try a second time, the ublox lib serial parsing is buggy? - if (!tryConnect()) - tryConnect(); + // see https://github.com/meshtastic/Meshtastic-device/issues/376 + for (int i = 0; (i < 3) && !tryConnect(); i++) + delay(500); if (isConnected) { DEBUG_MSG("Connected to UBLOX GPS successfully\n"); @@ -81,8 +82,11 @@ bool UBloxGPS::setUBXMode() // assert(ok); // ok = ublox.setDynamicModel(DYN_MODEL_BIKE); // probably PEDESTRIAN but just in case assume bike speeds // assert(ok); - if (!ublox.powerSaveMode(true, 2000)) // use power save mode, the default timeout (1100ms seems a bit too tight) - return false; + + // per https://github.com/meshtastic/Meshtastic-device/issues/376 powerSaveMode might not work with the marginal + // TTGO antennas + // if (!ublox.powerSaveMode(true, 2000)) // use power save mode, the default timeout (1100ms seems a bit too tight) + // return false; if (!ublox.saveConfiguration(3000)) return false; @@ -106,8 +110,8 @@ bool UBloxGPS::factoryReset() tryConnect(); // sets isConnected // try a second time, the ublox lib serial parsing is buggy? - if (!tryConnect()) - tryConnect(); + for (int i = 0; (i < 3) && !tryConnect(); i++) + delay(500); DEBUG_MSG("GPS Factory reset success=%d\n", isConnected); if (isConnected) diff --git a/src/mesh/mesh.pb.h b/src/mesh/mesh.pb.h index 27ff63f9..64b2758c 100644 --- a/src/mesh/mesh.pb.h +++ b/src/mesh/mesh.pb.h @@ -364,7 +364,7 @@ typedef struct _ToRadio { #define DeviceState_version_tag 8 #define DeviceState_rx_text_message_tag 7 #define DeviceState_no_save_tag 9 -#define DeviceState_did_gps_reset_tag 10 +#define DeviceState_did_gps_reset_tag 11 #define FromRadio_packet_tag 2 #define FromRadio_my_info_tag 3 #define FromRadio_node_info_tag 4 @@ -519,7 +519,7 @@ X(a, STATIC, REPEATED, MESSAGE, receive_queue, 5) \ X(a, STATIC, OPTIONAL, MESSAGE, rx_text_message, 7) \ X(a, STATIC, SINGULAR, UINT32, version, 8) \ X(a, STATIC, SINGULAR, BOOL, no_save, 9) \ -X(a, STATIC, SINGULAR, BOOL, did_gps_reset, 10) +X(a, STATIC, SINGULAR, BOOL, did_gps_reset, 11) #define DeviceState_CALLBACK NULL #define DeviceState_DEFAULT NULL #define DeviceState_radio_MSGTYPE RadioConfig From de7b9877f9e8c50920d2b85b633f59206dd7d55b Mon Sep 17 00:00:00 2001 From: geeksville Date: Thu, 10 Sep 2020 09:51:53 -0700 Subject: [PATCH 5/5] remove auto-inserted whitespace that might confuse platformio --- platformio.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 4329d037..1069f8e0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -85,8 +85,8 @@ build_flags = # board_build.ldscript = linker/esp32.extram.bss.ld lib_ignore = segger_rtt platform_packages = - framework-arduinoespressif32 @ https://github.com/meshtastic/arduino-esp32.git#2814f110aa618429bdd9a0a2d6a93c55f29f87a6 - + framework-arduinoespressif32@https://github.com/meshtastic/arduino-esp32.git#2814f110aa618429bdd9a0a2d6a93c55f29f87a6 + ; not needed included in ttgo-t-beam board file ; also to use PSRAM https://docs.platformio.org/en/latest/platforms/espressif32.html#external-ram-psram ; -DBOARD_HAS_PSRAM @@ -94,7 +94,7 @@ platform_packages = ; -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG -; The 1.0 release of the TBEAM board +; The 1.0 release of the TBEAM board [env:tbeam] extends = esp32_base board = ttgo-t-beam