Skip to content

Conversation

@oltaco
Copy link
Contributor

@oltaco oltaco commented Jun 21, 2025

GPS support using EnvironmentSensorManager.

Tested with Ublox Neo-6M. Connect RX on GPS module to pin 45 and TX to pin 46.

Note that while you can enable and disable the GPS there is no way to actually power down the GPS module without using a mosfet and adjusting PIN_GPS_EN.

Closes: #328

GPS support via EnvironmentSensorManager. Connect GPS RX to pin 45, TX to pin 46.
Note that while you can disable using the GPS there is no way to power down the GPS without using a mosfet and adjusting PIN_GPS_EN.
@ripplebiz
Copy link
Collaborator

Could you do a timing test for me? I'm curious, for setups that DON'T have GPS wired up, how long does each EnvironmentSensorManager::loop() invocation take? Is probably fine, but just want to make sure there isn't any latency being added, eg to repeaters, with having that processing in every loop()

@oltaco
Copy link
Contributor Author

oltaco commented Jun 21, 2025

Good call, will investigate and get back to you.

@oltaco
Copy link
Contributor Author

oltaco commented Jun 21, 2025

So with ENV_INCLUDE_GPS=1 and GPS unwired EnvironmentSensorManager::loop() is taking 8-10 micros, with the occasional single loop spike to ~15-17us. The attached log has 20 seconds worth of measurement for this setup.

I also checked with GPS wired just to see what the hit would be. In that setup each second when a new NMEA message comes in every second or third loop takes ~215-240us, probably every time a new character is coming in over serial I guess?

envsenseman loop gps unwired.txt

@ripplebiz ripplebiz merged commit 39cc221 into meshcore-dev:dev Jun 21, 2025
@fdlamotte
Copy link
Collaborator

Thanks for the patch, my heltec with gps now gives me position with the dev branch (gps wired on 33/34/47, it also has an RST pin but its wiring doesn't seem necessary)

Maybe a configurable baudrate would be interesting (a GPS_BAUDRATE symbol), by chance my GPS was at 9600 (well that's the one with which MicroNMEALocationProvider was written, so the defaults might be my fault ...)

@oltaco oltaco deleted the HeltecV3-GPS branch July 30, 2025 21:31
VirtualP1rate added a commit to VirtualP1rate/MeshCore that referenced this pull request Oct 10, 2025
agessaman pushed a commit to agessaman/MeshCore that referenced this pull request Nov 8, 2025
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.

3 participants