I added the PlatformIO Uploadfs, but it seems pinned to SPIFFS (which is being deprecated). I didn’t find any notes on how to change over to LittleFS.
My current workflow is:
- Code in CLion w/platformio plugin. compile. upload.
- Switch to Arduino, to use the LittleFS arduino plugin` to get the filesystem uploaded…
How can I streamline this?
Not sure why you would need this, but I’m adding it anyway… the platformio.ini
platform = espressif8266
board = nodemcuv2
framework = arduino
That’s strange, why they deprecated a critical feature in a bugfix release, besides the release notes for 2.7.1 didn’t contain any info about deprecating SPIFFS when I was preparing our release.
Anyway, thank I’ll look into it ASAP.
I can foresee that some people may have troubles with this change so maybe it should be made configurable whether to build a SPIFFS or LittleFS partition and binary file.
Have they thought about cases where they have a deployed firmware (e.g. webserver operating on SPIFFS filesystem), the developer updates the Arduino core version and pushes a new Filesystem onto the devices via OTAA, but the new version pushes a LittleFS file and the firmware crashes? Looking at Arduino/platform.txt at master · esp8266/Arduino · GitHub the two options are there but all the code is being moved to LittleFS…
@valeros, it’s being deprecated, they recommend moving away from it. The SPIFFS package is no longer being maintained. Official notice is here
@maxgerhardt for the most part, it’s function parity. So refactoring should be minimal.
For developing a new firmware yes (just change
LittleFS.), I’m just concerned about people upgrading the Arduino core version and pushing a LittleFS partition on a device with a firmware written for SPIFFS. That breaks these people’s projects if it’s remotely deployed…
That won’t happen unless you specifically push the change… you still specifically have to initialise it on the device, and in code, as SPIFFS or LittleFS… i.e. you upload using the SPIFFS plugin on the Arudino IDE, or you upload using the LittleFS plugin on the Arduino IDE, and you then use the corresponding calls in the code. It really serves you right if you installed the LittleFS plugin, uploaded in the new format, and didn’t change your code!
The think the real bite here (as a PlatformIO user) is the fact that LittleFS has been there the Nov 9, 2019 v2.6.0 release, and PlatformIO hasn’t added support for it… so now that the devs are indicating that since SPIFFS hasn’t received any love from it’s developers in the last three years, and has some … issues … it’s time to start planning the move to something better, it’s set everyone off in a panic. I don’t know when they will actually yanking the plug… I suspect given the timing they are considering 3.0, but time, feedback and development activity on the SPIFFS end of things will tell.
Oh you still have that choice? I upgrade my packet version in the Arudino IDE and just say that they changed the “Flash” configuration from saying “SPIFFS” to “FS”, and didn’t find a “Upload SPIFFS” and “Upload LittleFS” button anymore. Can you show a quick screenshot? If there’s a choice then there’s no problem… Except when someone destroys it accidentally.
Accidently, on purpose, is even nastier!
Uploading with the Arduino IDE has always been a bit clunkier, as installing the ESP8266 board support package isn’t enough… you also needed to install the arduino-esp8266fs-plugin manually into your sketchbook as well, to get that nice
Tools -> ESP8266 Sketch Data Upload menu option. For littlefs, it’s the same deal… just a different plugin - arduino-esp8266littlefs-plugin - which adds a different entry.
GitHub comes in handy sometimes… here is a screenshot I prepared earlier! Shows both the LittleFS and the SPIFFS upload options (although, naturally, since there are now two options, it would be nice if it said ‘ESP8266 SPIFFFS Data Upload’) …
I’ve switched esp8266 platform to LittleFS in the development branch. And looks like we’ll drop SPIFFS support (still it will be possible to use it via an extra script).
Is that really a good idea… I would have thought PlatformIO would drop support for accessing it the same time the ESP8266 Arduino core drops it, not before. They are only advising that people don’t base new code on it, not removing it from the core. They know perfectly well there are plenty of appliations that can’t switch, so are just lining their ducks up, probably to remove it in v3.0.0, as a ‘breaking API change’ sort of affair. I would have thought it was better to default to LittleFS, but have a flag that lets you switch between the two, which is phased out when the Arduino ESP8266 core finally kicks SPIFFS out.
It’s still usable, but users will need to override the file system tool in an extra script.
Via an extra script, rather than via a
platformio.ini flag? And I’m guessing the documentation is still to come?
So what’s the status of this thread. I see that issue support littlefs for upcoming esp8266 arduino core release · Issue #173 · platformio/platform-espressif8266 · GitHub is closed but I can’t make it work. I’ve followed the advice in How to define LittleFS partition, build image and flash it on ESP32? but I still can’t get a LittleFS.bin file generated in my .pio/build/nodemcuv2 directory. The script to build the file is just not running. I’m getting no errors. I’ve got the 2.6.0 version of the platform loaded. What gives? I noticed that the build_board.filesystem does not show up in the project configuration settings. I’m using platformio with CLion. Any help appreciated.
It’s implemented. Are you sure that you have executed the “Upload File System Image” project task?
At the moment, it will be a matter of manually adding
board_build.filesystem = littlefs to your
platformio.ini so that when you do
Upload File System Image it uses LittleFS. After making sure your code is using LittleFS instead of SPIFFS, naturally!
I just tried the Graph example on a nodemcuv2, and it worked just fine when configured for LittleFS.
It not being available in the PIO Project Configuration settings section is another issue - as it will most likely need to be added to PIO Home.
Thanks for all the responses, which have pointed out the primary thing that was missing. As I pointed out in my original post, I’m using CLion as my IDE. I finally found the build target Uploadfs in the PlatformIO build templates in Clion. Once I selected that as the build target, it all worked as advertised. Thanks for the help.