Skip to content

Commit 995a8c8

Browse files
wip
1 parent ad37b11 commit 995a8c8

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

core/frontend/src/components/autopilot/FirmwareManager.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ export default Vue.extend({
552552
const log = JSON.parse(line)
553553
554554
// Check if backend sent "done" signal to close connection
555-
if (log.stream === 'done' || log.stream.includes('Started autopilot')) {
555+
if (log.stream.includes('Started autopilot')) {
556556
// Close the progress dialog immediately
557557
this.install_status = InstallStatus.Succeeded
558558
this.install_result_message = 'Installation completed'
@@ -569,13 +569,10 @@ export default Vue.extend({
569569
570570
// Check if there were any error messages in the logs
571571
const hasErrors = this.install_logs.some((log) => log.stream === 'stderr')
572-
573-
if (hasErrors) {
572+
const lastError = this.install_logs.filter((log) => log.stream === 'stderr').pop()
573+
// edge case. the re-plug message is not an error, but is thrown to stderr to get user's attention
574+
if (hasErrors && !lastError?.data.includes('re-plug the USB connector')) {
574575
this.install_status = InstallStatus.Failed
575-
// Get the last error message
576-
const lastError = this.install_logs
577-
.filter((log) => log.stream === 'stderr')
578-
.pop()
579576
this.install_result_message = lastError?.data || 'Installation failed'
580577
const message = `Could not install firmware: ${this.install_result_message}.`
581578
notifier.pushError('FILE_FIRMWARE_INSTALL_FAIL', message)

core/services/ardupilot_manager/flight_controller_detector/mavlink_board_id.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _get_board_id_sync(port_path: str, baudrate: int = 115200) -> Optional[int]:
8888
"""
8989
try:
9090
# Set a short timeout for individual reads
91-
with serial.Serial(port_path, baudrate, timeout=0.2, exclusive=True) as ser:
91+
with serial.Serial(port_path, baudrate, timeout=0.2, exclusive=True, write_timeout=0.2) as ser:
9292
# Clear any existing data
9393
ser.reset_input_buffer()
9494

0 commit comments

Comments
 (0)