homie-esp8266
homie-esp8266 copied to clipboard
Change FS from SPIFFS to LittleFS
Just replace FS ... work for me...
I use
pio run -t uploadfs
to upload my config.json for every device to SPIFFS. I don't use the config mode at all and I even use the compile flag to remove the code for the config mode. How do I upload the config.json to LittleFS?
I also replaced all occurrences of Spiffs with LittleFS, but I see two pending problems:
- Uploading to LittleFS is not yet supported by PlatformIO
- Other libraries on which Homie depends, also use Spiffs and should be migrated too (alt least EspAsyncWebServer)
I'm pretty sure we shouldn't mix the two and I'm also pretty sure that we should put everything into defines at least for some time, so that people can have spiffs as default. After a while we could make LittleFS the default.
Which is why I haven't pursued the issue further (yet)
closes #682
Hi! i got work it with this... https://github.com/me-no-dev/ESPAsyncWebServer/issues/792#issuecomment-648144145 and now have trouble only with subdir's in ESP_AsyncFSBrowser all other work ok.
Is LittleFS availlable on ESP32?
Is there a migration strategy for moving from SPIFFS to LittleFS? If SPIFFS is used in actual products, there is data stored in those products that can't just be thrown away if the software is upgraded.
That is exactly the reason why I haven't merged anything yet. I remember coming across a project that worked on in-place migration of the data, but can't find it now.
Hi, I really enjoy homie-esp8266 since some days and would love to see this project to evolve. I wonder whether there are some news to this topic? May I add my2cents? In my opinion, conversion of any existing filesystem/data on running systems is out-of-scope of this project. Adding code to support an automatic conversion from spiffs to littlefs (whatever this might look like) would result in (a lot of additional) code/dependencies which doesn't fit into the "Homie" scope. Have in mind that this would raise future efforts to maintain that "legacy code". I also couldn't find any other project considering a conversion from spiffs to littlefs on running systems, so why should this project do?
Nevertheless, I feel the pain loosing data. So I'd suggest a process (and maybe tools/simple sketches) to download the data, update the system and upload the data. Either manually done, or by leveraging the OTA feature. Well documented, but not implemented into this project.
You also might want to read this thread, discussing this topic, options and efforts. Start reading from "Feb 25 14:14": Gitter Thread
Also, for a limited time and depending on the effort, both spiffs and littlefs could be supported by using compiler flags, resulting in running either spiffs or littlefs (but not both at the same time). So people have some time to migrate their systems.
Thoughts?
Supporting both filesystems through compiler flags was an earlier suggestion, too. This absolutely makes sense. I personally am still missing a tool to upload config.json to LittleFS filesystem, so I can test it.
Afaik, ArduinoIDE supports uploading files to littlefs. But I'm not sure if it's already built in or a plugin is required. I use PlatformIO, and by simply setting littlefs in the environment configuration you can upload files to littlefs using the pio cli.
May I ask what exactly you're missing? Don't you use ArduinoIDE or PlatformIO?
I am using PlatformIO and did not have a look yet into PlatformIO and LittleFS. Good to hear, that it is supported.