Skip to content

feat: Enable GPS on RAK 1W kit#2401

Merged
liamcottle merged 2 commits into
meshcore-dev:devfrom
zevaryx:rak-3401-gps
Apr 28, 2026
Merged

feat: Enable GPS on RAK 1W kit#2401
liamcottle merged 2 commits into
meshcore-dev:devfrom
zevaryx:rak-3401-gps

Conversation

@zevaryx
Copy link
Copy Markdown

@zevaryx zevaryx commented Apr 25, 2026

Enables GPS on the RAK 1W Kit (RAK3401 + RAK13302) using the RAK12500 GPS module in slot A

The RAK12501 is not compatible at all from testing, and the RAK12500 is only compatible in slot A, not slot D

@zevaryx zevaryx changed the base branch from main to dev April 27, 2026 17:55
Copy link
Copy Markdown
Contributor

@446564 446564 left a comment

Choose a reason for hiding this comment

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

LGTM @recrof

I don't have this hardware combo but the contributor has been running for weeks and confirms working.

@recrof
Copy link
Copy Markdown
Member

recrof commented Apr 27, 2026

@liamcottle can be safely merged

@liamcottle
Copy link
Copy Markdown
Member

Thanks all, I tried to find my spare RAK12500 gps module to test this on the 1W RAK units I have, but couldn't find it. Will take you word for it :)

@liamcottle liamcottle merged commit 70212fb into meshcore-dev:dev Apr 28, 2026
@zevaryx zevaryx deleted the rak-3401-gps branch April 28, 2026 03:48
@weebl2000 weebl2000 mentioned this pull request May 6, 2026
@recrof
Copy link
Copy Markdown
Member

recrof commented May 12, 2026

seems that this PR broke the rak3401 and needs to be reverted. @446564 we should never just merge without testing and just take a word of the author.

recrof added a commit to recrof/MeshCore that referenced this pull request May 12, 2026
reverted changes to RAK_BOARD and PIN_GPS_EN. setting `RAK_BOARD` would cause radio to stop working and end with RadioLib error -707
oltaco added a commit that referenced this pull request May 12, 2026
revert: "feat: Enable GPS on RAK 1W kit" (#2401)
@oltaco
Copy link
Copy Markdown
Member

oltaco commented May 12, 2026

I added a comment about what I think the issue might be. #2536 (comment)

musznik pushed a commit to musznik/MeshCoreMx that referenced this pull request May 23, 2026
reverted changes to RAK_BOARD and PIN_GPS_EN. setting `RAK_BOARD` would cause radio to stop working and end with RadioLib error -707
disq added a commit to disq/MeshCore that referenced this pull request May 28, 2026
Three related issues hit by RAK3401 + RAK19007 + RAK12500 (I²C ublox).

1. -D RAK_BOARD restored on [rak3401].
   It was removed in 68363d9 (revert of meshcore-dev#2401) with the symptom
   "RadioLib error -707", because adding RAK_BOARD enables rakGPSInit(),
   whose WB_IO4 fallback probe pulses pin 4 (= SX126X_RESET on RAK3401)
   LOW for 500 ms — hard-resetting the SX1262 after radio_init() has
   already configured it, and (via stop_gps + gpsResetPin = WB_IO4)
   leaving it held in reset afterwards.
   Without RAK_BOARD, RAK_WISBLOCK_GPS isn't auto-defined, the I²C
   ublox path is unreachable, and the firmware falls back to
   Serial1-NMEA detection — which silently fails on a serial-less
   RAK12500. Fixes 2 and 3 below make RAK_BOARD safe to re-enable.

2. RAK12500LocationProvider passed maxWait of 2/8 ms to getLatitude()
   etc. These are below the ublox I²C response window, so the polls
   routinely timed out and the SparkFun library returned stale/garbage
   PVT bytes. Observed: getGnssFixOk() returning true with a current
   latitude but a longitude from some previous fix. Bumped to 250 ms.
   Also switched getAltitude() (height above WGS84 ellipsoid) to
   getAltitudeMSL() for more intuitive altitude readings.

3. rakGPSInit() probes WB_IO2 first. On failure, gpsIsAwake() leaves
   the probed pin as INPUT. WB_IO2 also controls the 3V3_S switched
   peripheral rail on these RAK base boards, so a failed first probe
   left I²C peripherals (RTC, display, the GPS itself) unpowered
   before the WB_IO4/WB_IO5 fallbacks ran. The else-branch now
   restores WB_IO2 HIGH before falling through.

   On RAK3401, those fallback probes (WB_IO4 = pin 4 = SX126X_RESET,
   WB_IO5 = pin 9 = SX126X_BUSY) are also dangerous, see point 1.
   Adding -D FORCE_GPS_ALIVE in the RAK3401 base env skips stop_gps()
   after detection, so even if gpsResetPin ends up = WB_IO2 (kills
   the rail) or pin 4 (= radio reset), it can't be pulled LOW again
   after init.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

6 participants