Skip to content

Refactor GPS management out of EnvironmentSensorManager into LocationProvider hierarchy#1799

Open
alexsporn wants to merge 1 commit intomeshcore-dev:devfrom
alexsporn:feat/refactor-location-provider
Open

Refactor GPS management out of EnvironmentSensorManager into LocationProvider hierarchy#1799
alexsporn wants to merge 1 commit intomeshcore-dev:devfrom
alexsporn:feat/refactor-location-provider

Conversation

@alexsporn
Copy link

@alexsporn alexsporn commented Feb 22, 2026

Move all GPS lifecycle management (detection, start/stop, coordinate updates,
settings) from EnvironmentSensorManager into the SensorManager base class,
making GPS support available to any SensorManager subclass via
registerLocationProvider().

New LocationProvider subclasses:

  • L76KLocationProvider: Quectel L76K with PCAS command configuration
  • RAK12500LocationProvider: WisBlock I2C GPS module (u-blox)

Variant-specific GPS providers refactored:

  • T1000-E: AG3335 with PAIR commands, backup mode sleep/wake
  • Heltec Tracker: UC6580 with custom enable/reset pin handling
  • Nano G2 Ultra: migrated from inline GPS code to MicroNMEALocationProvider

Removed 5 redundant SensorManager subclasses (HWTSensorManager,
SolarSensorManager, MASensorManager, NanoG2UltraSensorManager,
ThinkNodeM1SensorManager) that only existed to duplicate GPS management.

MicroNMEALocationProvider improvements:

  • Configurable enable/standby/reset pin control with per-chip polarity
  • Hardware standby support for low-power GPS sleep
  • Subclass hooks: configure() for chip-specific NMEA setup, beginSerial()
    for platform-specific serial init
  • Shared detect() with ENV_SKIP_GPS_DETECT bypass

@alexsporn alexsporn marked this pull request as draft February 25, 2026 19:00
@alexsporn alexsporn force-pushed the feat/refactor-location-provider branch 4 times, most recently from 040de86 to 41a6231 Compare March 1, 2026 17:32
…Provider hierarchy

 Move all GPS lifecycle management (detection, start/stop, coordinate updates,
  settings) from EnvironmentSensorManager into the SensorManager base class,
  making GPS support available to any SensorManager subclass via
  registerLocationProvider().

  New LocationProvider subclasses:
  - L76KLocationProvider: Quectel L76K with PCAS command configuration
  - RAK12500LocationProvider: WisBlock I2C GPS module (u-blox)

  Variant-specific GPS providers refactored:
  - T1000-E: AG3335 with PAIR commands, backup mode sleep/wake
  - Heltec Tracker: UC6580 with custom enable/reset pin handling
  - Nano G2 Ultra: migrated from inline GPS code to MicroNMEALocationProvider

  Removed 5 redundant SensorManager subclasses (HWTSensorManager,
  SolarSensorManager, MASensorManager, NanoG2UltraSensorManager,
  ThinkNodeM1SensorManager) that only existed to duplicate GPS management.

  MicroNMEALocationProvider improvements:
  - Configurable enable/standby/reset pin control with per-chip polarity
  - Hardware standby support for low-power GPS sleep
  - Subclass hooks: configure() for chip-specific NMEA setup, beginSerial()
    for platform-specific serial init
  - Shared detect() with ENV_SKIP_GPS_DETECT bypass
@alexsporn alexsporn force-pushed the feat/refactor-location-provider branch from 41a6231 to 728f0ac Compare March 1, 2026 18:09
@alexsporn alexsporn changed the title Refactor EnvironmentSensorManager to extract the RAK12500LocationProvider and simplify GPS init flow Refactor GPS management out of EnvironmentSensorManager into LocationProvider hierarchy Mar 1, 2026
@alexsporn alexsporn marked this pull request as ready for review March 1, 2026 18:11
@alexsporn
Copy link
Author

Discussion here: #1895

MESH_DEBUG_PRINTLN("RAK12500: begin (cold start)");
powerOn();
delay(500);
configureGNSS();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the return value of configureGNSS() is ignored and _active is set to true below. If GNSS init fails transiently, the provider enters active mode and keeps polling a non-initialized device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants