Skip to content

rak3401: add -D RAK_BOARD so WisBlock RAK12500 (I2C u-blox) GPS compiles in #104

Description

@Strycher

Summary

The rak3401 variant is missing -D RAK_BOARD, so the WisBlock I2C GPS path — which drives the RAK12500 / u-blox ZOE-M8Q over I2C — is compiled out. A RAK12500 on any RAK3401-based board (e.g. the WisMesh 1W Booster, RAK10724) is therefore never detected, and the MeshCore app shows GPS as "not available."

Root cause

In src/helpers/sensors/EnvironmentSensorManager.cpp:

#if ENV_INCLUDE_GPS && defined(RAK_BOARD) && !defined(RAK_WISMESH_TAG)
#define RAK_WISBLOCK_GPS
#endif

RAK_WISBLOCK_GPS gates the entire I2C u-blox driver (RAK12500LocationProvider, ublox_GNSS.begin(Wire), rakGPSInit() / gpsIsAwake()), and it requires RAK_BOARD.

RAK_BOARD is defined by rak4631, rak_wismesh_tag, and the gat562_* variants — but not by rak3401 (which only defines -D RAK_3401). So rak3401 builds compile the #else branch, initBasicGPS(), which is UART/Serial1-only and never scans I2C → an I2C-only module (RAK12500) is invisible. This is a variant oversight: rak3401 was derived from rak4631 but dropped -D RAK_BOARD.

Fix

Add -D RAK_BOARD to the [rak3401] base build_flags in variants/rak3401/platformio.ini (mirroring rak4631). Applies to all rak3401 envs (companion BLE/USB, repeater, room server, sensor). One-line build-flag change; no logic change.

Hardware / verification

  • First device: RAK10724 WisMesh 1W Booster (RAK3401 + RAK13302), companion BLE — see Flash new RAK10724 WisMesh 1W as BLE companion (MeshCore 1.15.0) #103.
  • GPS module: RAK12500 (u-blox ZOE-M8Q), mounted in Slot C (Slot F is physically buried; A/B are poor layout; Slot D's socket isn't in the probe list). gpsIsAwake() walks WB_IO2(Socket A) / WB_IO4(Socket C) / WB_IO5(Socket F) — Slot C = WB_IO4 is covered.
  • I2C (SDA/SCL on pins 13/14) is shared across slots, so detection at 0x42 should be slot-agnostic; the per-socket toggle just wakes the module.
  • Note: on rak3401, WB_IO2 == PIN_3V3_EN (the 3V3_S + SKY66122 5V-boost enable), so the gpsIsAwake(WB_IO2) probe momentarily power-cycles the 3V3 rail during init. The same code runs on rak4631 in production (considered safe), but noted.

Acceptance

Build RAK_3401_companion_radio_ble, reflash, mount the RAK12500 in Slot C, enable GPS in the MeshCore app, and confirm a position fix outdoors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    board:doneBoard: donebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions