Skip to content

Commit 4d2b176

Browse files
committed
feature: GPS support on HeltecV3
GPS support via EnvironmentSensorManager. Connect GPS RX to pin 45, TX to pin 46. Note that while you can disable using the GPS there is no way to power down the GPS without using a mosfet and adjusting PIN_GPS_EN.
1 parent 7f0f3b7 commit 4d2b176

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

variants/heltec_v3/platformio.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ build_flags =
2121
-D ENV_INCLUDE_BME280=1
2222
-D ENV_INCLUDE_INA3221=1
2323
-D ENV_INCLUDE_INA219=1
24+
-D ENV_INCLUDE_GPS=1
25+
-D PIN_GPS_RX=45
26+
-D PIN_GPS_TX=46
27+
-D PIN_GPS_EN=-1
2428
build_src_filter = ${esp32_base.build_src_filter}
2529
+<../variants/heltec_v3>
2630
+<helpers/sensors>
@@ -30,7 +34,8 @@ lib_deps =
3034
adafruit/Adafruit INA3221 Library @ ^1.0.1
3135
adafruit/Adafruit INA219 @ ^1.2.3
3236
adafruit/Adafruit AHTX0 @ ^2.0.5
33-
adafruit/Adafruit BME280 Library @ ^2.3.0
37+
adafruit/Adafruit BME280 Library @ ^2.3.0
38+
stevemarple/MicroNMEA @ ^2.0.6
3439

3540
[env:Heltec_v3_repeater]
3641
extends = Heltec_lora32_v3

variants/heltec_v3/target.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ WRAPPER_CLASS radio_driver(radio, board);
1414

1515
ESP32RTCClock fallback_clock;
1616
AutoDiscoverRTCClock rtc_clock(fallback_clock);
17-
EnvironmentSensorManager sensors;
17+
18+
#if ENV_INCLUDE_GPS
19+
#include <helpers/sensors/MicroNMEALocationProvider.h>
20+
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1);
21+
EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea);
22+
#else
23+
EnvironmentSensorManager sensors;
24+
#endif
1825

1926
#ifdef DISPLAY_CLASS
2027
DISPLAY_CLASS display;

0 commit comments

Comments
 (0)