Merge pull request #1351 from weebl2000/heltec_wireless_tracker_gps

Support GPS properly on Heltec Wireless Tracker v1.x
This commit is contained in:
Liam Cottle
2026-03-03 23:11:46 +13:00
committed by GitHub
3 changed files with 11 additions and 6 deletions

View File

@@ -32,6 +32,11 @@ build_flags =
-D PIN_TFT_LEDA_CTL=21 ; LEDK (switches on/off via mosfet to create the ground)
-D PIN_GPS_RX=33
-D PIN_GPS_TX=34
-D PIN_GPS_EN=35 ; N-ch MOSFET Q2 drives P-ch high-side switch → active HIGH (default)
-D PIN_GPS_RESET=36
-D PIN_GPS_RESET_ACTIVE=LOW
-D GPS_BAUD_RATE=115200
-D ENV_INCLUDE_GPS=1
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140

View File

@@ -16,7 +16,8 @@ WRAPPER_CLASS radio_driver(radio, board);
ESP32RTCClock fallback_clock;
AutoDiscoverRTCClock rtc_clock(fallback_clock);
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1);
// GPS_EN (GPIO35) drives N-ch MOSFET → P-ch high-side switch; GPS_RESET (GPIO36) active LOW
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock, GPS_RESET, GPS_EN, &board.periph_power);
HWTSensorManager sensors = HWTSensorManager(nmea);
#ifdef DISPLAY_CLASS
@@ -58,18 +59,16 @@ mesh::LocalIdentity radio_new_identity() {
void HWTSensorManager::start_gps() {
if (!gps_active) {
board.periph_power.claim();
_location->begin(); // Claims periph_power via RefCountedDigitalPin
gps_active = true;
Serial1.println("$CFGSYS,h35155*68");
Serial1.println("$CFGSYS,h35155*68"); // Configure GPS for all constellations
}
}
void HWTSensorManager::stop_gps() {
if (gps_active) {
gps_active = false;
board.periph_power.release();
_location->stop(); // Releases periph_power via RefCountedDigitalPin
}
}

View File

@@ -28,6 +28,7 @@ public:
const char* getSettingName(int i) const override;
const char* getSettingValue(int i) const override;
bool setSettingValue(const char* name, const char* value) override;
LocationProvider* getLocationProvider() override { return _location; }
};
extern HeltecV3Board board;