Skip to content

RAK4631 on Pocket V3: GPS power broken #3830

Open

Description

@marineam

As of 87c76a8 RAK4631 builds work on the new Pocket V3 but battery life is shorter than expected. It appears the GPS remains powered when MeshCore indicates that it is off. To complicate things further, on the latest dev version ( bb87031 ) the situation is flipped: based on power draw it looks like GPS is always off, even when MeshCore indicates it is on. I bisected the flip in behavior to:

5533c24: last commit where GPS is apparently always powered and gets a fix when turned "on"
df5a768: starting here GPS is apparently never powered and never gets a fix

On a traditional RAK4631 (Pocket V2) the GPS works normally through all of these commits.

Activity

  1. marineam commented on Nov 12, 2026

    @marineam
    Author

    For reference PR #3753 is where the change in behavior was introduced.

    Also worth noting, the Pocket V3 uses a single integrated PCB rather than attaching a RAK4631 module to a base board like the Pocket V2 did. For all I know continuing to consider the V3 a 4631 is inappropriate.

  2. fdlamotte commented on Nov 13, 2026

    @fdlamotte
    Collaborator

    Thanks for reporting, will try to dig into this

    Note that without having the unit it's not easy to work on this kind of problems ... the commit you pointed to is big and the first of the PR, so the issue might come from a lot of factor

    The best I could do is get one of these devices, but they don't come cheap (maybe that's why until now nobody came with the issue as I was asking for help ;) )

    edit: and thanks for confirming that the gps works in pocket v2 ;)

    I see pocket v3 in rokland store, but not in rakwireless (was quickly seeking for documentation on the board, will try harder)

  3. marcelverdult commented on Nov 13, 2026

    @marcelverdult
    Contributor

    I looked at the code path for the serial GPS on RAK4631 builds, and both observations fit one change in how the power pins are left after detection.

    Before df5a768 (EnvironmentSensorManager::gpsIsAwake): WB_IO2 is driven LOW, then HIGH. The RAK12500 I2C probe fails, Serial1.available() is true, and the function returns without touching the pin again. WB_IO2 stays HIGH. For the serial GPS, gpsResetPin is set to PIN_GPS_EN, which is -1 in variants/rak4631/platformio.ini, so stop_gps() never switches anything. Result: the GPS is powered all the time, whatever MeshCore shows.

    From df5a768 on (RakLocationProvider::detect): the serial driver is opened first, then RakI2cGpsDriver::detect() probes WB_IO2, WB_IO4 and WB_IO5. Each failed probe ends with pinMode(powerPin, INPUT). The serial module is then detected from the bytes that arrived while a pin was HIGH, but nothing drives WB_IO2 again. In the default build serialPower is nullptr. With GPS_RAIL_POWER_CONTROL the rail was claimed before the probe, and _nmea.begin() returns early afterwards because the driver is already started, so the pin also stays an input there.

    The comment in RefCountedDigitalPin.h says that on a RAK19007 with a RAK12501, WB_IO2 left as an input keeps 3V3_S in its last state. That would explain why the Pocket V2 keeps working. My guess (I have no V3 to check) is that the V3 board pulls this enable line low, so the GPS loses power right after detection.

    @marineam, two things would help to confirm this and to make "gps off" actually save power on the V3:

    1. A build with -D MESH_DEBUG=1 and the boot log around GPS detection.
    2. If you know or can measure which pin switches the GPS supply on the V3 (WB_IO2 or something else), that decides how a proper fix looks.

    A fix would put the supply back to the requested state after the I2C probe, and on the V3 switch it with the pin that actually controls the GPS. I'm happy to put up a PR once the pin is known.

  4. fdlamotte commented on Nov 13, 2026

    @fdlamotte
    Collaborator

    thanks @marcelverdult this would be good help !

  5. fdlamotte commented on Nov 13, 2026

    @fdlamotte
    Collaborator

    I came across the doc for meshpocket_v3 on rakwireless site.

    https://docs.rakwireless.com/product-categories/meshtastic/wismesh-pocket-v3/overview/

    Contrary to what they do for their boards, there is not much here that helps us

    At least they say in their quickstart guide not to use the generic RAK4631 firmware for meshtastic ... which would go in favor of making a specific firmware for this device ...

    edit: I'll ask rak contacts for some documentation, it would be needed for proper support of this board (maybe rak sent some devices to liam so I'll check that too)

  6. marcelverdult commented on Nov 13, 2026

    @marcelverdult
    Contributor

    I opened #3834 for the "GPS never powered" part.

    After a failed RAK12500 probe, WB_IO2 now stays driven HIGH, as it did before df5a768. WB_IO4 and WB_IO5 still go back to inputs. I could only build it, I have no Pocket V3.

    @marineam, could you flash a build from that branch on your V3 and check whether the GPS gets a fix again?

    This does not fix the battery drain yet. In the default build gps off still does not cut the GPS power. The RAK_4631_repeater_gps_power env (-D GPS_RAIL_POWER_CONTROL) does switch WB_IO2 on gps off. If you test that env as well, we would know whether WB_IO2 really controls the GPS supply on the V3.

  7. marineam commented on Nov 14, 2026

    @marineam
    Author

    @marcelverdult Thanks for getting us back to the previous always-on behavior. Testing that PR is all I have time for today. I'll try builds with -D MESH_DEBUG=1 and -D GPS_RAIL_POWER_CONTROL soon (hopefully tomorrow) and get back to you.

  8. marineam commented on Nov 16, 2026

    @marineam
    Author

    Enabling -D GPS_RAIL_POWER_CONTROL on my RAK_4631_companion_radio_ble build fixes powering off and on the GPS on the V3.

    For reference with MESH_DEBUG I consistently get the following during boot:

    DEBUG: GPS detected
    DEBUG: AHT10/AHT20 not detected at I2C address 38
    DEBUG: BME680+BSEC not detected at I2C address 76
    DEBUG: BME680+BSEC not detected at I2C address 77
    DEBUG: BME280 not detected at I2C address 76
    DEBUG: BME280 not detected at I2C address 77
    DEBUG: BMP280 not detected at I2C address 76
    DEBUG: BMP280 not detected at I2C address 77
    DEBUG: SHTC3 not detected at I2C address 70
    DEBUG: SHT4X not detected at I2C address 44
    DEBUG: LPS22HB not detected at I2C address 5C
    DEBUG: INA3221 not detected at I2C address 42
    DEBUG: INA219 not detected at I2C address 40
    DEBUG: INA219 not detected at I2C address 41
    DEBUG: INA260 not detected at I2C address 41
    DEBUG: INA226 not detected at I2C address 44
    DEBUG: MLX90614 not detected at I2C address 5A
    DEBUG: VL53L0X not detected at I2C address 29
    DEBUG: BMP085 not detected at I2C address 77
    DEBUG: RAK12035 not detected at I2C address 20
    
  9. fdlamotte commented on Nov 16, 2026

    @fdlamotte
    Collaborator

    The issue here is that RAK is a modular platform, but some devices (with fixed parameters) could benefit from a "better" standard configuration ...

    For instance -D GPS_RAIL_POWER_CONTROL is not good in all the cases because it will cut power to all modules. But in the context of the meshpockets, where we know the config, it's a good thing to let the GPS subsystem control the power to save energy

    One of the solution is to rely on refCountDigitalPin that will let power on while some subsystem uses it ... it is used on the NmeaGpsDriver so it should be usable, but we'd have to check that any other driver for rak module are also aware of that ...

    An intermediate option would be to add a specific command to let GPS subsystem toggle the power ... this would permit any rak user to configure the behaviour of power control at runtime ... it might even be on by default

  10. marineam commented on Nov 16, 2026

    @marineam
    Author

    @fdlamotte from your description it sounds like ideally -D GPS_RAIL_POWER_CONTROL is merely an extra power optimization and not the primary way to power down the GPS. Do you expect there is another way to power down the single module we need to find or are some devices like the V3 just stuck with the all or nothing rail method?

  11. fdlamotte commented on Nov 16, 2026

    @fdlamotte
    Collaborator

    @marineam RAIL_POWER_CONTROL is not an extra power optimization (I think that is the only power control we have to switch off the GPS) ... and it has a side effect as it cuts the power to all the devices on the board (and not only the GPS)

    So if GPS is alone, it is fine to use it (what I don't know is if the gps state is saved while off with some power to RAM). But if there are other devices, you need to be cautious not to cut power to a device that is already in use ... using RefCountDigitalPin we track how many devices asked to power on the device, so if the other devices on the board use this mechanism, then there is no problem with the GPS subsystem asking for a shutdown of the power (if there is anyone else using it it will stay on) ...

    I'm not maintener for the RAK4630 port ... so I won't take the decision of using -D GPS_RAIL_POWER_CONTROL on all RAK builds (or on builds that are shipped to the flasher) alone. The option is here to be used after reviewing if it's better with or without (or if we wait to be sure all the devices that are behind the POWER_CONTROL use the good mechanisms).

    As said before, we might ship specific versions of the firmware for devices for which we exactly know the hardware such as meshpocket v2 and v3 (and I think now one meshpocket firmware would be ok)

    We could also make the GPS_RAIL_POWER_CONTROL toggleable via a cli command for rak firmwares (so people can disable it at runtime if they have issue with their devices.

    It also rises the issue of identifying the maintainers for each port, I'll put myself again on the task of proposing a README.md file for each variant where the maintainer can be identified (and where information such as the build flags and specific cli commands specific to the port are explained)

    @liamcottle and @recrof you might have something to add ... maybe you have some idea wether cutting power to the gps is necessary on portable devices like the meshpocket (or on the repeaters where it can save some watts of solar power)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions