Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -1734,11 +1734,11 @@ Which SBAS mode to be used

### gps_ublox_nav_hz

Navigation update rate for UBLOX receivers. Some receivers may limit the maximum number of satellites tracked when set to a higher rate or even stop sending navigation updates if the value is too high. Some M10 devices can do up to 25Hz. 10 is a safe value for M8 and newer.
Navigation update rate for UBLOX receivers. M9 modules limit satellite tracking to 16 satellites at 10Hz or higher, but use 32 satellites below 10Hz for better accuracy. M10 modules work well at 8Hz with 3 constellations. Some M10 devices with high-performance clock can do up to 25Hz with 4 constellations. 8Hz is a safe, accurate default for M8/M9/M10.

| Default | Min | Max |
| --- | --- | --- |
| 10 | 5 | 200 |
| 8 | 5 | 200 |

---

Expand All @@ -1748,7 +1748,7 @@ Enable use of Beidou satellites. This is at the expense of other regional conste

| Default | Min | Max |
| --- | --- | --- |
| OFF | OFF | ON |
| ON | OFF | ON |

---

Expand All @@ -1758,7 +1758,7 @@ Enable use of Galileo satellites. This is at the expense of other regional const

| Default | Min | Max |
| --- | --- | --- |
| OFF | OFF | ON |
| ON | OFF | ON |

---

Expand Down
6 changes: 6 additions & 0 deletions docs/development/msp/msp_messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4896,6 +4896,12 @@
"ctype": "uint16_t",
"desc": "Estimated Vertical Position Accuracy (`gpsSol.epv`)",
"units": "cm"
},
{
"name": "hwVersion",
"ctype": "uint32_t",
"desc": "GPS hardware version (`gpsState.hwVersion`). Values: 500=UBLOX5, 600=UBLOX6, 700=UBLOX7, 800=UBLOX8, 900=UBLOX9, 1000=UBLOX10, 0=UNKNOWN",
"units": "Version code"
}
]
},
Expand Down
1 change: 1 addition & 0 deletions src/main/fc/fc_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
sbufWriteU16(dst, gpsSol.hdop);
sbufWriteU16(dst, gpsSol.eph);
sbufWriteU16(dst, gpsSol.epv);
sbufWriteU32(dst, gpsState.hwVersion);
Comment on lines 1009 to +1012
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Gate the new hwVersion field behind an explicit buffer/feature check (or protocol/version check) so legacy/size-assuming consumers don't break and serialization can't overrun a constrained buffer. [Learned best practice, importance: 6]

Suggested change
sbufWriteU16(dst, gpsSol.hdop);
sbufWriteU16(dst, gpsSol.eph);
sbufWriteU16(dst, gpsSol.epv);
sbufWriteU32(dst, gpsState.hwVersion);
sbufWriteU16(dst, gpsSol.hdop);
sbufWriteU16(dst, gpsSol.eph);
sbufWriteU16(dst, gpsSol.epv);
if (sbufBytesRemaining(dst) >= 4) {
sbufWriteU32(dst, gpsState.hwVersion);
}

break;
#endif
case MSP2_ADSB_VEHICLE_LIST:
Expand Down
8 changes: 4 additions & 4 deletions src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1757,12 +1757,12 @@ groups:
type: uint8_t
- name: gps_ublox_use_galileo
description: "Enable use of Galileo satellites. This is at the expense of other regional constellations, so benefit may also be regional. Requires M8N and Ublox firmware 3.x (or later) [OFF/ON]."
default_value: OFF
default_value: ON
field: ubloxUseGalileo
type: bool
- name: gps_ublox_use_beidou
description: "Enable use of Beidou satellites. This is at the expense of other regional constellations, so benefit may also be regional. Requires gps hardware support [OFF/ON]."
default_value: OFF
default_value: ON
field: ubloxUseBeidou
type: bool
- name: gps_ublox_use_glonass
Expand All @@ -1777,8 +1777,8 @@ groups:
min: 5
max: 10
- name: gps_ublox_nav_hz
description: "Navigation update rate for UBLOX receivers. Some receivers may limit the maximum number of satellites tracked when set to a higher rate or even stop sending navigation updates if the value is too high. Some M10 devices can do up to 25Hz. 10 is a safe value for M8 and newer."
default_value: 10
description: "Navigation update rate for UBLOX receivers. M9 modules limit satellite tracking to 16 satellites at 10Hz or higher, but use 32 satellites below 10Hz for better accuracy. M10 modules work well at 8Hz with 3 constellations. Some M10 devices with high-performance clock can do up to 25Hz with 4 constellations. 8Hz is a safe, accurate default for M8/M9/M10."
default_value: 8
field: ubloxNavHz
type: uint8_t
min: 5
Expand Down
3 changes: 3 additions & 0 deletions src/main/io/gps.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@ void gpsInit(void)
gpsStats.errors = 0;
gpsStats.timeouts = 0;

// Initialize hardware version to unknown (for MSP_GPSSTATISTICS)
gpsState.hwVersion = 0;

// Reset solution, timeout and prepare to start
gpsResetSolution(&gpsSolDRV);
gpsResetSolution(&gpsSol);
Expand Down
Loading