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

Deprecate SPIFFS #7095

Closed
6 tasks done
devyte opened this issue Feb 20, 2020 · 12 comments · Fixed by #7263
Closed
6 tasks done

Deprecate SPIFFS #7095

devyte opened this issue Feb 20, 2020 · 12 comments · Fixed by #7263
Milestone

Comments

@devyte
Copy link
Collaborator

devyte commented Feb 20, 2020

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Problem Description

SPIFFS needs to be deprecated and eventually pulled out. There are known limitations (e.g.: dir and filename) and issues (fs corruption under certain conditions). Handling of issues at the origin repo is backed up since a long time.
We have LittleFS as alternative already implemented. The repo is actively maintained, and it supports directories.
Migration of apps from SPIFFS to LittleFS should be checked, e.g.: any issues with OTA?

@devyte devyte added this to the 3.0.0 milestone Feb 20, 2020
@TD-er
Copy link
Contributor

TD-er commented Feb 21, 2020

How well does LittleFS work on really small file systems? For example 64k or 128k filesystem (for 1M nodes)

I only tested it for 16M modules as it was working (a lot) better on larger file systems compared to SPIFFS which is somewhat unusable for > 1M filesystems. (SPIFFS is absolutely unusable for 14M due to taking over 2 sec per file access)

@earlephilhower
Copy link
Collaborator

LittleFS now uses spiffs_blocksize in the boards.txt, which for blocksize=4096 when on 256KB or smaller FSes. SPIFFS uses spiffs_pagesize = 256b.

So to begin with, you will be able to have significantly fewer individual files. Performance under load, I have no idea (haven't run anything that small). Usable file space should not be dramatically different, though, if those 64K are only holding 2-4 configuration files. It's testable now, just use LittleFS in your app instead of SPIFFS (you'll lose the SPIFFS data in flash, of course).

There's no easy way to adjust this down as LittleFS really wants to be able to manage things in the minimum erase size blocks (4K in our case).

@TD-er
Copy link
Contributor

TD-er commented Feb 22, 2020

There's no easy way to adjust this down as LittleFS really wants to be able to manage things in the minimum erase size blocks (4K in our case).

I think SPIFFS also needs at least 2 of those blocks with unallocated pages to work properly.
In ESPEasy we normally have very few files (order of 4) so that would not be an issue.

I will make some test builds with LittleFS to see what will happen.
To be honest, I haven't tested it since the last time when I did file some bug reports about it to you :)

@earlephilhower
Copy link
Collaborator

Another potential gotcha is that LittleFS has poor performance when doing update-in-place on a large file. SPIFFS can do updates in place relatively quickly.

@Jeroen88
Copy link
Contributor

LittleFS is not (yet) supported on the ESP32. There are people (like me ;)) using the same code for both MCUs. Wouldn't it be logical to deprecate SPIFFS only after LittleFS is supported on the other platform?

@TD-er
Copy link
Contributor

TD-er commented Feb 25, 2020

Hmm that's a valid point. ESPEasy is also running on both platforms.
Although, I could make it selectable at build using defines.

@devyte
Copy link
Collaborator Author

devyte commented Feb 25, 2020

@Jason2866 @TD-er maintenance on our side for libs that aren't active is a load we're not willing to have.
To be clear, this issue covers deprecation, not pulling out. Think of it as a "first notice". Worst case for you we deprecate for 2.7.0 and pull out for 3.0.0, so even in that case there is time.
You should be using the top level fs class by now, and have very little or no code that uses the low level spiffs api directly. You have three alternatives to pursue, not mutually exclusive:

  1. Find a migration strategy. At top level, there is no difference between the two file systems i. e. same fs class, so api is the same. Then the only question is how to migrate existing spiffs file systems (e. g. copy files somewhere?)
  2. Get the "other repos" to implement and support littlefs
  3. Find maintainers/developers for the spiffs lib. Having the spiffs code reactivate is the one thing that would stop our deprecation.

@Jason2866
Copy link
Contributor

@devyte Project Tasmota does NOT use SPIFFS or LittleFS.

@devyte
Copy link
Collaborator Author

devyte commented Feb 25, 2020

@Jason2866 sorry, I meant @Jeroen88 😝

@Jeroen88
Copy link
Contributor

😰

@zekageri
Copy link

So what's up with esp32 arduino and littlefs? Any news?
I'm currently using my 16mb esp32 with a file system config like 7mb app 7mb ota and 1mb flash.

@earlephilhower
Copy link
Collaborator

@zekageri , suggest you ask that on the ESP 32 repo. I'm sure they wouldn't mind getting a PR from you for it. :)

earlephilhower added a commit to earlephilhower/Arduino that referenced this issue May 3, 2020
SPIFFS has been a great filesystem, but it has significant problems in
many cases (and it's also pretty slow).  Development seems to have
slowed/stopped on the upstream version, and we're not able to provide
support or fix the known issues with it as-is.

Deprecate SPIFFS variable.

Update all examples to use LittleFS instead of SPIFFS.

Also, minor cleanup on very old examples which has obsolete delays
waiting for the Serial port to come up, or which were stuck at 9600 baud
because of their ancient AVR heritage.

Fixes esp8266#7095
devyte added a commit that referenced this issue May 4, 2020
* Deprecate SPIFFS, move examples to LittleFS

SPIFFS has been a great filesystem, but it has significant problems in
many cases (and it's also pretty slow).  Development seems to have
slowed/stopped on the upstream version, and we're not able to provide
support or fix the known issues with it as-is.

Deprecate SPIFFS variable.

Update all examples to use LittleFS instead of SPIFFS.

Also, minor cleanup on very old examples which has obsolete delays
waiting for the Serial port to come up, or which were stuck at 9600 baud
because of their ancient AVR heritage.

Fixes #7095

* Remove leftover debug code

* Clean up comments in some examples

* Update documentation on SPIFFS deprecation

* Fix host tests to avoid deprecation warnings

* Fix cut-n-paste error

* Restore SpeedTest.ino, adjust to allow custom FSes

Co-authored-by: Develo <deveyes@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants