Skip to content

Conversation

@OmkarSarkar204
Copy link
Contributor

Fixes #1198

Problem

The application hangs for approximately 2 seconds on startup when no flight controller is connected. This is caused by the auto-detection logic using the default 3 retries for every checked port.

Solution

  • Updated _register_and_try_connect to accept a retries parameter.
  • Changed the auto-detection loop to use retries=2 (1 initial attempt + 1 retry).
  • Added a test to verify the retry count.
2026-01-23 02:05:44,366 - INFO - Will connect to /dev/ttyS9 @ 115200 baud
2026-01-23 02:05:44,366 - INFO - Will connect to tcp:127.0.0.1:5760
[Errno 111] Connection refused sleeping
2026-01-23 02:05:45,367 - INFO - Will connect to udp:0.0.0.0:14550

Reasoning

Set retries=2 ensures there is still one safety retry for SITL, as suggested, but reduces the startup delay.

Signed-off-by: OmkarSarkar204 <Omkarsarkar24@gmail.com>
@amilcarlucas amilcarlucas merged commit 3158b93 into ArduPilot:master Jan 23, 2026
15 of 19 checks passed
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.

Startup delayed when no FC/SITL present due to network auto-detection retries

2 participants