Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent issues with corrupted firmware using outdated configurator #3793

Merged
merged 4 commits into from
Feb 15, 2024

Conversation

haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Feb 10, 2024

  • Configurator should not be able to connect to newer unsupported firmware versions, i.e. 10.10 should not be able to connect to 1.47 firmware. We cannot change earlier versions of configurators as I think we should start doing it now.
  • Configurator 10.10 should be compatible with firmware 4.0 - 4.5 so there is no reason to use an older configurator besides firmware 3.x users.
  • Main problem is users just ignore the dialog and don't know what is wrong.
  • This PR does not allow 10.10 to work with 4.7 and so on.
  • Please ignore version number here - as this is the original dialog:

BEFORE:
image

NOW:
image

@haslinghuis haslinghuis added this to the 10.10.0 milestone Feb 10, 2024
@haslinghuis haslinghuis self-assigned this Feb 10, 2024

This comment has been minimized.

@ctzsnooze
Copy link
Member

The message seems confusing. Where it says "please upgrade the configurator to version nnnn", shouldn't that version be a configurator version?

And the user indicated firmware version should be a 'user friendly' text like
'4.5'?

Perhaps this should just be a warning, not a block on progressing further?

@HThuren
Copy link
Member

HThuren commented Feb 11, 2024

I suggest this only act in non expert mode, since experts likely know what to do with different versions.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@haslinghuis haslinghuis changed the title Deny use of newer firmware not supported by configurator Prevent corrupted firmware with outdated configurator Feb 11, 2024
@haslinghuis haslinghuis changed the title Prevent corrupted firmware with outdated configurator Prevent issues with corrupted firmware using outdated configurator Feb 12, 2024
@ASDosjani
Copy link
Contributor

I suggest this only act in non expert mode, since experts likely know what to do with different versions.

I disagree as everyone ticks expert mode even if they don't know what it does.

@sugaarK
Copy link
Member

sugaarK commented Feb 13, 2024

Maybe we change the message to be a bit more aggressive? No please etc.. warning in capitalised red. Red things they seem to notice a bit better. Personally I’m in favour of blocking unsupported versions. When we go to 5.0 I think also we end the backwards compatibly. All the configurator team quip about how much easier it would be if we did this

@HThuren
Copy link
Member

HThuren commented Feb 13, 2024

But remember to have a chance not stuck in deadend, ie firmware / configurator version combination where not able to make backup and/or not able to upgrade firmware.
Maybe in expertmode or something
...just saying :-)

@HThuren
Copy link
Member

HThuren commented Feb 13, 2024

I suggest this only act in non expert mode, since experts likely know what to do with different versions.

I disagree as everyone ticks expert mode even if they don't know what it does.

yes, you have a point

This comment has been minimized.

@haslinghuis haslinghuis force-pushed the deny-new-firmware branch 2 times, most recently from 0cd6826 to 2f2999f Compare February 13, 2024 01:37
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

Do you want to test this code? Here you have an automated build:
Betaflight-Configurator-Android
Betaflight-Configurator-Linux
Betaflight-Configurator-macOS
Betaflight-Configurator-Windows
WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!

@nerdCopter
Copy link
Member

min & max MSP gating maybe. (emuflight/EmuConfigurator#383)

but this PR works too. will test soonish.

@nerdCopter
Copy link
Member

nerdCopter commented Feb 14, 2024

it is based upon MSP (not version).
tested with version change only, then both. it only triggered due to MSP bump.

$ git diff
diff --git a/src/main/build/version.h b/src/main/build/version.h
index d1ff1cc54..bd42d3e81 100644
--- a/src/main/build/version.h
+++ b/src/main/build/version.h
@@ -25,7 +25,7 @@
 #define FC_FIRMWARE_NAME            "Betaflight"
 #define FC_FIRMWARE_IDENTIFIER      "BTFL"
 #define FC_VERSION_MAJOR            4  // increment when a major release is made (big new feature, etc)
-#define FC_VERSION_MINOR            5  // increment when a minor release is made (small new feature, change etc)
+#define FC_VERSION_MINOR            6  // increment when a minor release is made (small new feature, change etc)
 #define FC_VERSION_PATCH_LEVEL      0  // increment when a bug is fixed
 
 #define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL)
diff --git a/src/main/msp/msp_protocol.h b/src/main/msp/msp_protocol.h
index c776ce3db..36a629641 100644
--- a/src/main/msp/msp_protocol.h
+++ b/src/main/msp/msp_protocol.h
@@ -62,7 +62,7 @@
 #define MSP_PROTOCOL_VERSION                0
 
 #define API_VERSION_MAJOR                   1  // increment when major changes are made
-#define API_VERSION_MINOR                   46 // increment after a release, to set the version for all changes to go into the following release (if no changes to MSP are made between the releases, this can be reverted before the release)
+#define API_VERSION_MINOR                   47 // increment after a release, to set the version for all changes to go into the following release (if no changes to MSP are made between the releases, this can be reverted before the release)
 
 #define API_VERSION_LENGTH                  2
 
## master...origin/master

results:
image

@nerdCopter
Copy link
Member

also note that it required acc calib on first flash (not a second or third)

@HThuren
Copy link
Member

HThuren commented Feb 15, 2024

@haslinghuis I can approve, if I'm allowed

@sugaarK
Copy link
Member

sugaarK commented Feb 15, 2024

@haslinghuis I can approve, if I'm allowed

if you deem It solid then go for it

@haslinghuis haslinghuis requested a review from HThuren February 15, 2024 11:57
Copy link
Member

@HThuren HThuren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems stable, and I tried some combinations of 'bad' versions.

@haslinghuis haslinghuis merged commit 92c1139 into betaflight:master Feb 15, 2024
8 checks passed
@haslinghuis haslinghuis deleted the deny-new-firmware branch February 15, 2024 21:41
chmelevskij pushed a commit to chmelevskij/betaflight-configurator that referenced this pull request Apr 27, 2024
…etaflight#3793)

* Deny use of newer firmware not supported by configurator

* Update dialog

* Abort on dialog

* Update message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: COMPLETED
Development

Successfully merging this pull request may close these issues.

6 participants