Closed freasy closed 9 months ago
AUTOMERGE: (FAIL)
Don't merge
label NOT found -> PASSRN:
label found -> PASSTested
label found -> FAILDo you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
swVersion: ROM SPG 5.10 (7b202e) hwVersion: 000A0000 (M10) extension: FWVER=SPG 5.10 PROTVER=34.10 GPS;GLO;GAL;BDS SBAS;QZSS
@freasy can we have this on one line:
GPS;GLO;GAL;BDS SBAS;QZSS
@freasy can we have this on one line:
GPS;GLO;GAL;BDS SBAS;QZSS
No, this are 2 lines in the unit, which have no id or anything, so a line merge would be fuzzy :/ i would like to leave it like that as it is the raw response from the unit
The PR adds an absolute freight train of additional flash. Can you try to make the code more memory efficient? For example I can see at least one function which is not needed (ubloxUTCStandardConfigToUnitValue()
). The file structure also might need some work. We often split up init code if the c-file gets too bloated, so rather than gps_config.h and .c
, just make a single gps_init.c
and put all GPS init code in there. Also, splitting up NMEA and Ublox code and putting them into their respective files might be a good idea.
Does gps_info
work for NMEA as well? (We support NMEA and Ublox) My suggestion is to focus on one goal at a time, either ublox M10 support OR the new GPS info command.
gps_info
MON-VER acquired: true
swVersion: ROM SPG 5.10 (7b202e) hwVersion: 000A0000 (M10) extension: FWVER=SPG 5.10 PROTVER=34.10 GPS;GLO;GAL;BDS SBAS;QZSS
The swVersion, hwVersion and extension strings seem surplus to requirements and a waste of FLASH. Also, why report 000A0000
when M10
is all we need.
Rather than moving gps.c and gps.h into a new directory, maybe simplify the PR by leaving them where they are, and adding gps_init.c and gps_init.h into the same io directory.
@SteveCEvans if there is a version string, that is unknown to the parse function, i want to display it
What does adding the UTC standard settings fix for us? Previously the standard was set to 0 in UBX-CFG-NAV5, which corresponds to AUTO. It seems like in the new code it also defaults to AUTO. Does AUTO break something with M10s and it needs to be set to one of the other explicit standards?
What does adding the UTC standard settings fix for us? Previously the standard was set to 0 in UBX-CFG-NAV5, which corresponds to AUTO. It seems like in the new code it also defaults to AUTO. Does AUTO break something with M10s and it needs to be set to one of the other explicit standards?
It speeds up the sat find and fix if you set your corresponding time zone here
It speeds up the sat find and fix if you set your corresponding time zone here
But is that broken for M10s? Not trying to be difficult, but expanding the scope of this PR to other improvements makes it hard to see what exactly we're doing to address the M10 problems.
The new code still sets it to AUTO by default. Does the user need to know to set it to their local UTC standard?
No auto is fine and it just expands the options to configure the unit
Do you want to test this code? Here you have an automated build: Assets
#12799
(this pull request number) in the Select commit
field of the Configurator firmware flasher tab (you need to Enable expert mode
, Show release candidates
and Development
).WARNING: It may be unstable. Use only for testing!
Do you want to test this code? Here you have an automated build: Assets
#12799
(this pull request number) in the Select commit
field of the Configurator firmware flasher tab (you need to Enable expert mode
, Show release candidates
and Development
).WARNING: It may be unstable. Use only for testing!
@ledvinap thank you for all your reviews and input! That really helps alot! Are you on the bf discord? Would help in some cases :)
@freasy : You can contact me on Gmail
@freasy : You can contact me on Gmail
i cant find it :(
Do you want to test this code? Here you have an automated build: Assets
#12799
(this pull request number) in the Select commit
field of the Configurator firmware flasher tab (you need to Enable expert mode
, Show release candidates
and Development
).WARNING: It may be unstable. Use only for testing!
Do you want to test this code? Here you have an automated build: Assets
#12799
(this pull request number) in the Select commit
field of the Configurator firmware flasher tab (you need to Enable expert mode
, Show release candidates
and Development
).WARNING: It may be unstable. Use only for testing!
Tested with an M8 unit that is configured in the GPS hardware to link up at 115200 baud.
When set in Ports tab to manual, connection is directly at 115200 in status window = good!
When set in Ports tab to AUTO, the connection can transiently be 9600 (and show not configured), but then, and most of the time, shows 57600 (set to57600)
I think this is a Configurator error, since I notice that if I save AUTO in Configurator, then exit and come back the value gets saved as a manual value of 57600.
@haslinghuis, once this PR is finalised, can we get Configurator to trigger this GPS auto-connect code when the GPS UART in the Ports tab is set to Auto?
Do you want to test this code? Here you have an automated build: Assets
#12799
(this pull request number) in the Select commit
field of the Configurator firmware flasher tab (you need to Enable expert mode
, Show release candidates
and Development
).WARNING: It may be unstable. Use only for testing!
Do you want to test this code? Here you have an automated build: Assets
#12799
(this pull request number) in the Select commit
field of the Configurator firmware flasher tab (you need to Enable expert mode
, Show release candidates
and Development
).WARNING: It may be unstable. Use only for testing!
When set in Ports tab to manual, connection is directly at 115200 in status window = good!
When set in Ports tab to AUTO, the connection can transiently be 9600 (and show not configured), but then, and most of the time, shows
57600 (set to57600)
I think this is a Configurator error, since I notice that if I save AUTO in Configurator, then exit and come back the value gets saved as a manual value of 57600.
Setting AUTO on the Ports tab does not actually set anything to AUTO, it sets the port baud to 57600. This seems intentional.
I mentioned this in the IMU dev channel, I'll copy it here for doc...
In Configurator, when setting the GPS port to AUTO, Configurator maps it to 57600 (port.js):
let gpsBaudrate = $(portConfig).find('.gps_baudrate').val();
if (gpsBaudrate === 'AUTO') {
gpsBaudrate = '57600';
}
In CLI, when entering a serial config with GPS baud rate of 0 (AUTO), it rejects any baud not 9600 to 115200 (doesn't map it to anything) (cli.c):
case 1:
if (baudRateIndex < BAUD_9600 || baudRateIndex > BAUD_115200) {
continue;
}
portConfig.gps_baudrateIndex = baudRateIndex;
break;
In MSP, it takes whatever is submitted, no validation (msp.c):
portConfig->gps_baudrateIndex = sbufReadU8(src);
So, it seems at some point the decision was made not to let users set it to AUTO. The doc page for Serial under GPS Baud Rate says:
Also has a boolean AUTOBAUD. It is recommended to use a fixed baudrate. Configure GPS baudrate according to device documentation.
The doc page for GPS doesn't say anything about support for AUTO. The default baud rate for a GPS serial port is 57600.
Flashed MambaG4 and set port to 115200 -> does not detect GPS (icon stays grey) and in GPS tabs true / false and sat count are being toggled constantly.
Setting speed to 57600 everything seems to work.
# gps_info
# MON-VER acquired: true
swVersion:
FW=5.10, PROTO=34.10
hwVersion:
M10 (000A0000)
extension:
Do you want to test this code? Here you have an automated build: Assets
#12799
(this pull request number) in the Select commit
field of the Configurator firmware flasher tab (you need to Enable expert mode
, Show release candidates
and Development
).WARNING: It may be unstable. Use only for testing!
swVersion: FW=5.10, PROTO=34.10 hwVersion: M10 (000A0000) extension: This is the result I got. Is this ok? I dont see extensions as I saw at some of the commenters
Just installed 4.5 zulu with this pr. Previously it was loosing sats after takeoff . Did a small flight outside at 11pm :) it did not lose any . Good work @freasy . Attached the log file LOG00001.zip
@freasy tested on latest master. The extension from gps_info
is empty. I seem to remember that something was listed there.
using: MATEK GNSS SAM-M10Q
# gps_info
# MON-VER acquired: true
swVersion:
FW=5.10, PROTO=34.10
hwVersion:
M10 (000A0000)
extension:
imo all looks good.
@adam-ah please join us on discord - ping me there
@adam-ah please join us on discord - ping me there
@ctzsnooze I don't use discord - am I missing out on much? :)
@adam-ah yes ;-)
Wow, first of all, thank you so much for all the hard work you've put into this PR since May 12! Your dedication is truly commendable, and I'm excited to see the progress made so far.
However, as much as I appreciate the effort, I must admit that the current size of the PR has become quite challenging to review meaningfully. There are hundreds of unanswered comments and new commits, making it a bit overwhelming to handle in one go.
To ensure that everyone can give your work the attention it deserves, I would really suggest considering splitting this PR into three smaller ones, as discussed earlier. This way, it will be easier for us to review and thoroughly test each portion both on unit tests and actual hardware.
Again, I want to thank the team for the efforts, and I'm looking forward to your understanding in breaking down the PR to help us proceed with the review and merge process more efficiently. Let's collaborate on this, and I'm confident we'll get it done in no time! 🙏😊
@ctzsnooze please apply following diff. GPS Signal Strength is updated in configurator.
mark@pc:~/dev/pr/firmware/test/betaflight$ git diff
diff --git a/src/main/drivers/stm32/serial_uart_stm32f4xx.c b/src/main/drivers/stm32/serial_uart_stm32f4xx.c
index 1f5dbf5b7..d24ba47c7 100644
--- a/src/main/drivers/stm32/serial_uart_stm32f4xx.c
+++ b/src/main/drivers/stm32/serial_uart_stm32f4xx.c
@@ -392,7 +392,7 @@ void uartIrqHandler(uartPort_t *s)
USART_ITConfig(s->USARTx, USART_IT_TXE, DISABLE);
// Switch TX to an input with pullup so it's state can be monitored
- uartTxMonitor(s);
+ // uartTxMonitor(s);
}
}
diff --git a/src/main/io/gps.c b/src/main/io/gps.c
index f4539c1cb..fccb08450 100644
--- a/src/main/io/gps.c
+++ b/src/main/io/gps.c
@@ -1357,6 +1357,7 @@ void gpsUpdate(timeUs_t currentTimeUs)
GPS_update &= ~GPS_MSP_UPDATE;
}
+ DEBUG_SET(DEBUG_GPS_UNIT_CONNECTION, 4, gpsData.state);
DEBUG_SET(DEBUG_GPS_UNIT_CONNECTION, 7, gpsData.satInfoRequired);
switch (gpsData.state) {
@@ -1391,14 +1392,18 @@ void gpsUpdate(timeUs_t currentTimeUs)
#ifdef USE_GPS_UBLOX
} else {
- if (gpsConfig()->autoConfig == GPS_AUTOCONFIG_ON) {
- if (isConfiguratorConnected()) {
- if (gpsData.satInfoRequired) {
- requestSatelliteInfo();
- gpsData.satInfoRequired = false;
- }
+ if (isConfiguratorConnected()) {
+ DEBUG_SET(DEBUG_GPS_UNIT_CONNECTION, 1, gpsPackageCounter);
+ gpsPackageCounter++;
+ // set the condition for requesting new satellite info while connected to Configurator
+ // We only should call this once, so we set the flag and call it once
+ if (!gpsData.satInfoRequired) {
+ gpsData.satInfoRequired = true;
+ gpsPackageCounter = 0;
+ requestSatelliteInfo();
}
}
+ // THIS HAS NOTHING TO DO WITH RECEIVING DATA
if (gpsData.ubloxUsingFlightModel == false && STATE(GPS_FIX)) {
ubloxSendNAV5Message(gpsConfig()->gps_ublox_flight_model);
gpsData.ubloxUsingFlightModel = true;
@@ -1448,20 +1453,10 @@ static void gpsNewData(uint16_t c)
return;
}
- DEBUG_SET(DEBUG_GPS_UNIT_CONNECTION, 1, gpsPackageCounter);
- gpsPackageCounter++;
- if (gpsData.state == GPS_STATE_RECEIVING_DATA) {
- // count the number of packets received in one second
- if (cmp32(millis(), gpsData.lastNavMessage) >= 1000) {
- // set the condition for requesting new satellite info while connected to Configurator
- gpsData.satInfoRequired = true;
- gpsPackageCounter = 0;
- }
- // new speed and position data received, and successfully parsed. Other commands ignored.
- gpsData.lastLastNavMessage = gpsData.lastNavMessage; // used only for a delta time in dashboard.c
- gpsData.lastNavMessage = millis();
- sensorsSet(SENSOR_GPS);
- }
+ // new speed and position data received, and successfully parsed. Other commands ignored.
+ gpsData.lastLastNavMessage = gpsData.lastNavMessage; // used only for a delta time in dashboard.c
+ gpsData.lastNavMessage = millis();
+ sensorsSet(SENSOR_GPS);
GPS_update ^= GPS_DIRECT_TICK;
BTFL_BLACKBOX_LOG_20230721_214450_FOSSF4ELRS.zip
Full 16MB bench log: BTFL_BLACKBOX_LOG_20230722_012121_FOSSF4ELRS.zip
What incredible work being poured into this project! It's great to see how much the community will benefit from these efforts.
However, I must admit that when it comes to gps.c
, I have some concerns. The code's complexity, length, and difficulty to read and test give me a bit of unease.
It feels like we might be throwing a ticking time bomb into a room (release), not only hoping the occupants (pilots) won't be harmed too much by any shrapnel (bugs), but that the room (codebase) stays well-organized after the explosion (code maintainability).
Breaking down the code into separate files, such as (gps.c
, gps_init.c
, gps_ublox.c
, and others), and refactoring the monolithic methods would be immensely helpful, if I may suggest. Also, whenever possible, simplifying nested structures would make the code much more approachable (both readability, maintainability, and testability).
I understand that everyone's efforts are invaluable especially as people are spending their free time on this, and I'm truly grateful for everyone's dedication to this project.
Yes, we all share your concerns about the state of the code in the GPS driver files. This code has been around in this condition for a long time, it was not written for this PR. And for the most part, has worked well enough for the users of GPS.
The intent of this PR was only to address a couple of immediate issues:
That's what was embarked on, along the way a few other things crept in:
This ended up being a bigger PR with the above than I think some of us expected or wanted. un!t did a huge amount of work to get it started and mostly finished up before his new baby arrived (congrats!). ctzsnooze and I have been working to get it finished up to where it's releasable. It's what we've got right now, maybe not everything we wish we had.
GPS Rescue testing has run into the connect/reconnect issues, as have some users. There are a lot of users adopting the new M10 modules, most are unaware of the risks of them not being fully supported. We feel it would be very valuable to get these changes released as soon as we can (with hopefully a 4.4 retrofit). Breaking up this PR and especially embarking on larger refactorings now would delay that. Keep in mind we have a non-trivial testing effort in front of us to make sure this works across a variety of modules.
There is an active discussion on Discord about larger refactoring or rewrite plans. You are encouraged to join that. I think you'll find the folks there understand the principles of good design & coding and want to apply them to the GPS module.
Perhaps as a suggestion, we can focus the review comments for this PR on what's minimally necessary to get it releasable? If there are changes made for this PR that smell, let's clean them up, but perhaps limit the clean up to that?
What incredible work being poured into this project! It's great to see how much the community will benefit from these efforts.
However, I must admit that when it comes to
gps.c
, I have some concerns. The code's complexity, length, and difficulty to read and test give me a bit of unease.It feels like we might be throwing a ticking time bomb into a room (release), not only hoping the occupants (pilots) won't be harmed too much by any shrapnel (bugs), but that the room (codebase) stays well-organized after the explosion (code maintainability).
Breaking down the code into separate files, such as (
gps.c
,gps_init.c
,gps_ublox.c
, and others), and refactoring the monolithic methods would be immensely helpful, if I may suggest. Also, whenever possible, simplifying nested structures would make the code much more approachable (both readability, maintainability, and testability).I understand that everyone's efforts are invaluable especially as people are spending their free time on this, and I'm truly grateful for everyone's dedication to this project.
@ZzyzxTek, thanks for taking the time to fill in the history or this PR.
I'll do my best to address these as objectively as possible, and apologies if any of these are contradictory, I truly appreciate all the effort on BF
That's what was embarked on, along the way a few other things crept in:
It is more important to focus on what matters now: quality code that is readable, testable, maintainable, and bug-free. We (hoomans) are easily distracted by emotions and history, but it is our role to make the right decisions - what matters is where we are at now.
GPS Rescue testing has run into the connect/reconnect issues, as have some users.
Breaking up this PR and especially embarking on larger refactorings now would delay that. Keep in mind we have a non-trivial testing effort in front of us to make sure this works across a variety of modules.
If we can't review and test the code properly, it leads to endless changes without meaningful review and testing. Delaying this PR is necessary due to numerous unaddressed comments and proposed additions to already lengthy files.
Splitting up the PR would actually make it easier to release the fixes and would give us time to mull over the less critical parts. Given that the PR started in May, the argument has never been stronger to split up this PR.
I do hear your argument and desire to help users. I have had these discussion countless times in professional contexts, and it is never an easy one.
folks there understand the principles of good design & coding and want to apply them to the GPS module.
It would be good to see these being applied more.
This code has been around in this condition for a long time, it was not written for this PR.
While in isolation it might be true,
Perhaps as a suggestion, we can focus the review comments for this PR on what's minimally necessary to get it releasable?
If I summarise your arguments, I see the key points as follow
If I understood you correctly, I'm afraid I cannot support this, for the following reasons
As for the above, I still support my previous suggestions, in line with @haslinghuis
In any case, thanks again for all the hard work!
@adam-ah
If you would re-write the code from scratch, test it, and make a PR - that would be fabulous. We all agree, and we all already knew, that the code requires a total refactor. So we are 100% on the same wavelength there.
But you won't. And at present, no-body will.
So we have a situation where M10 units require manual re-programming for them to work, and in fact a lot of M8 units also don't work.
Now you may not understand the code, and I agree that it is extremely tough to follow. But since working on it, we have at least 3 people who understand it very, very well. And those people are slowly, and effectively, solving the issues, one by one. This has been a team effort, involving changes to the debugging tools, to Configurator, and to the code.
This is the current situation:
There are a lot more improvements like that. And with each improvement, our understanding of the code improves, and it gets a little bit more transparent, better commented, and easier to follow.
So I am going to be blunt, this PR will continue its incremental improvements and will be merged, fundamentally in the current form and structure, no matter how strongly I agree that it is in need of a massive re-write.
I would be grateful if you would take the time to actually test the PR, use the blackbox debug tool provided, and help make the code better by providing clear, tested, code improvement suggestions. Otherwise, I accept your views, and indeed agree, and hope that you agree that you don't need to keep re-stating the same views over and over.
So I am going to be blunt, this PR will continue its incremental improvements and will be merged, fundamentally in the current form and structure, no matter how strongly I agree that it is in need of a massive re-write.
Considering that many of these changes have already been implemented elsewhere with improved structure and readability, I'm not entirely convinced of the necessity for this level of arrogance. @ctzsnooze https://github.com/iNavFlight/inav/blob/a528a6dfcac275666b8d22dcebfa6d756be8985a/src/main/io/gps_ublox.c
In any case, I understand that feedback can be challenging to handle at times. I'll leave it at that and wish you the best of luck!
@adam-ah I too very much appreciate how nicely GPS connections are handled in iNav. And I agreed with you that this code requires refactoring, extensively, or rewriting in full. However that is not the purpose of this PR. It is important, right now, to focus on what is achievable and necessary. Right now the most useful thing you could do, if you want to assist with code development in a productive and positive way, is to test the code and provide solutions to any issues that you identify. Later on we will look at refactoring, at which time your PR's will be duly considered, if you provide any.
So I am going to be blunt, this PR will continue its incremental improvements and will be merged, fundamentally in the current form and structure, no matter how strongly I agree that it is in need of a massive re-write.
Considering that many of these changes have already been implemented elsewhere with improved structure and readability, I'm not entirely convinced of the necessity for this level of arrogance. @ctzsnooze https://github.com/iNavFlight/inav/blob/a528a6dfcac275666b8d22dcebfa6d756be8985a/src/main/io/gps_ublox.c
In any case, I understand that feedback can be challenging to handle at times. I'll leave it at that and wish you the best of luck!
Hey, even most of the work here is from me, I was absent, because my second child arrived. That's why I handed this PR over to @ctzsnooze
In discord I already stated, that the whole gps code will be deleted and rewritten at some point. Because fixing this mess is useless hours. On the other hand this PR brings stuff to the table, we don't want to miss, thus the continued work here.
I very much appreciate your contribution! If possible, could you join discord, I am more familiar with communication there?
When I rewrite the whole gps code, I need as much help and brain power as needed, if you want to join then, I would be happy :)
This is a log image showing nav packet loss at 115200 when Configurator is connected and we get enough sats for a 3D fix. At the point we change to flight model 7 (red debug 0 trace) we start getting dropouts (debug 1 and 3, and the yellow timer climbing higher). The dropouts occur every 500ms, which is the interval at which sat info is requested.
Here is the identical circumstance when the board is booted up without Configurator connected. There is no dropout problem, because sat info is not requested after booting up without Configurator being connected.
It's also clear that GPS modules 'remember' the number of sats recently acquired, and when hot-swapped, the NAV-SAT commands are as big as the max number of possible satellites recently identified. So while a module may connect and show sats reliably when first cold connected, because the number of sats, and the size of the NAV-SAT data messages are small, once it acquires enough sats to start failing, it will always fail after a hot swap. This explains some of the randomness with 115200 baud under the current code; the module may show sats early on, then stubbornly refuse to, yet work perfectly when cold-connected the next day.
BTFL_BLACKBOX_LOG_COMMIT59.zip
70 minutes on 115K2 without loosing gpx fix. Gps signal data is hardly updated.
16:50 After powering off for 10 minutes or so with cold start it took 10 minutes to gain a fix.
BTFL_BLACKBOX_LOG_20230725_163058_FOSSF4ELRS(256 buffer).zip
Maybe we need 256+128 bytes buffer but latest tests are showing much better results!!!
Really like to implement @adam-ah suggestions after this gets done
@haslinghuis - despite the slow log sample rate, your log shows that sometimes there is sufficient time between NAV-PVT and NAV-SAT messages for them to be distinct, and both kinds of message would reliably get through in these cases.
At other times, the two appear to coincide. However, the NAV-PVT message appears to always be handled, since the time interval between received NAV packets steps up when that happens, and appears to happen normally.
Marked ready to merge; extensively bench tested, has been flight tested. All known functional issues have been addressed.
Users should now expect a reliable and solid hardware connection from nearly all modern GPS modules, leading to smoother and better GPS rescue control.
UBLox is strongly recommended. NMEA 'sort of'l works, but simply isn't well supported both in our software and in the modules themselves.
The recommended baud rate is 57600. There is little to be gained by using 115200 with the recommended 10hz data rate. Lower baud rates reduce the CPU time required for parsing the incoming data and are more resistant to electrical noise.
The recommended data rate is 10Hz for GPS Rescue purposes. 5Hz or less is recommended if the GPS is only for fixes on the radio in case the quad is lost. If an M8 module is set at 20Hz, it will revert to its own internal default rate, which could be very slow. 20Hz requires 115200 and M9 or higher, and is not recommended as it may be susceptible to electrical interference.
The recommended PID loop rate while using GPS is 8k4k. 8k8k may simply not have enough CPU time available in the loop to support higher baud rates. GPS code requires almost as much time as the Rx or OSD code. It is quite expensive. Check the tasks CLI command and the percentage CPU usage when using 8k8k.
ToDo's:
UBLOX_MSG_DISABLE_NMEA
for the next 11Configure
states; decide the best action if wait time expires; decide what to do for nack in different situations.GPS_CONNECTION
debug once PR is complete, update BB log viewer accordinglyNote 1: NMEA may work, but with the following caveats:
Note 2: The GPS 'AutoBaud' switch, in Configurator, has been disabled in this PR. It now achieves nothing, either way; leave it off.
Note 3: When more than about 25 sats are part of the Nav solution, some UBLox modules randomly drop Nav packets. This appears in the debug as sample intervals of 200 and occasionally 300ms. This seems to be a problem with some GPS hardware modules, it's not a Betaflight problem.
Update 2023-08-12
USE_DASHBOARD
would be required in a build to enable that code. Saves flash space and identifies which variables are purely for this functionality. Thanks @ZzyzxTekUBLOX_MAX_PAYLOAD_SANITY_SIZE
, thanks @ZzyzxTekUpdate 2023-08-08
ubloxSendMessage()
callubloxSendNAV5Message()
elements which only re-stated UBlox defaults, in order to reduce CPU cost of that message.Update 2023-08-04
gpsData.now = millis()
once only, whengpsUpdate()
is called, avoiding multiple recalculations of `millis()Update 2023-08-01
Update 2023-07-29
GPS_SV_MAXSATS_M8N
to be set back to 32 sats, which is the maximum that can be viewed in Configurator.gpsSol.navIntervalMs
. This works very well for both NMEA and UBlox, providing an accurate time interval that is consistent with the reported change in position, leading to more stable velocity estimates.GPS_CONNECTION
Update 2023-07-26
Update 2023-07-25
gps_info
command unless the code is built with-DUSE_GPS_DEBUG
Update 2023-07-22
Update 2023-07-22
AssistNow Autonomous
code has been commented out for now, agreeing with comments that this is a new feature and should be part of a separate PR, once the benefit is ascertained.Update 2023-07_20
gps_ublox_flight_model
once the 3D fix was acquired.Update 2023_07_19 : lots of changes from @ctzsnooze and @ZzyzxTek:
@freasy earlier extensive work included:
AssistNow Offline
for M7 and later modules, but this has been commented out and will be the subject of a separate PRgps_info
, which, in a build compiled with-DUSE_GPS_DEBUG
, will show the UBlox module software and hardware versions, and the Ublox software protocol version and hardware ID.The debug mode is
GPS_CONNECTION
, and can be viewed with this Blackbox Log viewer PR, and 'live' in the sensors tab. It currently displays:CONFIGURE
at step 13For testing:
Set the GPS communication rate in the ports tab to the default of 57600, and the gps_update_rate to 10hz
Set the GPS tab AutoConfig to ON and choose Ublox. Auto-baud does nothing, ignore it.
Go to cli and type:
Power cycle....
Check that the GPS indicator light at the top of the Configurator screen comes on quickly
Check that satellites register, and the map updates
Use to the CLI 'status' command to confirm that the GPS is 'connected' at the intended baud rate..
In the sensors tab, include 'debug', check the baud rate, current nav packet interval (100 for 10hz), flight model value (7 is normal), etc
confirm normal behaviour in the OSD
Go for a fly, make a log, check it all works, try a rescue!
Known Issues:
Feedback would be gratefully appreciated!