gps base: fix Septentrio automatic configuration for RTK base station (port detection) - #3752
Open
bgptiste wants to merge 3 commits into
Open
gps base: fix Septentrio automatic configuration for RTK base station (port detection)#3752bgptiste wants to merge 3 commits into
bgptiste wants to merge 3 commits into
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
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.
Issue
This pull request resolves an issue with port availability disparities across different Septentrio receivers when automatically configuring a receiver as an RTK base station for injecting corrections.
This feature was originally introduced in PR #3324.
In the initial implementation, a static set of ports was defined for RTCM stream outputs (RTK correction data):
However, hard-coding this list of ports raises two issues:
USB1+USB2+COM1+COM2+COM3+COM4, whereas Mosaic-G5 receivers only supportUSB1+USB2+COM1+COM2. Attempting to target non-existent ports likeCOM3on a Mosaic-G5 receiver will result in a command error, causing the automatic configuration to fail.Proposal
This PR introduces dynamic port detection to identify the active port used by the receiver to communicate with Mission Planner. This ensures that auto-configuration works reliably across all Septentrio receivers, regardless of their specific hardware port layout.
To achieve this, a ping command (
gecm/getEchoMessage) is sent to the receiver, and the active port name is parsed directly from the prompt line in the response (e.g.,USB1>), which is structured as follows:Since detection is powered by regular expressions, port names containing single or multi-digit identifiers (e.g.,
COM10) are dynamically matched for future-proof compatibility.The detected port name is cached in
LastDetectedPortfor the duration of the active connection session (initialized during base receiver setup). This eliminates redundant detection cycles during subsequent configuration calls (such as adjusting RTCM message intervals or constellation selections).If dynamic port detection fails or times out during setup, it gracefully falls back to targeting:
These four interfaces cover the standard default ports across Septentrio Mosaic receivers.
Testing executed
This fix has been tested and validated using the following hardware and software setup:
fix-septentrio-base-autoconfigbranch