LittleFS data upload in Arduino 2.x.x

The old Arduino IDE had a tool for uploading data to LittleFS, but it seems to be incompatible with the new version.
Is there some sensible way of uploading data that I'm not finding, or do I have to go back to the Legacy software?

I'm a bit surprised to have been unable to find any information about it: is LittleFS obsolete and has everyone else moved onto something else?

As far as I know it's not supported (yet?). A little digging through the forum's search results gives e.g. IDE 2.1 and SPIFFS - #4 by ptillisch with some additional info.

Hi @Hairyloon. Which microcontroller is on the board you are using? I ask because a solution is now available for RP2040 and ESP8266:

Unfortunately nobody has created an Arduino IDE 2.x extension for uploading filesystems to ESP32 targets yet, but the support for creating such an extension is already in place in Arduino IDE so it is only a matter of a member of the Arduino community taking on the project.

There is some related discussion here:

https://github.com/dankeboy36/vscode-arduino-api/issues/6#issuecomment-1736392992

Currently using ESP8266, so I'll check out your suggestion, thanks.

Yay! You have good timing. The extension was formally released only a few days ago.

Feel free to circle back here to let us know how thing go when you give it a try.

Regards,
Per

It’s been a couple of months since this last forum post, but I was wanting to see if there has been any headway on getting a FS extension for the ESP32?

I just purchased the rev4 uno and it seems silly that this would come out, but not be fully supported in the IDE!

Hi @alexgar224. Two solutions are available now for uploading filesystems to an ESP32-based board:

Use Filesystem Uploader Tool Arduino with Arduino IDE 1.x

The 3rd party filesystem upload tools are available for use with Arduino IDE 1.x just as they have always been.

For now, the most simple solution is to use Arduino IDE 1.x when you need to upload a filesystem to your ESP32 board. The download links for Arduino IDE 1.x are listed here:

https://www.arduino.cc/en/software#legacy-ide-18x

You can have Arduino IDE 1.x and 2.x installed at the same time without any problems, so if you prefer Arduino IDE 2.x you can continue to use it except for when you need to use the tool to upload a filesystem.

Use Standalone Tools

An alternative solution is to use the industry standard command line tools to directly upload filesystems to your ESP32.

Under the hood, what the "ESP32 sketch data upload" Tool does is:

  1. Generate a SPIFFS filesystem image from the contents of the data subfolder of your sketch.
  2. Upload the filesystem to the ESP32 board.

It does these things using two command line tools:

So instead of using the "ESP32 sketch data upload" Tool from Arduino IDE, you can just work directly with those two tools from the command line terminal.

There is some information on that here:

The primary microcontroller on the UNO R4 boards is the Renesas RA4M1, not the ESP32. The UNO R4 WiFi does use a supplemental ESP32-S3 module for its Wi-Fi functionality, but it is not very common for people to work directly with that chip.

So I'm not sure how relevant the filesystem uploader extension will be for UNO R4 WiFi users.

So, my goal is to us the UNO Rev 4 WiFi to create a website that will control different pumps (speed, time to turn on, etc.. ). Then use user input variables from the website to control the pump parameters.

Ive already connected to the WiFi, and gotten the RTC/epoch time up and going. Now it’s just getting the website stuff taken care of!

I’m trying to figure out a way to store the HTML, css, and java code to the Arduino in a separate file to call up during server startup so I don’t have to write all the code in the main sketch.

From just looking around it seems like everyone saves the files to the ESP32 via the FS, but maybe I could save it to the RA4M1 instead?

I haven’t worked with Website HTTP connectivity before so I’m just trying to look for the best modern solution. I’ve seen libraries of ESPAsyncWebServer that look promising, but I’m not sure if those are compatible with the 2.X IDE still?

I'm not having any luck with this plugin. I am on a windows 11 machine with IDE2.2.1. Trying to upload to a generic ESP8266. I did the plugin install as shown on github, but it won't upload, giving the following output and error:

Building LittleFS filesystem
C:\Users\flagt\AppData\Local\Arduino15\packages\esp32\tools\mklittlefs\3.0.0-gnu12-dc7f933/mklittlefs.exe -c C:\Users\flagt\Documents\Arduino\greenhouseplay5-31/data -p 256 -b 8192 -s 2072576 C:\Users\flagt\AppData\Local\Temp\tmp-12324-Gb19XUlCX4pO-.littlefs.bin
/greenhouse.jpg

Uploading LittleFS filesystem
C:\Users\flagt\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3.exe C:\Users\flagt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/upload.py --chip esp8266 --port COM5 --baud 921600 write_flash 2097152 C:\Users\flagt\AppData\Local\Temp\tmp-12324-Gb19XUlCX4pO-.littlefs.bin
esptool.py v3.0
Serial port COM5

A fatal esptool.py error occurred: could not open port 'COM5': PermissionError(13, 'Access is denied.', None, 5)
Completed upload.

I followed instructions to change to another board and back; no help
Then close and open the sketch; no help. Not sure where to go from here. Sadly I have older projects that need updated files, but can't upload them :worried:

When switching to another board (D1 mini) it appeared on Com6 in the ide as well as Device Manager. However I get this error when trying to upload to it:

Building LittleFS filesystem
C:\Users\flagt\AppData\Local\Arduino15\packages\esp32\tools\mklittlefs\3.0.0-gnu12-dc7f933/mklittlefs.exe -c C:\Users\flagt\Documents\Arduino\spiffs_test_program/data -p 256 -b 8192 -s 3121152 C:\Users\flagt\AppData\Local\Temp\tmp-17252-XRsWiYY9eTxD-.littlefs.bin
/Testing the Little FS system.txt

Uploading LittleFS filesystem
C:\Users\flagt\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3.exe C:\Users\flagt\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/upload.py --chip esp8266 --port COM6 --baud 115200 write_flash 1048576 C:\Users\flagt\AppData\Local\Temp\tmp-17252-XRsWiYY9eTxD-.littlefs.bin
esptool.py v3.0
Serial port COM6

A fatal esptool.py error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
Completed upload.
and when closing the upload panel:
Port monitor error:command 'open' failed: invalid serial port. Could not connect to COM6 serial port.

Hi @flagtrax. Click the X icon on the "Serial Monitor " tab in the bottom panel of the Arduino IDE window to close the tab: and then give it another try.

215050213-e6c41c1a-0eae-448a-ae91-f2acefedf793

Great news about this! Support for uploading filesystems to ESP32 boards has now been added to the "arduino-littlefs-upload" extension I mentioned earlier in the thread. You can get the new version with ESP32 support here:

https://github.com/earlephilhower/arduino-littlefs-upload/releases/latest

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.