Repository navigation
fix: connection refused on telemetry, fallback check to 57600 baudrate - #2070
OmkarSarkar204 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Fallback conditions, reconnect persistence, and regression test coverage need to be addressed.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a 57600-baud fallback for serial flight-controller auto-detection.
Changes:
- Defines a fallback baudrate.
- Retries failed serial detection at 57600 baud.
File summaries
| File | Summary |
|---|---|
ardupilot_methodic_configurator/backend_flightcontroller_connection.py |
Implements serial baudrate fallback logic. |
Review details
Suppressed comments (2)
ardupilot_methodic_configurator/backend_flightcontroller_connection.py:379
- When auto-detection is called with an explicitly selected baudrate such as 921600, a failed first attempt still enters this branch because the condition only excludes 57600. That silently overrides the caller's choice and can connect at an unintended speed; the comment above describes this fallback as applying after a failed DEFAULT_BAUDRATE attempt. Restrict this condition to
connection_baudrate == DEFAULT_BAUDRATE(or otherwise only enable it when the default was selected).
if (
not autodetect_serial[-1].device.startswith(("tcp:", "udp:"))
and int(DEFAULT_FALLBACK_BAUDRATE) != connection_baudrate
ardupilot_methodic_configurator/backend_flightcontroller_connection.py:396
- After this retry succeeds,
_baudratestill contains the originalconnection_baudrate.FlightController.reset_and_reconnect()later callscreate_connection_with_retry(..., baudrate=self.baudrate)directly, bypassing this fallback, so a board discovered only at 57600 will be retried at 115200 after a reboot and fail. Persist the effective fallback baudrate or route that reconnect path through the same fallback logic.
if err == "":
return ""
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
14c6bfe to
2ad8146
Compare
Previous review (2026-09-16)Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting. Reviewed at head Full report, including everything that was checked and found clean: https://uav.tridgell.net/DevCallReviews/2026_09_17_AIReview/devcall_pr_reviews.html#prMethodicConfigurator-2070 Verdict: REQUEST CHANGES The premise is right and useful — SiK radios default to 57600 while the tool defaults to 115200, so auto-detect silently fails — and the structural concerns all check out clean: the fallback is correctly gated on the no-heartbeat error alone (not a blanket BUG — The fallback compares against the untranslated English literal, so it never fires in any other UI language. The message is produced by ISSUE — An explicitly requested baudrate is silently overridden. The guard only excludes 57600, so ISSUE — The effective baudrate is not persisted, so a board found at 57600 will fail to come back after a reboot. After a successful fallback, ISSUE — The new test's key assertion is tautological, and neither guard is covered. It compares the observed baudrate against Lower-priority notes (1)
What was checked and found cleanThe structural concerns all check out, and the failing CI check is not this PR's. Exception selection is right. Provoked with pyserial/pymavlink 3.5/2.4.49: a missing port raises |
34c41d9 to
a2b7fd5
Compare
Signed-off-by: Omkar Sarkar <[email protected]>
a2b7fd5 to
dc229cc
Compare
|
Automated review note — AI-generated (Claude), validated against the live diff (Claude + Codex cross-checked). Please sanity-check before acting. Re-reviewed at head The blocker and both functional issues from my previous comment are fixed. Only the test-coverage point is still open, plus the low-priority note. Thanks, this is a clean update.
The structural points from last time still hold at this head:
Still open: The new test doesn't pin any of this round's three fixes. Each of these changes still leaves all 155 tests in
Deleting the whole fallback block does fail the test, so it does exercise the path. Suggestions:
Minor:
CI: |
Description
Add serial baudrate fallback during FC auto detection
Checklist
git commit --signoff)Testing
Describe how you tested these changes: