mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-25 17:25:16 +03:00
Prevent issues with corrupted firmware using outdated configurator (#3793)
* Deny use of newer firmware not supported by configurator * Update dialog * Abort on dialog * Update message
This commit is contained in:
parent
c3f3722634
commit
92c11394af
3 changed files with 20 additions and 7 deletions
|
@ -267,7 +267,7 @@
|
||||||
"message": "You are using an outdated version of the <b>Betaflight Configurator</b>.<br>$t(configuratorUpdateHelp.message)"
|
"message": "You are using an outdated version of the <b>Betaflight Configurator</b>.<br>$t(configuratorUpdateHelp.message)"
|
||||||
},
|
},
|
||||||
"configuratorUpdateHelp": {
|
"configuratorUpdateHelp": {
|
||||||
"message": "Using a newer version of the firmware with an outdated version of Configurator means that changing some settings will result in a <strong>corrupted firmware configuration and a non-working craft</strong>. Furthermore, some features of the firmware will only be configurable in CLI.<br><strong>Betaflight Configurator version <b>$1</b> is available for download online</strong>, please visit <a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\">this page</a> to download and install the latest version with fixes and improvements.<br>Please close the configurator window before updating."
|
"message": "Using a newer version of the firmware with an outdated version of Configurator means that changing some settings will result in a <strong>corrupted firmware configuration and a non-working craft</strong>.<br />Furthermore, some features of the firmware will only be configurable in CLI.<br g/><br /><strong>Betaflight Configurator version <b>$1</b> is available for download online</strong>.<br />Download and install the latest version of configurator with fixes and improvements <a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\">here</a><br>Configurator window needs to be closed before updating."
|
||||||
},
|
},
|
||||||
"configuratorUpdateWebsite": {
|
"configuratorUpdateWebsite": {
|
||||||
"message": "Go to Release Website"
|
"message": "Go to Release Website"
|
||||||
|
@ -517,10 +517,10 @@
|
||||||
"message": "The following <strong>problems with your configuration</strong> were detected:"
|
"message": "The following <strong>problems with your configuration</strong> were detected:"
|
||||||
},
|
},
|
||||||
"reportProblemsDialogFooter": {
|
"reportProblemsDialogFooter": {
|
||||||
"message": "Please <strong>fix these problems before attempting to fly your craft</strong>."
|
"message": "<span class=\"message-negative\"><strong>You need to fix these problems before attempting to fly your craft</span></strong>."
|
||||||
},
|
},
|
||||||
"reportProblemsDialogAPI_VERSION_MAX_SUPPORTED": {
|
"reportProblemsDialogAPI_VERSION_MAX_SUPPORTED": {
|
||||||
"message": "<strong>the version of configurator that you are using ($3) is older than the firmware you are using ($4)</strong>.<br>$t(configuratorUpdateHelp.message)"
|
"message": "<span class=\"message-negative\"><strong>The configurator version used ($3) does not support firmware $4</strong></span>.<br>$t(configuratorUpdateHelp.message)"
|
||||||
},
|
},
|
||||||
"reportProblemsDialogMOTOR_PROTOCOL_DISABLED": {
|
"reportProblemsDialogMOTOR_PROTOCOL_DISABLED": {
|
||||||
"message": "<strong>there is no motor output protocol selected</strong>.<br>Please select a motor output protocol appropriate for your ESCs in '$t(configurationEscFeatures.message)' on the '$t(tabMotorTesting.message)' tab.<br>$t(escProtocolDisabledMessage.message)"
|
"message": "<strong>there is no motor output protocol selected</strong>.<br>Please select a motor output protocol appropriate for your ESCs in '$t(configurationEscFeatures.message)' on the '$t(tabMotorTesting.message)' tab.<br>$t(escProtocolDisabledMessage.message)"
|
||||||
|
|
|
@ -487,18 +487,26 @@ function checkReportProblems() {
|
||||||
problemDialogList.empty();
|
problemDialogList.empty();
|
||||||
|
|
||||||
let problems = [];
|
let problems = [];
|
||||||
|
let abort = false;
|
||||||
|
|
||||||
if (semver.gt(FC.CONFIG.apiVersion, CONFIGURATOR.API_VERSION_MAX_SUPPORTED)) {
|
if (semver.gt(FC.CONFIG.apiVersion, CONFIGURATOR.API_VERSION_MAX_SUPPORTED)) {
|
||||||
const problemName = 'API_VERSION_MAX_SUPPORTED';
|
const problemName = 'API_VERSION_MAX_SUPPORTED';
|
||||||
problems.push({ name: problemName, description: i18n.getMessage(`reportProblemsDialog${problemName}`,
|
problems.push({ name: problemName, description: i18n.getMessage(`reportProblemsDialog${problemName}`,
|
||||||
[CONFIGURATOR.latestVersion, CONFIGURATOR.latestVersionReleaseUrl, CONFIGURATOR.getDisplayVersion(), FC.CONFIG.flightControllerVersion])});
|
[CONFIGURATOR.latestVersion, CONFIGURATOR.latestVersionReleaseUrl, CONFIGURATOR.getDisplayVersion(), FC.CONFIG.flightControllerVersion])});
|
||||||
needsProblemReportingDialog = true;
|
needsProblemReportingDialog = true;
|
||||||
|
|
||||||
|
abort = true;
|
||||||
|
GUI.timeout_remove('connecting'); // kill connecting timer
|
||||||
|
$('div.connect_controls a.connect').click(); // disconnect
|
||||||
}
|
}
|
||||||
|
|
||||||
needsProblemReportingDialog = checkReportProblem('MOTOR_PROTOCOL_DISABLED', problems) || needsProblemReportingDialog;
|
if (!abort) {
|
||||||
|
// only check for problems if we are not already aborting
|
||||||
|
needsProblemReportingDialog = checkReportProblem('MOTOR_PROTOCOL_DISABLED', problems) || needsProblemReportingDialog;
|
||||||
|
|
||||||
if (have_sensor(FC.CONFIG.activeSensors, 'acc')) {
|
if (have_sensor(FC.CONFIG.activeSensors, 'acc')) {
|
||||||
needsProblemReportingDialog = checkReportProblem('ACC_NEEDS_CALIBRATION', problems) || needsProblemReportingDialog;
|
needsProblemReportingDialog = checkReportProblem('ACC_NEEDS_CALIBRATION', problems) || needsProblemReportingDialog;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needsProblemReportingDialog) {
|
if (needsProblemReportingDialog) {
|
||||||
|
@ -519,7 +527,10 @@ function checkReportProblems() {
|
||||||
$('#dialogReportProblems-closebtn').focus();
|
$('#dialogReportProblems-closebtn').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
processUid();
|
if (!abort) {
|
||||||
|
// if we are not aborting, we can continue
|
||||||
|
processUid();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@ function notifyOutdatedVersion(data) {
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.showModal();
|
dialog.showModal();
|
||||||
|
} else {
|
||||||
|
CONFIGURATOR.latestVersion = data.version;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue