diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index f30eed554..6500eb03d 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -83,6 +83,7 @@ jobs: include: - board: heltec-v3 - board: heltec-wsl-v3 + - board: heltec-wireless-tracker - board: tbeam-s3-core - board: tlora-t3s3-v1 uses: ./.github/workflows/build_esp32_s3.yml diff --git a/src/GPSStatus.h b/src/GPSStatus.h index ed3b3fc14..bcfb5f2eb 100644 --- a/src/GPSStatus.h +++ b/src/GPSStatus.h @@ -106,7 +106,7 @@ class GPSStatus : public Status bool matches(const GPSStatus *newStatus) const { #ifdef GPS_EXTRAVERBOSE - LOG_DEBUG("GPSStatus.match() new pos@%x to old pos@%x\n", newStatus->p.pos_timestamp, p.pos_timestamp); + LOG_DEBUG("GPSStatus.match() new pos@%x to old pos@%x\n", newStatus->p.timestamp, p.timestamp); #endif return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected || newStatus->isPowerSaving != isPowerSaving || newStatus->p.latitude_i != p.latitude_i || diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 59e09f5e5..ed52ca70a 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -4,6 +4,10 @@ #include "configuration.h" #include "sleep.h" +#ifndef GPS_RESET_MODE +#define GPS_RESET_MODE HIGH +#endif + // If we have a serial GPS port it will not be null #ifdef GPS_SERIAL_NUM HardwareSerial _serial_gps_real(GPS_SERIAL_NUM); @@ -215,6 +219,11 @@ bool GPS::setupGPS() // Switch to Vehicle Mode, since SoftRF enables Aviation < 2g _serial_gps->write("$PCAS11,3*1E\r\n"); delay(250); + } else if (gnssModel == GNSS_MODEL_UC6850) { + + // use GPS + GLONASS + _serial_gps->write("$CFGSYS,h15\r\n"); + delay(250); } else if (gnssModel == GNSS_MODEL_UBLOX) { // Configure GNSS system to GPS+SBAS+GLONASS (Module may restart after this command) @@ -571,10 +580,10 @@ bool GPS::setup() #endif #ifdef PIN_GPS_RESET - digitalWrite(PIN_GPS_RESET, 1); // assert for 10ms + digitalWrite(PIN_GPS_RESET, GPS_RESET_MODE); // assert for 10ms pinMode(PIN_GPS_RESET, OUTPUT); delay(10); - digitalWrite(PIN_GPS_RESET, 0); + digitalWrite(PIN_GPS_RESET, !GPS_RESET_MODE); #endif setAwake(true); // Wake GPS power before doing any init bool ok = setupGPS(); @@ -850,6 +859,9 @@ GnssModel_t GPS::probe() return GNSS_MODEL_UBLOX; #elif defined(GPS_L76K) return GNSS_MODEL_MTK; +#elif defined(GPS_UC6580) + _serial_gps->updateBaudRate(115200); + return GNSS_MODEL_UC6850; #else // we use autodetect, only T-BEAM S3 for now... uint8_t buffer[256]; diff --git a/src/gps/GPS.h b/src/gps/GPS.h index c06c2fa91..847a60016 100644 --- a/src/gps/GPS.h +++ b/src/gps/GPS.h @@ -14,6 +14,7 @@ struct uBloxGnssModelInfo { typedef enum { GNSS_MODEL_MTK, GNSS_MODEL_UBLOX, + GNSS_MODEL_UC6850, GNSS_MODEL_UNKNOWN, } GnssModel_t; @@ -149,7 +150,7 @@ class GPS : private concurrency::OSThread */ void setAwake(bool on); - /** Get how long we should stay looking for each acquisition + /** Get how long we should stay looking for each aquisition */ uint32_t getWakeTime() const; @@ -167,6 +168,7 @@ class GPS : private concurrency::OSThread virtual int32_t runOnce() override; // Get GNSS model + String getNMEA(); GnssModel_t probe(); int getAck(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t requestedID); diff --git a/variants/heltec_wireless_tracker/variant.h b/variants/heltec_wireless_tracker/variant.h index 7930a18a8..318454522 100644 --- a/variants/heltec_wireless_tracker/variant.h +++ b/variants/heltec_wireless_tracker/variant.h @@ -37,9 +37,10 @@ #define PIN_GPS_RESET 35 #define PIN_GPS_PPS 36 #define VGNSS_CTRL 37 // Heltec Tracker needs this pulled low for GPS +#define GPS_RESET_MODE LOW +#define GPS_UC6580 #define USE_SX1262 - #define LORA_DIO0 -1 // a No connect on the SX1262 module #define LORA_RESET 12 #define LORA_DIO1 14 // SX1262 IRQ