mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 09:42:35 +00:00
Heltec-Tracker: GPS support (#2615)
* Heltec-Tracker: GPS support * trunk fmt --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
parent
e4e26a819b
commit
ab32503601
1
.github/workflows/main_matrix.yml
vendored
1
.github/workflows/main_matrix.yml
vendored
@ -83,6 +83,7 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- board: heltec-v3
|
- board: heltec-v3
|
||||||
- board: heltec-wsl-v3
|
- board: heltec-wsl-v3
|
||||||
|
- board: heltec-wireless-tracker
|
||||||
- board: tbeam-s3-core
|
- board: tbeam-s3-core
|
||||||
- board: tlora-t3s3-v1
|
- board: tlora-t3s3-v1
|
||||||
uses: ./.github/workflows/build_esp32_s3.yml
|
uses: ./.github/workflows/build_esp32_s3.yml
|
||||||
|
@ -106,7 +106,7 @@ class GPSStatus : public Status
|
|||||||
bool matches(const GPSStatus *newStatus) const
|
bool matches(const GPSStatus *newStatus) const
|
||||||
{
|
{
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
#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
|
#endif
|
||||||
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected ||
|
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected ||
|
||||||
newStatus->isPowerSaving != isPowerSaving || newStatus->p.latitude_i != p.latitude_i ||
|
newStatus->isPowerSaving != isPowerSaving || newStatus->p.latitude_i != p.latitude_i ||
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "sleep.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
|
// If we have a serial GPS port it will not be null
|
||||||
#ifdef GPS_SERIAL_NUM
|
#ifdef GPS_SERIAL_NUM
|
||||||
HardwareSerial _serial_gps_real(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
|
// Switch to Vehicle Mode, since SoftRF enables Aviation < 2g
|
||||||
_serial_gps->write("$PCAS11,3*1E\r\n");
|
_serial_gps->write("$PCAS11,3*1E\r\n");
|
||||||
delay(250);
|
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) {
|
} else if (gnssModel == GNSS_MODEL_UBLOX) {
|
||||||
|
|
||||||
// Configure GNSS system to GPS+SBAS+GLONASS (Module may restart after this command)
|
// Configure GNSS system to GPS+SBAS+GLONASS (Module may restart after this command)
|
||||||
@ -571,10 +580,10 @@ bool GPS::setup()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PIN_GPS_RESET
|
#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);
|
pinMode(PIN_GPS_RESET, OUTPUT);
|
||||||
delay(10);
|
delay(10);
|
||||||
digitalWrite(PIN_GPS_RESET, 0);
|
digitalWrite(PIN_GPS_RESET, !GPS_RESET_MODE);
|
||||||
#endif
|
#endif
|
||||||
setAwake(true); // Wake GPS power before doing any init
|
setAwake(true); // Wake GPS power before doing any init
|
||||||
bool ok = setupGPS();
|
bool ok = setupGPS();
|
||||||
@ -850,6 +859,9 @@ GnssModel_t GPS::probe()
|
|||||||
return GNSS_MODEL_UBLOX;
|
return GNSS_MODEL_UBLOX;
|
||||||
#elif defined(GPS_L76K)
|
#elif defined(GPS_L76K)
|
||||||
return GNSS_MODEL_MTK;
|
return GNSS_MODEL_MTK;
|
||||||
|
#elif defined(GPS_UC6580)
|
||||||
|
_serial_gps->updateBaudRate(115200);
|
||||||
|
return GNSS_MODEL_UC6850;
|
||||||
#else
|
#else
|
||||||
// we use autodetect, only T-BEAM S3 for now...
|
// we use autodetect, only T-BEAM S3 for now...
|
||||||
uint8_t buffer[256];
|
uint8_t buffer[256];
|
||||||
|
@ -14,6 +14,7 @@ struct uBloxGnssModelInfo {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
GNSS_MODEL_MTK,
|
GNSS_MODEL_MTK,
|
||||||
GNSS_MODEL_UBLOX,
|
GNSS_MODEL_UBLOX,
|
||||||
|
GNSS_MODEL_UC6850,
|
||||||
GNSS_MODEL_UNKNOWN,
|
GNSS_MODEL_UNKNOWN,
|
||||||
} GnssModel_t;
|
} GnssModel_t;
|
||||||
|
|
||||||
@ -149,7 +150,7 @@ class GPS : private concurrency::OSThread
|
|||||||
*/
|
*/
|
||||||
void setAwake(bool on);
|
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;
|
uint32_t getWakeTime() const;
|
||||||
|
|
||||||
@ -167,6 +168,7 @@ class GPS : private concurrency::OSThread
|
|||||||
virtual int32_t runOnce() override;
|
virtual int32_t runOnce() override;
|
||||||
|
|
||||||
// Get GNSS model
|
// Get GNSS model
|
||||||
|
String getNMEA();
|
||||||
GnssModel_t probe();
|
GnssModel_t probe();
|
||||||
|
|
||||||
int getAck(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t requestedID);
|
int getAck(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t requestedID);
|
||||||
|
@ -37,9 +37,10 @@
|
|||||||
#define PIN_GPS_RESET 35
|
#define PIN_GPS_RESET 35
|
||||||
#define PIN_GPS_PPS 36
|
#define PIN_GPS_PPS 36
|
||||||
#define VGNSS_CTRL 37 // Heltec Tracker needs this pulled low for GPS
|
#define VGNSS_CTRL 37 // Heltec Tracker needs this pulled low for GPS
|
||||||
|
#define GPS_RESET_MODE LOW
|
||||||
|
#define GPS_UC6580
|
||||||
|
|
||||||
#define USE_SX1262
|
#define USE_SX1262
|
||||||
|
|
||||||
#define LORA_DIO0 -1 // a No connect on the SX1262 module
|
#define LORA_DIO0 -1 // a No connect on the SX1262 module
|
||||||
#define LORA_RESET 12
|
#define LORA_RESET 12
|
||||||
#define LORA_DIO1 14 // SX1262 IRQ
|
#define LORA_DIO1 14 // SX1262 IRQ
|
||||||
|
Loading…
Reference in New Issue
Block a user