Skip to content

RAK4631 GPS detection in EnvironmentSensorManager is broken #1234

@fschrempf

Description

@fschrempf

In #531 board-specific code for the RAK4631 was introduced into the generic EnvironmentSensorManager class. That is unfortunate as mixing generic and board-specific code makes it hard to maintain, extend and debug.

Furthermore the detection code for the RAK4631 is broken. I have a repeater board without a GPS that reports DEBUG: Serial GPS init correctly and is turned on when there is actually no GPS available. The code assumes that the pin 34 is the reset GPIO for the GPS, configures that as output and leaves it in this state, even though there is no GPS.

This causes problems for boards that use this pin for other purposes (for example the very popular "Solar Mesh Baseboard" from uArt.cz). In this case the pin is used to control the voltage supply for external devices and leaving it as output causes increased power consumption.

The check to detect the GPS is if (Serial1) which is always true. I don't see how this intended to work in the first place. Maybe something like if (Serial1.available()) would work, to check if there is actually any data received. But this would probably be flaky, as floating UART pins would be prone to cause arbitrary data in the RX buffer.

Any ideas how to fix this properly? Thanks!

CC: @cod3doomy @ripplebiz

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