diff --git a/core/frontend/src/components/wizard/Wizard.vue b/core/frontend/src/components/wizard/Wizard.vue index 9a758c0e5f..c6326f9a67 100644 --- a/core/frontend/src/components/wizard/Wizard.vue +++ b/core/frontend/src/components/wizard/Wizard.vue @@ -83,6 +83,14 @@ + + {{ board_detection_message }} +
`Failed to disable smart wifi hotspot: ${error.message ?? error.response?.data}.`) }, async installLatestStableFirmware(vehicle: Vehicle): Promise { + if (!await this.isBoardDetected()) { + return 'No flight controller board detected.' + } + if (this.retry_count) { console.debug('Going to reboot flight controller on retry.') mavlink2rest.sendMessage( @@ -746,6 +767,22 @@ export default Vue.extend({ validateParams(): boolean { return this.$refs.param_loader?.validateParams() }, + async isBoardDetected(): Promise { + try { + await fetchCurrentBoard() + } catch (error) { + this.board_not_detected = true + this.board_detection_message = `Failed to communicate with autopilot manager: ${error}` + return false + } + if (!autopilot.current_board) { + this.board_not_detected = true + this.board_detection_message = 'No flight controller detected.' + return false + } + this.board_not_detected = false + return true + }, }, })