Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimise GPS Baud Rate cycle #5102

Merged
merged 10 commits into from
Nov 2, 2024

Conversation

fifieldt
Copy link
Contributor

Previously, our baud rate cycled through one list twice.

There were some rarer baudrates in there, so this code separates out those into a dedicated list that is only run through if detection fails for common bauds. We also only run through each baud rate once.

@fifieldt fifieldt marked this pull request as draft October 20, 2024 01:41
@fifieldt
Copy link
Contributor Author

fifieldt commented Oct 20, 2024

This is currently untested, please don't merge until we test on a wide range of devices :) ed: now tested.

@fifieldt fifieldt force-pushed the big-brain-baud-bash branch from c8d942e to 9656aa4 Compare October 21, 2024 08:25
Previously, our baud rate cycled through one list twice.

There were some rarer baudrates in there, so this code
separates out those into a dedicated list that is only
run through if detection fails for common bauds. We also
only run through each baud rate once.
Would have always reset GPS baudrate every time.
@fifieldt fifieldt force-pushed the big-brain-baud-bash branch from 6951852 to 3df4fa6 Compare October 23, 2024 22:15
@fifieldt fifieldt added the pinned Exclude from stale processing label Oct 31, 2024
@fifieldt
Copy link
Contributor Author

fifieldt commented Nov 2, 2024

Beginning testing.

@fifieldt
Copy link
Contributor Author

fifieldt commented Nov 2, 2024

  • T1000-E (AG3335@115200) OK (and speed much improved)
  • ATGM332D@9600 OK
  • heltec-wireless-tracker (UC6580@115200) OK
  • tbeam (Neo-6M@9600) OK
  • wio-tracker-wm1110 (L76K@9600) OK
  • Ublox-9@38400 OK
  • Ublox-10@38400 OK

@fifieldt fifieldt force-pushed the big-brain-baud-bash branch from 1cdf6e4 to 74f1c6d Compare November 2, 2024 02:43
If GPS_BAUDRATE is set in variant.h, the deployer knows something we
don't about the GPS. Used especially when the GPS is soldered to a board
in a commercial product :) If we see that, we don't try other baud rates
at all.
@fifieldt fifieldt force-pushed the big-brain-baud-bash branch from 74f1c6d to 3b265f5 Compare November 2, 2024 02:59
@fifieldt fifieldt marked this pull request as ready for review November 2, 2024 03:28
@fifieldt
Copy link
Contributor Author

fifieldt commented Nov 2, 2024

OK, tested with 7 different GPSes across several devices and this works nicely. Ready for review.

@fifieldt fifieldt force-pushed the big-brain-baud-bash branch from d1dcf8f to 1d804f5 Compare November 2, 2024 03:52
src/gps/GPS.cpp Outdated Show resolved Hide resolved
src/gps/GPS.cpp Outdated Show resolved Hide resolved
@thebentern
Copy link
Contributor

@fifieldt do we want to apply the GPS_BAUDRATE_FIXED macro to variants as a part of this PR as well?

@fifieldt
Copy link
Contributor Author

fifieldt commented Nov 2, 2024

@fifieldt do we want to apply the GPS_BAUDRATE_FIXED macro to variants as a part of this PR as well?

I don't think there's a need set GPS_BAUDRATE_FIXED directly in variant.h? Just adds work for hardware makers when setting GPS_BAUDRATE does the job. Or are you saying there are other variants to set baud rates for?

@thebentern
Copy link
Contributor

I don't think there's a need set GPS_BAUDRATE_FIXED directly in variant.h? Just adds work for hardware makers when setting GPS_BAUDRATE does the job. Or are you saying there are other variants to set baud rates for?

I'm being a bonehead and the #ifdef GPS_BAUDRATE block in configuration.h sailed over my head.

@thebentern thebentern merged commit b0c924f into meshtastic:master Nov 2, 2024
47 checks passed
caveman99 pushed a commit that referenced this pull request Nov 3, 2024
* Optimise GPS Baud Rate cycle

Previously, our baud rate cycled through one list twice.

There were some rarer baudrates in there, so this code
separates out those into a dedicated list that is only
run through if detection fails for common bauds. We also
only run through each baud rate once.

* Fix first time around bug

Would have always reset GPS baudrate every time.

* Add support for fixing GPS_BAUDRATE

If GPS_BAUDRATE is set in variant.h, the deployer knows something we
don't about the GPS. Used especially when the GPS is soldered to a board
in a commercial product :) If we see that, we don't try other baud rates
at all.

* Don't print blank lines in GPS_DEBUG.

* Try GPS_BAUDRATE first, not only.

* Fix spelling mistakes in comments

* Only use GPS_BAUDRATE if specified in variant.h

* Modify RareSerial Speeds based on FIXED or not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pinned Exclude from stale processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants