Skip to content

Commit cec7988

Browse files
Wessel Nieboerweebl2000
authored andcommitted
Add GPS support Heltec Wireless Tracker v1.x
1 parent 5b7f667 commit cec7988

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

variants/heltec_tracker/platformio.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ 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 GPS_BAUD_RATE=115200
36+
-D ENV_INCLUDE_GPS=1
3537
-D SX126X_DIO2_AS_RF_SWITCH=true
3638
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
3739
-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+
// v1 has no dedicated GPS reset/enable pins - power is shared via VEXT with display
20+
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock, -1, -1, &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)