muzi_base: fix GPS UART pins and re-enable ATGM336H NMEA output

The refactor no longer calls Serial1.setPins() on nRF52, so Serial1 uses
PIN_SERIAL1_RX/TX directly. Those were swapped (the GPS transmits on
P0.20), so no data was received. Fix them and define PIN_GPS_TX/RX by the
gps module's side, as other variants do.

The ATGM336H keeps its NMEA output config across power cycles, and other
firmware may leave every sentence disabled. Re-enable GGA + RMC after each
power-up.
This commit is contained in:
Níckolas Goline authored and Florent committed 2026-11-08 08:47:34 -04:00
1 parent d49621c805
commit 22ce208e68
3 files changed
+20 -4

No files matched your search

+12
View File
@@ -50,6 +50,18 @@ void MuziBaseSensorManager::loop() {
_pwr_last_click = t;
if (++_pwr_clicks >= USER_BTN_POWER_OFF_CLICKS) muziPowerOff();
}
#if ENV_INCLUDE_GPS
// the ATGM336H keeps its nmea output config across power cycles (backup
// supply), and other firmware may have turned every sentence off. re-enable
// GGA + RMC after each power-up, once the module has booted.
bool gps_on = _location->isActive();
if (gps_on && !_gps_was_active) _gps_cfg_at = millis() + 1000;
_gps_was_active = gps_on;
if (_gps_cfg_at && gps_on && (long)(millis() - _gps_cfg_at) > 0) {
_gps_cfg_at = 0;
_location->sendSentence("$PCAS03,1,0,0,0,1,0,0,0,0,0,,,0,0");
}
#endif
EnvironmentSensorManager::loop();
}
+4
View File
@@ -42,6 +42,10 @@ extern AutoDiscoverRTCClock rtc_clock;
class MuziBaseSensorManager : public EnvironmentSensorManager {
unsigned long _pwr_last_click = 0;
uint8_t _pwr_clicks = 0;
#if ENV_INCLUDE_GPS
unsigned long _gps_cfg_at = 0;
bool _gps_was_active = false;
#endif
public:
#if ENV_INCLUDE_GPS
MuziBaseSensorManager(LocationProvider& location) : EnvironmentSensorManager(location) {}
+4 -4
View File
@@ -54,8 +54,8 @@ static const uint8_t AREF = (PIN_AREF); // not used
////////////////////////////////////////////////////////////////////////////////
// UART pin definition
#define PIN_SERIAL1_RX (19) // P0.19 used for GPS RX
#define PIN_SERIAL1_TX (20) // P0.20 used for GPS TX
#define PIN_SERIAL1_RX (20) // P0.20, data from the gps
#define PIN_SERIAL1_TX (19) // P0.19, data to the gps
////////////////////////////////////////////////////////////////////////////////
// I2C pin definition
@@ -153,8 +153,8 @@ static const uint8_t AREF = (PIN_AREF); // not used
////////////////////////////////////////////////////////////////////////////////
// GPS
#define HAS_GPS 1
#define PIN_GPS_RX PIN_SERIAL1_RX
#define PIN_GPS_TX PIN_SERIAL1_TX
#define PIN_GPS_TX PIN_SERIAL1_RX // gps module's TX pin
#define PIN_GPS_RX PIN_SERIAL1_TX // gps module's RX pin
#define PIN_GPS_EN (32+1) // P1.01 PWR_IO2 on schematic. gps power, driven by the sensor manager.
// superIO 3-position mode switch (pins from the meshtastic muzi_base variant).