From 028999697e9b6c366efd77cc93ce93eaf39fa143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 6 Apr 2022 09:18:55 +0200 Subject: [PATCH] Improve T-Echo GPS Handling --- platformio.ini | 2 +- src/gps/GPS.cpp | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 7b0964820..b2c375901 100644 --- a/platformio.ini +++ b/platformio.ini @@ -48,7 +48,7 @@ lib_deps = https://github.com/meshtastic/arduino-fsm.git https://github.com/meshtastic/SparkFun_Ublox_Arduino_Library.git#31015a55e630a2df77d9d714669c621a5bf355ad https://github.com/meshtastic/RadioLib.git#5582ac30578ff3f53f20630a00b2a8a4b8f92c74 - https://github.com/meshtastic/TinyGPSPlus.git#f0f47067ef2f67c856475933188251c1ef615e79 + https://github.com/meshtastic/TinyGPSPlus.git https://github.com/meshtastic/AXP202X_Library.git#8404abb6d4b486748636bc6ad72d2a47baaf5460 Wire ; explicitly needed here because the AXP202 library forgets to add it SPI diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 8c0f7571d..8562f0ebe 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -41,6 +41,25 @@ bool GPS::setupGPS() #endif #ifndef NO_ESP32 _serial_gps->setRxBufferSize(2048); // the default is 256 +#endif +#ifdef TTGO_T_ECHO + // Switch to 4800 baud, then close and reopen port + _serial_gps->write("$PCAS01,0*1C\r\n"); + delay(250); + _serial_gps->end(); + delay(250); + _serial_gps->begin(4800); + delay(250); + // Initialize the L76K Chip, use GPS + GLONASS + _serial_gps->write("$PCAS04,5*1C\r\n"); + delay(250); + // only ask for RMC and GGA + _serial_gps->write("$PCAS03,1,0,0,0,1,0,0,0,0,0,,,0,0*02\r\n"); + delay(250); + // Switch to Vehicle Mode, since SoftRF enables Aviation < 2g + _serial_gps->write("$PCAS11,3*1E\r\n"); + delay(250); + #endif }