Skip to content

GPS tab: presets for u-blox ZED-F9P and ZED-X20P - #2813

Open
Raffi1202 wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
Raffi1202:feature/gps-presets-f9p-x20p
Open

Raffi1202 wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
Raffi1202:feature/gps-presets-f9p-x20p

Conversation

@Raffi1202

@Raffi1202 Raffi1202 commented Sep 30, 2026 •

Copy link
Copy Markdown

GPS presets for the u-blox ZED-F9P and ZED-X20P, picked by auto-detect.

Names and descriptions follow the existing presets, which are not localized.

Depends on iNavFlight/inav#12083 for 0x89 and for skipping GLONASS on X20 firmware without it, so it should be merged after that. With older firmware the F9P keeps reporting 0x49 and gets m9-precision, which has the same values.

Testing

  • npm test: 290 of 291 pass. The failing MZTC test in msp-parse-failure-recovery fails the same way on maintenance-10.x.
  • A local check that every value detectGPSPreset() returns has a preset and an <option>, and that the rates are within the input's 5..20.
  • Tested against both receivers, see the comment below.

Auto-detect picks them from hwVersion 0x89 (F9) and 0x54 (X20).
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Configurator test build ready — commit 6675bb4

Download build artifacts for PR #2813

Available platforms (scroll to the Artifacts section at the bottom of the run page):

  • Windows x64 (ZIP, MSI) and x32 (ZIP, MSI)
  • macOS arm64 (ZIP, DMG) and x64 (ZIP, DMG)
  • Linux x64 (DEB, RPM, ZIP) and aarch64 (DEB, RPM, ZIP)

A GitHub login is required to download artifacts. Build is for testing only.

@Raffi1202

Copy link
Copy Markdown
Author

Tested with the CI build of 6675bb4 on an IFLIGHT_BLITZ_ATF435.

Receiver Firmware Auto-detect Preset applied
ZED-F9P (HPG 1.51) iNavFlight/inav#12083 "u-blox ZED-F9P" f9p: 5 Hz, Galileo and BeiDou on, GLONASS off
ZED-X20P (HPG 2.11) iNavFlight/inav#12083 + #12001 + #11921 "u-blox ZED-X20P" x20p: 10 Hz, Galileo, BeiDou and GLONASS on

Both presets can also be selected by hand and behave like the existing ones.

The x20p preset depends on iNavFlight/inav#12001. Without it NAV-SIG is sent at the navigation rate, and 10 Hz with four constellations is about 150 % of what a 115200 baud UART carries. With #12001 the same preset is at about 40 %.

@Raffi1202
Raffi1202 marked this pull request as ready for review October 5, 2026 13:41
@qodo-code-review

Copy link
Copy Markdown
Contributor

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add auto-detected GPS presets for u-blox ZED-F9P and ZED-X20P

✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Add selectable ZED-F9P and ZED-X20P presets with receiver-appropriate constellations and update
 rates.
• Recognize their hardware identifiers so auto-detect and recommended settings select the matching
 preset.
Diagram

graph TD
  selector["Preset selector"] --> choice{"Auto mode?"} --> mapping["Hardware mapping"] --> presets["Preset definitions"] --> controls["GPS controls"]
  choice --> presets
  hardware["FC GPS data"] --> mapping
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Capability-driven receiver presets
  • ➕ Could tailor constellation choices to each receiver firmware's reported capabilities rather than relying on firmware to ignore unsupported GLONASS.
  • ➖ Requires a capability-reporting path and more frontend logic than the existing hardware-version mapping.

Recommendation: Keep the existing preset and hardware-version mapping approach for this scoped addition. Merge after the cited iNav firmware change, since correct F9P identification and X20P GLONASS handling depend on it.

Files changed (2) +28 / -0

Enhancement (2) +28 / -0
gps.htmlExpose F9P and X20P in the preset dropdown +2/-0

Expose F9P and X20P in the preset dropdown

• Adds selectable options for both receivers, matching the new preset identifiers in the GPS tab.

tabs/gps.html

gps.jsDefine receiver settings and hardware auto-detection +26/-0

Define receiver settings and hardware auto-detection

• Adds F9P and X20P constellation, rate, and description presets. Maps hardware versions 0x89 and 0x54 to those presets so the existing auto-detect and recommended-settings paths can apply them.

tabs/gps.js

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. New GPS preset labels stay untranslated 📘 Rule violation ✧ Quality
Description
The added f9p and x20p option labels are hardcoded English text without data-i18n translation
keys. Users viewing a non-English locale still see these newly introduced preset names in English
whenever the GPS preset selector is displayed.
Code

tabs/gps.html[R54-55]

