General > General Technical Chat
Preserving settings over a firmware upgrade
Siwastaja:
--- Quote from: PlainName on July 28, 2023, 06:35:09 pm ---
--- Quote ---manually changing settings is not a big deal
--- End quote ---
Depends on how many, what they are, and the device. Some devices are so bleeding tedious to change anything you really don't want to do that very often, and with many devices you can't remember what you've changed since you spent that week setting it up 2 years ago (because, no export remember). That viewpoint - the user won't mind doing it all again - is what keeps stuff on old versions. If you're lucky the user will update once before finding out the best thing is to not do it again.
--- End quote ---
You missed the context. The discussion was about downgrading. That is something which doesn't happen on its own. If adjusting settings is tedious to user, manual firmware changes in the opposite direction is surely tedious as well. There must be some specific reason why user wants to do that.
Your claim that difficulty in downgrading keeps people in old versions is weird. I think it's the opposite; difficulty in downgrading but ease of upgrading would drive people into trying the new versions instead to see if they fix whatever problem they have (or think they have).
Kalvin:
--- Quote from: AndyC_772 on July 28, 2023, 12:53:16 pm ---I'm inclined to favour:
--- Code: ---if (nv.settings_version < CURRENT_SETTINGS_VERSION)
migrate_settings();
if (nv.settings_version > CURRENT_SETTINGS_VERSION)
factory_default();
--- End code ---
Downgrading firmware isn't something I'd look to explicitly lock out, but it doesn't need to be so graceful.
--- End quote ---
This scheme has been working pretty well over the years:
Firmware settings are stored as C structs. The attachment shows three different versions of the same settings structure evolving over firmware versions.
* When the firmware is run for the first time, the system doesn't find any existing settings, so it will just copy the default settings into the actual settings structure.
* When the firmware is upgraded from version 1 to version 2, the new firmware version will be able to restore the version 1 settings. The firmware will then copy the default settings from the version 2 defaults to the version 2 settings.
* When the firmware is upgraded from version 2 to version 3, the new firmware version will be able to restore the version 1 settings and version 2 settings. The firmware will then copy the default settings from the version 3 defaults to the version 3 settings.
* When the firmware is downgraded from version 3 to version 2, the new firmware version will find the old settings version 1 settings, version 2 settings, and version 3 settings. However, it will only restore the version 1 settings and version 2 settings.Typically, there are separate settings structs for different software components. This helps to keep the settings organized throughout the product's lifetime.
PlainName:
--- Quote from: Siwastaja on July 29, 2023, 10:18:56 am ---
--- Quote from: PlainName on July 28, 2023, 06:35:09 pm ---
--- Quote ---manually changing settings is not a big deal
--- End quote ---
Depends on how many, what they are, and the device. Some devices are so bleeding tedious to change anything you really don't want to do that very often, and with many devices you can't remember what you've changed since you spent that week setting it up 2 years ago (because, no export remember). That viewpoint - the user won't mind doing it all again - is what keeps stuff on old versions. If you're lucky the user will update once before finding out the best thing is to not do it again.
--- End quote ---
You missed the context. The discussion was about downgrading. That is something which doesn't happen on its own. If
--- End quote ---
I was pointing out that changing settings can be a drag. Earlier, I pointed out that sometimes you want to downgrade because of new features/bugs. Both of these are in the context of "manually changing settings is not a big deal". Admittedly, the upgrade rant that flowed from that may have confused anyone not, ah, going with the flow and fixating on the part I didn't quote (because that quote was the entire context I was discussing).
--- Quote ---Your claim that difficulty in downgrading keeps people in old versions is weird.
--- End quote ---
That's not what I claimed.
Siwastaja:
OK, so you just take words out of context to turn their meaning around, creating a strawman which you then argue against, without making it obvious you do so, wasting everyone's time. You are ignored from now on.
Navigation
[0] Message Index
[*] Previous page
Go to full version