-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Only call GPS Probe commands once per family #6114
base: master
Are you sure you want to change the base?
Conversation
7f981ab
to
205431b
Compare
Converting to draft - going to test in every chip I have. |
Hmm, it looks like the new T1000E GPS detection "improvement" code in GPS::setup slows down the GPS coming up to the extent the new faster detection code here runs before it comes up! |
6f085c3
to
a810943
Compare
Example from T1000E Before:
|
Tested with Tbeam/UBlox 6 - works nicely |
Seeed Wio-WM1110
|
In the GPS probe code we write commands on the serial line and determine which GPS we have based on the result. GPS units in the same family sometimes use the same command, but return different results (eg AG3335 and AG3332 both use $PAIR021*39). Currently we run the command once per GPS. Instead we should run each command only once per family, record the result, and select the GNSS MODEL based on the result, which is what this patch does. Before the change, we put 12 commands on the serial bus. Now we only put 6. This should markedly improve the speed and reliability of GPS detection. Fixes meshtastic#5193
a810943
to
d8283b8
Compare
Can we set the thread to start up on a delay in the case of the T1000E perhaps? I'm trying to recall if that had other unintended consequences. |
I think I was wrong with my earlier comment. What I've done is set the time for the airoha probe command to 1000 millis, rather than 500, and it seems very happy now! |
Besides the GPS family I'd like to propose another probe optimisation I'd call GPS hinting. Macros used in variant.h for GPS hinting: Remove the GPS_BAUDRATE_FIXED and GPS_BAUDRATE definitions in configuration.h Example for T-Deck Plus:
With GPS hinting, takes just 1 second for T-Deck Plus, it's detected immediately:
|
Set GPS_BAUDRATE in variant.h and you'll get the second part of that straight away :) |
yes, but then it does not do real probing anymore (in case another GPS is equipped for the older T-Deck), but only after removing the mentioned macros definitions in configuration.h |
Ok, perhaps put in a separate feature request for that and I'll take a look? |
Example of the speedup for this one from T-beam: 8 seconds to 4 seconds. I don't have a T-deck, but based on above I would expect this code would detect its GPS in about 15 seconds now. One of the other optimizations I hope to be able to make is: most GPSes put their version info on the line when they first turn on. If it's possible to catch that we can do detection without sending a single command. |
hmm! that was easy. I got the heltec wireless tracker to work in this way. Now to see if that was a fluke. |
Yeah, sadly. Not ready to add this in yet :) |
In the GPS probe code we write commands on the serial line and
determine which GPS we have based on the result.
GPS units in the same family sometimes use the same command,
but return different results (eg AG3335 and AG3332 both use $PAIR021*39).
Currently we run the command once per GPS. Instead we should run each command only once per family, record the result, and select the GNSS MODEL
based on the result, which is what this patch does.
Before the change, we put 12 commands on the serial bus. Now we only put 6.
This should markedly improve the speed and reliability of GPS detection.
Fixes #5193