Skip to content

Proposal: Add GPS (TinyGPS++) and PMU (AXP2101) sensor modules #2313

@khengari77

Description

@khengari77

Summary

This issue proposes adding two new sensor modules to OpenMQTTGateway:

  1. GPS sensor module — reads NMEA data via TinyGPS++ over hardware UART or software serial
  2. PMU sensor module — monitors AXP2101 power management chip (battery voltage, charging status, temperature, etc.)

These modules are designed for ESP32 boards with integrated GPS + LoRa + PMU (e.g., TTGO T-Beam), but are fully multi-platform (ESP32, ESP8266, AVR).


GPS Module (sensorGPS.cpp + config_GPS.h)

  • Supports hardware UART (0/1/2/3) and software serial fallback
  • Configurable pins, baud rate, and read interval
  • Publishes: satellite count, latitude, longitude, altitude, date, time
  • Platform-aware pin defaults (ESP32, ESP8266, ATmega2560, Arduino Uno)

PMU Module (sensorPMU.cpp + config_PMU.h)

  • AXP2101 initialization and configuration
  • Voltage regulators for ESP32, LoRa, GPS power rails
  • Battery monitoring: voltage, percentage, charging status, VBUS, system voltage, temperature
  • Low-battery warning and shutdown thresholds
  • Charging LED control, fuel gauge learning
  • Interrupt-driven IRQ handling

Both modules follow existing upstream conventions:

  • .cpp files (not .ino)
  • THEENGS_LOG_* macros for logging
  • enqueueJsonObject() for publishing data
  • #include "TheengsCommon.h" pattern
  • GPLv3 license headers

The implementation is available in my fork for reference:
https://github.com/khengari77/TDOA-tracker/tree/development/main

Would the maintainers be interested in these additions? Happy to adjust based on feedback before submitting a formal PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions