Skip to content

gps base: fix Septentrio automatic configuration for RTK base station (port detection) - #3752

Open
bgptiste wants to merge 3 commits into
ArduPilot:masterfrom
bgptiste:fix-septentrio-base-autoconfig
Open

gps base: fix Septentrio automatic configuration for RTK base station (port detection)#3752
bgptiste wants to merge 3 commits into
ArduPilot:masterfrom
bgptiste:fix-septentrio-base-autoconfig

Conversation

@bgptiste

@bgptiste bgptiste commented Jul 28, 2026

Copy link
Copy Markdown

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):

USB1+USB2+COM1+COM2+COM3

However, hard-coding this list of ports raises two issues:

  • Hardware differences between receivers: For example, Mosaic-H receivers provide serial ports USB1+USB2+COM1+COM2+COM3+COM4, whereas Mosaic-G5 receivers only support USB1+USB2+COM1+COM2. Attempting to target non-existent ports like COM3 on a Mosaic-G5 receiver will result in a command error, causing the automatic configuration to fail.
  • Unnecessary multi-port output: Only one port is actively used to stream corrections. Unnecessarily broadcasting RTCM messages across unused ports can interfere with ports already reserved for other communications or setups.

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:

$R: gecm
  EchoMessage [...]
USB1>

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 LastDetectedPort for 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:

USB1+USB2+COM1+COM2

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:

  • Flight controller: Cube Orange+
  • Autopilot firmware: ArduCopter v4.7.0
  • Ground control station: Mission Planner v1.3.83 from the fix-septentrio-base-autoconfig branch
  • Primary receiver (vehicle): Septentrio Mosaic-G5
  • RTK base receivers tested (GCS serial/USB): Septentrio Mosaic-G5 and Mosaic-H

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