+                                <option value="f9p">u-blox ZED-F9P</option>
+                                <option value="x20p">u-blox ZED-X20P</option>
Evidence
The new visible option labels are added as literal English text without data-i18n attributes,
violating the requirement that translated HTML text use i18next keys.

Rule 353261: Use data-i18n attributes for all i18next-translated HTML text
tabs/gps.html[54-55]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new GPS preset option labels are hardcoded English strings and do not use the project's i18next `data-i18n` mechanism, so they remain untranslated in localized interfaces.

## Fix Focus Areas
- tabs/gps.html[54-55]
- locale/en/messages.json

## Recommended Fix
Add unique translation keys for the ZED-F9P and ZED-X20P labels to `locale/en/messages.json`, replace the option text with the corresponding `data-i18n` attributes, and preserve the option values used by the preset logic.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. New receiver detection stays hidden 🐞 Bug ☼ Reliability
Description
The new hardware mappings depend on updateHardwareStatus(), which runs only once 500 ms after the
GPS tab is initialized. When the asynchronous GPS statistics response arrives later, the new
receiver code is stored but the status indicator is never refreshed, so users do not see that the
F9P or X20P was detected.
Code

tabs/gps.js[R418-419]

+                case 0x54: return 'x20p';
+                case 0x89: return 'f9p';
Evidence
The new 0x54 and 0x89 mappings are consumed by the hardware-status path. hwVersion starts at zero
and is populated only when an asynchronous GPS statistics response contains byte 20; the tab starts
a sequential RAW GPS → COMP GPS → GPS statistics request chain, but the status indicator is checked
only once after 500 ms. If that response takes longer than 500 ms, the new mappings are never
reflected in the UI.

tabs/gps.js[418-419]
tabs/gps.js[472-482]
tabs/gps.js[589-598]
js/fc.js[315-334]
js/msp/MSPHelper.js[256-267]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
The new F9P and X20P detection mappings are only useful to the hardware-status indicator if GPS statistics arrive before the single 500 ms status check. GPS statistics are fetched asynchronously and may arrive later, leaving the detected receiver undisplayed for the rest of the tab session.

Fix Focus Areas
- tabs/gps.js[418-419]
- tabs/gps.js[472-482]
- tabs/gps.js[589-598]

Recommended Fix
Invoke `updateHardwareStatus()` after `FC.GPS_DATA.hwVersion` is populated, or retry the status check until GPS statistics are available. Keep the update idempotent so repeated GPS polling does not duplicate or regress the indicator.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 15 rules
Review mode: Auto: 🚀 Fast: The change is a small, localized addition of GPS preset data and two auto-detection mappings with no broad or high-risk behavior.

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread tabs/gps.html
Comment on lines +54 to +55
<option value="f9p">u-blox ZED-F9P</option>
<option value="x20p">u-blox ZED-X20P</option>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

1. New gps preset labels stay untranslated 📘 Rule violation ✧ Quality

The added f9p and x20p option labels are hardcoded English text without data-i18n translation
keys. Users viewing a non-English locale still see these newly introduced preset names in English
whenever the GPS preset selector is displayed.
Agent Prompt
## Issue description
The new GPS preset option labels are hardcoded English strings and do not use the project's i18next `data-i18n` mechanism, so they remain untranslated in localized interfaces.

## Fix Focus Areas
- tabs/gps.html[54-55]
- locale/en/messages.json

## Recommended Fix
Add unique translation keys for the ZED-F9P and ZED-X20P labels to `locale/en/messages.json`, replace the option text with the corresponding `data-i18n` attributes, and preserve the option values used by the preset logic.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread tabs/gps.js
Comment on lines +418 to +419
case 0x54: return 'x20p';
case 0x89: return 'f9p';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. New receiver detection stays hidden 🐞 Bug ☼ Reliability

The new hardware mappings depend on updateHardwareStatus(), which runs only once 500 ms after the
GPS tab is initialized. When the asynchronous GPS statistics response arrives later, the new
receiver code is stored but the status indicator is never refreshed, so users do not see that the
F9P or X20P was detected.
Agent Prompt
Issue description
The new F9P and X20P detection mappings are only useful to the hardware-status indicator if GPS statistics arrive before the single 500 ms status check. GPS statistics are fetched asynchronously and may arrive later, leaving the detected receiver undisplayed for the rest of the tab session.

Fix Focus Areas
- tabs/gps.js[418-419]
- tabs/gps.js[472-482]
- tabs/gps.js[589-598]

Recommended Fix
Invoke `updateHardwareStatus()` after `FC.GPS_DATA.hwVersion` is populated, or retry the status check until GPS statistics are available. Keep the update idempotent so repeated GPS polling does not duplicate or regress the indicator.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

This branch has not been deployed

No deployments
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.

1 participant