M2 step 1: gnss probe finds the receiver on RX 15 / TX 13 at 115200

A temporary `gnss probe` command listens on both pin orders at 115200
and 9600. Only RX 15 / TX 13 at 115200 carries NMEA, as Meshtastic's
board file says; M5Stack's GPIO 8/9 are the keyboard's I2C bus. The
output format (NMEA 4.10, GSA system IDs, GSV per signal) is recorded in
docs/milestones/M2.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-04 22:05:01 +02:00
co-authored by Claude Opus 5.5
parent 9c30d47982
commit f812c62a3d
2 changed files with 30 additions and 1 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
**Goal:** the device knows where it is and what time it is without a network: a GNSS Service in the background, a GNSS App with the position and a sky view of the satellites, the clock set from satellites when there's no NTP, and Tracks recorded to the SD card.
**Hardware:** the Cap LoRa-1262 carries an ATGM336H-6N (AT6668), multi-constellation (GPS, BeiDou, Galileo, GLONASS, QZSS), with a ceramic antenna. NMEA over UART, 115200 8N1. Meshtastic's board file for this hardware uses GPIO 15 (ESP32 RX) and 13 (TX); M5Stack's page names GPIO 8 and 9, which the keyboard controller already uses. Step 1 checks on the device.
**Hardware:** the Cap LoRa-1262 carries an ATGM336H-6N (AT6668), multi-constellation (GPS, BeiDou, Galileo, GLONASS, QZSS), with a ceramic antenna. NMEA over UART, 115200 8N1. **Measured (step 1, `gnss probe`): RX GPIO 15, TX GPIO 13, 115200 8N1**, as in Meshtastic's board file; M5Stack's page names GPIO 8 and 9, which are the internal I2C bus the keyboard controller sits on. Output is NMEA 4.10 style: `GN` RMC, VTG and GGA, one GSA per constellation with the system ID (1 GPS, 2 GLONASS, 3 Galileo, 4 BeiDou, 5 QZSS) in its last field, and a GSV sequence per constellation and signal (`GP`, `GL`, `GA`, …) with the signal ID last. RMC carries a time even without a Fix (status `V`), so only a Fix makes it trustworthy.
## Decisions (design round 2026-10-04)
+29
View File
@@ -2,6 +2,8 @@
#include <M5Cardputer.h>
#include <SD.h>
#include <esp_task_wdt.h>
#include <atomic>
#include <memory>
@@ -384,6 +386,33 @@ static void runCommand(String line) {
});
}
if (line.startsWith("install ")) update->installFromSd(line.substring(8).c_str()); // Update from SD
if (line == "gnss probe") { // M2 step 1: which pins and baud rate carry NMEA (temporary)
struct Try { int rx, tx; uint32_t baud; } tries[] = {{15, 13, 115200}, {13, 15, 115200}, {15, 13, 9600}, {13, 15, 9600}};
for (auto& t : tries) {
Serial1.begin(t.baud, SERIAL_8N1, t.rx, t.tx);
uint32_t start = millis(), bytes = 0, lines = 0;
std::string current, sample;
while (millis() - start < 1200) {
esp_task_wdt_reset(); // four listens outlast the 5 s loop watchdog
while (Serial1.available()) {
char c = Serial1.read();
bytes++;
if (c == '\n') {
if (current.size() > 6 && current[0] == '$') {
lines++;
if (sample.size() < 400) sample += " " + current + "\n";
}
current.clear();
} else if (c != '\r' && current.size() < 120) current += c;
}
delay(5);
}
Serial1.end();
console.printf("gnss probe: rx %d tx %d at %lu: %lu bytes, %lu NMEA lines\n", t.rx, t.tx,
(unsigned long)t.baud, (unsigned long)bytes, (unsigned long)lines);
if (lines) console.print(sample.c_str());
}
}
if (line == "crash") crash_report::print(console, nvs);
if (line == "coredump erase") console.println(crash_report::erase() ? "coredump: erased" : "coredump: nothing to erase");
#ifdef RORO_DEBUG