Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

(v2) automatic settings migration from 1.9.x to 2.0 #431

Closed
proddy opened this issue Jul 23, 2020 · 7 comments
Closed

(v2) automatic settings migration from 1.9.x to 2.0 #431

proddy opened this issue Jul 23, 2020 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@proddy
Copy link
Collaborator

proddy commented Jul 23, 2020

Detect the 1.9.x json setting files in SPIFFS, convert over to 2.0 in LittleFS.

@proddy
Copy link
Collaborator Author

proddy commented Jul 31, 2020

This turns out to be harder than expected. EMS-ESP 1.9 uses the SPIFFS filesystem. There is no easy way to detect which type of filesystem is present on an ESP. My original idea was to mount SPIFFFs, detect the old config files, load them and then write them back to LittleFS which is the new filesystem ib v2. Problem here is that as soon as you mount a FS and it fails, it will format the complete filesystem. So basically each time you start EMS-ESP v2 all the settings will be erased. Sucks.

Then I thought about building a web UI to import the backup file from 1.9. In this scenario, the user would have gone into the AP and already at the settings screen so might as well just complete the rest of the key settings like wifi SSID, password and MQTT IP with a few clicks.

Conclusion, for the few users on 1.9 its not worth it. I'll just document the steps in the wiki.

@proddy proddy closed this as completed Jul 31, 2020
@proddy proddy reopened this Aug 28, 2020
@proddy
Copy link
Collaborator Author

proddy commented Aug 28, 2020

Ok, I found a way to make this work. Will push in a change

proddy added a commit that referenced this issue Aug 28, 2020
@proddy proddy closed this as completed Aug 28, 2020
@proddy
Copy link
Collaborator Author

proddy commented Aug 28, 2020

@bbqkees can you help test? When uploading the firmware over an older v.1.9 firmware it should automatically port over the settings.

@proddy proddy reopened this Aug 28, 2020
@bbqkees
Copy link

bbqkees commented Sep 4, 2020

I ran a number of tests yesterday.

If you select the V2 8266 bin file from the releases page and upload it via the 1.9.5 web interface the update to V2 works fine.
The update itself works on both the Lolin Wemos D1 Mini V3.1 and the clone Wemos D1 Mini V2 version.
(I used those clones on the very first Gateways until about a year ago).
I tried it powered via USB and on a 1.6 Gateway bus powered.
(So its safe to update a Gateway. Just make sure you haven't downloaded the ESP32 bin file instead of the ESP8266 file.)

But indeed with an update via the web, settings are not migrated from 1.9.5 to V2.
So it starts clean.

I don't think this is a major problem, its just basically setting WiFi and MQTT and of you go.
But of course it would be better if the settings are actually kept.

@proddy proddy self-assigned this Sep 5, 2020
@proddy
Copy link
Collaborator Author

proddy commented Sep 5, 2020

made some changes, tested it too and it seems to work (at least for me). Also via the 1.9 web 'upload' page.

2.0.1b4

@proddy
Copy link
Collaborator Author

proddy commented Sep 12, 2020

There have been reports of the settings not being persisted after a reboot.

@proddy proddy changed the title (v2) automatic migration from 1.9.x to 2.0 (v2) automatic settings migration from 1.9.x to 2.0 Sep 12, 2020
@proddy
Copy link
Collaborator Author

proddy commented Sep 12, 2020

There have been reports of the settings not being persisted after a reboot.

ran a few tests again, erased flash, uploaded 1.9.5, set settings, tested it, upgraded to 2.0.1. Not issues.

@proddy proddy closed this as completed Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants