Skip to content

thinknode_m6: don't drive GPS REINIT pin so the L76K is detected - #2863

Merged
fdlamotte merged 1 commit into
meshcore-dev:devfrom
benskigomez:fix/m6-gps-reset-pin
Aug 4, 2026
Merged

thinknode_m6: don't drive GPS REINIT pin so the L76K is detected#2863
fdlamotte merged 1 commit into
meshcore-dev:devfrom
benskigomez:fix/m6-gps-reset-pin

Conversation

@benskigomez

Copy link
Copy Markdown

Problem

On the ThinkNode M6, the L76K GPS was never detected — the companion app reported "no GPS / not supported", and on-device the GPS stayed at sat 0. The same sealed unit's GPS works fine under Meshtastic, so the hardware is good.

Root cause

Pin 29 (PIN_GPS_RESET, which is the module's REINIT line on this board) was being driven HIGH, which holds the L76K silent — it never emits any NMEA, so detection (Serial1.available()) sees zero bytes and the GPS setting is hidden.

It was driven HIGH in two places:

  • variants/thinknode_m6/variant.cpp initVariant() drove it HIGH at boot.
  • Because PIN_GPS_RESET was defined, MicroNMEALocationProvider::begin() also drove it HIGH (GPS_RESET = 29, GPS_RESET_FORCE = LOW, so begin() writes !LOW = HIGH).

The Meshtastic M6 variant leaves this exact pin as a floating input and never drives it — which is why GPS works there.

Verification (no logic analyzer; M6 is a sealed unit)

A standalone sketch powered the GPS and passively captured NMEA at 9600 baud while changing one variable at a time:

pin 29 state result
driven HIGH (current firmware) 0 bytes
left floating (INPUT) full NMEA stream ($GNGGA/$GNRMC/$GNGSA/$GNGSV)

An EN power-cycle was tried as well and made no difference — floating pin 29 alone is sufficient.

The GPS streams standard NMEA at 9600 by default and needs no $PCAS/config commands.

Fix

  • variant.h: define GPS_RESET (-1) so the location provider never touches pin 29.
  • variant.cpp: stop driving pin 29; leave it floating.

This matches the Meshtastic M6 variant. Confirmed on hardware: GPS is now detected and the app shows live coordinates, altitude, and map position.

Fixes #2862.

Note for maintainers

The same pattern may affect other Elecrow ThinkNode boards whose reset pin is labeled "REINIT" — notably the M3 (variant.h has PIN_GPS_RESET (25) // REINIT), which has a matching open report (#1864). I don't have M3 hardware to verify, so it's intentionally left out of this PR.

The M6's L76K GPS streams NMEA at 9600 baud on its own, but the firmware
reported no GPS. Root cause: pin 29 (PIN_GPS_RESET / the module's REINIT
line) was driven HIGH, which holds the L76K silent so it never emits any
sentences and detection fails.

variant.cpp drove pin 29 HIGH at boot, and because PIN_GPS_RESET was
defined, MicroNMEALocationProvider also drove it HIGH in begin(). Bench
testing on a sealed M6 (passive NMEA capture, no logic analyzer) confirmed:
pin 29 driven HIGH = 0 bytes; pin 29 floating = full NMEA stream.

Define GPS_RESET (-1) so the location provider never touches pin 29, and
stop driving it in initVariant. This matches the Meshtastic M6 variant,
which leaves the same pin as a floating input.
@benskigomez

Copy link
Copy Markdown
Author

Likely the same bug on the ThinkNode M3 (#1864). For a maintainer with M3 hardware:

variants/thinknode_m3/variant.h has #define PIN_GPS_RESET (25) // REINIT (note the same "REINIT" labelling as the M6), and variant.cpp sets it as an OUTPUT. As on the M6, MicroNMEALocationProvider::begin() then drives that pin HIGH, which on the M6 is exactly what held the L76K silent. The open issue #1864 ("thinknode m3 doesnt have gps") matches the M6 symptom.

If that reproduces on an M3, the same one-line fix should apply: stop driving pin 25 / set GPS_RESET (-1) so the provider leaves it floating. I don't have an M3 to verify, so I've left it out of this PR.

#define PIN_GPS_RESET (29) // REINIT - must FLOAT; driving it (esp. HIGH) silences the L76K
// The M6's L76K streams NMEA on its own and must not have its REINIT pin driven.
// Tell the location provider there is no reset pin so it never touches pin 29
// (driving it HIGH holds the module silent). Matches Meshtastic, which leaves

@IoTThinks IoTThinks Jul 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest to remove the comment "Matches Meshtastic, which leaves
// this pin as an input. See variant.cpp (pin 29 is intentionally not configured)." to make the code "neutral".

Let me test the PR.
Seems good.

@IoTThinks

Copy link
Copy Markdown
Contributor

Yeah, this PR is confirmed working.
It brings back GPS to M6.

@fdlamotte

Copy link
Copy Markdown
Collaborator

I'm quite sure gps was working when I did the port

Unfortunately I don't have my unit here to do the test (stayed in France with my brother, I didn't want to carry items with batteries in my luggage)

So everyone confirm gps was not working and now works ... would be ok for me I think

@IoTThinks

IoTThinks commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@fdlamotte Likely due to variants with NO PULL vs. PULLUP resistor.

@fdlamotte
fdlamotte merged commit d6c2da9 into meshcore-dev:dev Aug 4, 2026
@F4FPR

F4FPR commented Aug 12, 2026

Copy link
Copy Markdown

ThinkNode M6 / repeater 1.17.0

The #2863 REINIT fix is present and GPS has successfully obtained
real fixes on this same device after upgrading to 1.17.0.

However, the GPS can later enter a persistent state:

gps
on, active, no fix, 0 sats

Observed for hours.

The following did NOT recover it:

  • gps off / gps on
  • software reboot
  • reboot on battery
  • reboot while externally powered by USB
  • USB power maintained with active charging
  • reflashing the exact same repeater 1.17.0 image via OTAFIX

The GPS antenna and hardware configuration were unchanged from the
previous successful fixes.

This suggests an intermittent GPS/UART/module state remains possible
after the #2863 REINIT fix.

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.

5 participants