Skip to content

Commit f247c82

Browse files
Wessel Nieboerweebl2000
authored andcommitted
Add GPS support Heltec Wireless Tracker v1.x
Pin mapping verified against HTIT-Tracker V0.5 schematic: - GPIO35 (GPS_EN): N-ch MOSFET drives P-ch high-side switch, active HIGH - GPIO36 (GPS_RST): hardware reset, active LOW - GPIO33/34: UART TX/RX Delegates power management to MicroNMEALocationProvider begin()/stop() which independently controls GPS power via GPS_EN and shares VEXT with the display through RefCountedDigitalPin.
1 parent e6e87fb commit f247c82

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

variants/heltec_tracker/platformio.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ build_flags =
3232
-D PIN_TFT_LEDA_CTL=21 ; LEDK (switches on/off via mosfet to create the ground)
3333
-D PIN_GPS_RX=33
3434
-D PIN_GPS_TX=34
35+
-D PIN_GPS_EN=35 ; N-ch MOSFET Q2 drives P-ch high-side switch → active HIGH (default)
36+
-D PIN_GPS_RESET=36
37+
-D PIN_GPS_RESET_ACTIVE=LOW
38+
-D GPS_BAUD_RATE=115200
39+
-D ENV_INCLUDE_GPS=1
3540
-D SX126X_DIO2_AS_RF_SWITCH=true
3641
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
3742
-D SX126X_CURRENT_LIMIT=140

variants/heltec_tracker/target.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ WRAPPER_CLASS radio_driver(radio, board);
1616

1717
ESP32RTCClock fallback_clock;
1818
AutoDiscoverRTCClock rtc_clock(fallback_clock);
19-
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1);
19+
// GPS_EN (GPIO35) drives N-ch MOSFET → P-ch high-side switch; GPS_RESET (GPIO36) active LOW
20+
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock, GPS_RESET, GPS_EN, &board.periph_power);
2021
HWTSensorManager sensors = HWTSensorManager(nmea);
2122

2223
#ifdef DISPLAY_CLASS
@@ -58,18 +59,16 @@ mesh::LocalIdentity radio_new_identity() {
5859

5960
void HWTSensorManager::start_gps() {
6061
if (!gps_active) {
61-
board.periph_power.claim();
62-
62+
_location->begin(); // Claims periph_power via RefCountedDigitalPin
6363
gps_active = true;
64-
Serial1.println("$CFGSYS,h35155*68");
64+
Serial1.println("$CFGSYS,h35155*68"); // Configure GPS for all constellations
6565
}
6666
}
6767

6868
void HWTSensorManager::stop_gps() {
6969
if (gps_active) {
7070
gps_active = false;
71-
72-
board.periph_power.release();
71+
_location->stop(); // Releases periph_power via RefCountedDigitalPin
7372
}
7473
}
7574

variants/heltec_tracker/target.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class HWTSensorManager : public SensorManager {
2828
const char* getSettingName(int i) const override;
2929
const char* getSettingValue(int i) const override;
3030
bool setSettingValue(const char* name, const char* value) override;
31+
LocationProvider* getLocationProvider() override { return _location; }
3132
};
3233

3334
extern HeltecV3Board board;

0 commit comments

Comments
 (0)