Skip to content

Handle heartbeat timeout and connection errors#1028

Merged
1Blademaster merged 2 commits intomainfrom
1012-bug-error-when-connecting-to-fc
Feb 28, 2026
Merged

Handle heartbeat timeout and connection errors#1028
1Blademaster merged 2 commits intomainfrom
1012-bug-error-when-connecting-to-fc

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings February 28, 2026 13:19
@1Blademaster 1Blademaster linked an issue Feb 28, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves drone connection initialization by adding explicit handling for heartbeat timeouts and exceptions during the initial MAVLink heartbeat wait, preventing the constructor from continuing with an invalid connection state.

Changes:

  • Wrap wait_heartbeat(timeout=5) in a try/except to capture connection/heartbeat errors.
  • On heartbeat timeout, close the connection, clear self.master, set a connection error, and return early.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread radio/app/drone.py Outdated
Comment thread radio/app/drone.py Outdated
Comment thread radio/app/drone.py Outdated
@1Blademaster 1Blademaster merged commit e5e3cb5 into main Feb 28, 2026
7 checks passed
@1Blademaster 1Blademaster deleted the 1012-bug-error-when-connecting-to-fc branch February 28, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Error when connecting to FC

2 participants