diff --git a/src/FirmwarePlugin/FirmwarePlugin.cc b/src/FirmwarePlugin/FirmwarePlugin.cc index 5f57fcad3f31ef85bb98f9655d421381aa4f5715..88e82a6e386c2d93080e7307adbdf86404f4eb7d 100644 --- a/src/FirmwarePlugin/FirmwarePlugin.cc +++ b/src/FirmwarePlugin/FirmwarePlugin.cc @@ -824,6 +824,14 @@ void FirmwarePlugin::checkIfIsLatestStable(Vehicle* vehicle) _versionFileDownloadFinished(remoteFile, localFile, vehicle); sender()->deleteLater(); }); + connect( + downloader, + &QGCFileDownload::error, + this, + [=](QString errorMsg) { + qCDebug(FirmwarePluginLog) << "Failed to download the latest fw version file. Error: " << errorMsg; + downloader->deleteLater(); + }); downloader->download(versionFile); } diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 794bbdff710893cb7870b9b5c2b5618156a0c86c..6b8b6237fe7d1b290019e1d6da381111c407aaec 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1343,7 +1343,8 @@ void Vehicle::_handleAutopilotVersion(LinkInterface *link, mavlink_message_t& me nullStr[8] = 0; _gitHash = nullStr; } - if (_toolbox->corePlugin()->options()->checkFirmwareVersion()) { + if (_toolbox->corePlugin()->options()->checkFirmwareVersion() && !_checkLatestStableFWDone) { + _checkLatestStableFWDone = true; _firmwarePlugin->checkIfIsLatestStable(this); } emit gitHashChanged(_gitHash); diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index b124d80c4e9218985077258113e6bc307c3ebdc8..7b56c077843079c636c94e1938b6a4df4d27d83a 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -1504,6 +1504,7 @@ private: bool _isROIEnabled = false; Joystick* _activeJoystick = nullptr; + bool _checkLatestStableFWDone = false; int _firmwareMajorVersion; int _firmwareMinorVersion; int _firmwarePatchVersion;