-
Notifications
You must be signed in to change notification settings - Fork 370
Add GPS preset UI with auto-detection and M9 Precision/Sport modes #2526
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
Open
sensei-hacker
wants to merge
5
commits into
iNavFlight:maintenance-9.x
Choose a base branch
from
sensei-hacker:feature-gps-preset-ui
base: maintenance-9.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add GPS preset UI with auto-detection and M9 Precision/Sport modes #2526
sensei-hacker
wants to merge
5
commits into
iNavFlight:maintenance-9.x
from
sensei-hacker:feature-gps-preset-ui
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implement user-friendly GPS configuration presets for M8/M9/M10 modules: - Add GPS preset dropdown with Auto-detect, Manual, M8, M9, M10, and M10-highperf options - Add GPS update rate input field (previously not exposed in UI) - Extend MSP_GPSSTATISTICS to parse hwVersion for auto-detection - Preset configuration disables (but shows) settings when active - Add preset info box explaining each preset's characteristics Presets configured per manager feedback: - M8: 4 constellations @ 8Hz (conservative) - M9: 4 constellations @ 10Hz (hardware limit: 16 sats) - M10: 4 constellations @ 6Hz (default CPU clock safe rate) - M10-highperf: 4 constellations @ 10Hz (for high-perf clock users) - Manual: Full user control (default for existing users) Auto-detection uses FC.GPS_DATA.hwVersion from MSP_GPSSTATISTICS (firmware extension pending - see documentation). Translation strings added for en locale. Related: GPS optimization research based on Jetrell's M10 testing data
…ection - Add GPS_PRESETS object with 7 preset options - Split M9 into Precision (5Hz, 32 sats) and Sport (10Hz, 16 sats) modes - Update M10 presets (3 const @ 8Hz, 4 const @ 10Hz for high-perf) - Add detectGPSPreset() to map hwVersion to preset - Add applyGPSPreset() to apply constellation/rate settings - Extend MSPHelper to parse hwVersion from MSP_GPSSTATISTICS (backward compatible) - Update HTML dropdown with new preset options Research: M9 hardware limits to 16 satellites at >=10Hz, 32 satellites at <10Hz See: claude/developer/docs/gps/m9-16-satellite-limitation-official.md
When navigating away from GPS tab and back, the preset dropdown was resetting to "Manual Settings" every time, even if the GPS module had been auto-detected. Changes: - Check if GPS data (hwVersion) is already available on tab init - If available and valid (>0), auto-detect and apply preset - If not available, fall back to manual mode as before This preserves the auto-detected preset when switching between tabs, providing a smoother user experience. Related: GPS preset UI feature
Contributor
PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
Addresses Qodo code review suggestion to ensure state consistency
when programmatically setting GPS configuration values.
When presets change constellation checkboxes and rate values, we now
trigger their 'change' events. This follows the pattern used in other
tabs (firmware_flasher.js, pid_tuning.js, sensors.js) and ensures:
- Save button state updates correctly
- Any change event handlers fire properly
- Configuration tracking remains consistent
Without .trigger('change'), programmatic updates bypass event handlers
that may be listening for user changes to these controls.
Collaborator
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
Summary
Adds GPS configuration preset system with auto-detection of GPS module type (M8/M9/M10) and optimized presets for each module. Includes educational two-preset approach for M9 modules to help users understand the accuracy vs latency trade-off.
Screenshot:

Changes
New Features
Files Modified
Preset Configurations
Research & Citations
This work is based on extensive research and community contributions:
u-blox Forum Research
Clive Turvey's Code Analysis
PX4 GPS Driver Decision
Field Testing
Implementation Details
Auto-Detection Logic
FC.GPS_DATA.hwVersionfrom MSP_GPSSTATISTICSBackward Compatibility
Testing
Tested ✅
Testing Needed⚠️
Related PR
Educational Value
The two M9 presets help users understand:
Defaults to Precision Mode (matches PX4/ArduPilot) but gives users informed choice.
Testing help appreciated! If you have M9 or M10 modules, please test auto-detection and verify satellite counts at various rates.
PR Type
Enhancement, New Feature
Description
Add GPS preset system with auto-detection for M8/M9/M10 modules
Implement M9 Precision (5Hz) and Sport (10Hz) modes for accuracy/latency trade-off
Expose GPS update rate control in UI with preset-based configuration
Parse hwVersion from MSP_GPSSTATISTICS for automatic GPS module detection
Diagram Walkthrough
File Walkthrough
MSPHelper.js
Parse hwVersion from MSP_GPSSTATISTICS for auto-detectionjs/msp/MSPHelper.js
hwVersionfield fromMSP_GPSSTATISTICS response
offset 20
MSP_GPSSTATISTICS
gps.js
Implement GPS preset detection and application logictabs/gps.js
GPS_PRESETSobject with 7 preset configurations (M8, M9Precision/Sport, M10, M10 High-Perf, Manual, Auto)
detectGPSPreset()function to map hwVersion (800/900/1000)to appropriate preset
applyGPSPreset()function to apply constellation/ratesettings and disable/enable controls
auto-detects or defaults to manual mode
gps.html
Add GPS preset dropdown and update rate UI controlstabs/gps.html
M9 Precision/Sport, M10, M10 High-Perf)
details
preset-controlledclass to constellation checkboxes forpreset control
messages.json
Add i18n strings for GPS preset UI elementslocale/en/messages.json