Repository navigation
Description
Is your feature request related to a problem? Please describe.
MeshCore officially supports the Seeed SenseCAP MeshTracker X1 (and T1000-E), both of which use the Airoha AG3335M dual-band GNSS chip . However, the current MeshCore GPS implementation, which relies on MicroNMEALocationProvider for serial NMEA modules , does not send the necessary Airoha-specific $PAIR commands to enable the SBAS engine. As a result, users cannot benefit from SBAS corrections (WAAS, EGNOS) or, more specifically for the ANZ region, the SouthPAN augmentation service.
SBAS may also take up to two minutes to download an Ionospheric interference map for error correction, re how long the device should connect for a GPS fix.
Describe the solution you'd like
Add an initialization sequence for the AG3335M that sends the documented $PAIR commands to enable SBAS and allow tracking of SouthPAN PRNs (122/124).
Proposed code fix (integration point)
Based on the MeshCore architecture, the initialization for serial GPS modules happens in MicroNMEALocationProvider::begin(). While there isn't a dedicated AG3335 driver file, we can inject the commands after the serial port is initialized.
In src/helpers/sensors/MicroNMEALocationProvider.cpp (or the relevant begin() method), insert the SBAS configuration before the main NMEA parsing loop starts. A robust approach would be to detect the chip via $PAIR021 (as Meshtastic does ) or simply send the commands unconditionally if the target board is known to use the AG3335 (like the X1 variant).
Example implementation (pseudo-code for MicroNMEALocationProvider::begin):
cpp
// After Serial/UART initialization (e.g., _serial->begin(baud))
// and after any reset sequence.
// Optional: Probe for AG3335 to avoid sending PAIR commands to u-blox modules.
// _serial->print("$PAIR021*38\r\n"); // Wait for response...
// Enable SBAS Engine (Documented Airoha command)
_serial->print("$PAIR410,1*22\r\n");
// Allow SouthPAN PRN 122 & 124 (Inverted bitmask: 1=disable, 0=allow)
// 0x7FFEB allows only bit 2 (PRN 122) and bit 4 (PRN 124).
_serial->print("$PAIR418,7FFEB*2B\r\n");
// Save to NVRAM (Persists across reboots)
_serial->print("$PAIR513*3D\r\n");
Note: For global users, $PAIR418,0*2B (allow all SBAS PRNs) is a safer default than the SouthPAN-specific mask.
Describe alternatives you've considered
No configuration: Leaves SBAS disabled, forfeiting potential sub-meter accuracy on capable hardware.
Manual Serial Injection: Not feasible. The X1 is a sealed unit; the USB port connects to the nRF52840 MCU, not the AG3335M's internal UART. End-users cannot easily send raw $PAIR commands without custom bridge firmware.
Additional context & open questions (critical)
SouthPAN Test Mode (MT0) problem: SouthPAN broadcasts with a Message Type 0 "Do Not Use" flag until safety certification. Standard SBAS receivers discard MT0 signals. Does the AG3335M have an undocumented $PAIR command to accept MT0 signals? Without this, the chip may track PRN 122 (visible in GSV) but will not apply the corrections (GGA quality indicator remains 1).
Verification: Success can be confirmed if the $GPGGA fix quality changes from 1 (GPS) to 2 (DGPS/SBAS).
Hardware Support: The AG3335M datasheet confirms SBAS support, and the command list confirms $PAIR410 and $PAIR418 exist. The missing piece is test-mode handling.
Relevant Code References
src/helpers/sensors/MicroNMEALocationProvider.cpp (initialization point).
src/helpers/sensors/MicroNMEALocationProvider.h (class definition).
MeshCore currently supports the X1 board (merged via PR #3112) .
Note:
Unlike Meshtastic (which has a clear GPS.cpp with $PAIR writes), MeshCore's codebase may not have an existing AG3335-specific initialization block. The maintainers might prefer that the commands be sent only for specific board variants (like the X1) rather than globally for all serial GPS modules, to avoid potential issues with other chips (like u-blox) that might misinterpret the $PAIR strings.
Activity