Arduino IDE 2: Install ESP32 LittleFS Uploader (Upload Files to the Filesystem)

In this guide, you’ll learn how to upload files to the ESP32 LittleFS Filesystem using Arduino IDE 2 (2.2.1 or a higher version). We’ll install an uploader plugin that will add a new menu to the Arduino IDE. This plugin is also compatible with the ESP8266 and Raspberry Pi Pico boards.

Arduino IDE 2 Install ESP32 LittleFS Uploader Upload Files to the Filesystem

Using an ESP8266? Follow this tutorial instead: Arduino IDE 2: Install ESP8266 NodeMCU LittleFS Uploader (Upload Files to the Filesystem).

Table of Contents

If you’re still using Arduino 1.8, you can follow this tutorial instead: ESP32: Upload Files to LittleFS using Arduino IDE (legacy).

Introducing LittleFS

LittleFS is a lightweight filesystem created for microcontrollers that lets you access the flash memory as you do in a standard file system on your computer, but it’s simpler and more limited. You can read, write, close, and delete files. Using LittleFS with the ESP32 boards is useful to:

  • Create configuration files with settings;
  • Save data permanently;
  • Create files to save small amounts of data instead of using a microSD card;
  • Save HTML, CSS, and JavaScript files to build a web server;
  • Save images, figures, and icons;
  • And much more.

Installing the LittleFS Uploader Plugin on Arduino IDE 2

To upload files to the ESP32 on Arduino IDE 2, we’ll use this LittleFS Uploader plugin that is compatible with Arduino 2.2.1 or higher and can be used with the ESP32, ESP8266, and Raspberry Pi Pico boards.

Windows Instructions

Follow the next steps to install the filesystem uploader if you’re using Windows (click here for MacOS instructions):

1) Go to the releases page and click the .vsix file to download.

Download vsix file to install filesystem uploader plugin

2) On your computer, go to the following path: C:\Users\<username>\.arduinoIDE\. Create a new folder called plugins if you haven’t already.

Create Plugins Folder Arduino IDE 2

3) Move the .vsix file you downloaded previously to the plugins folder (remove any other previous versions of the same plugin if that’s the case).

Moving LittleFS uploader to the plugins folder arduino ide 2

4) Restart or open the Arduino IDE 2. To check if the plugin was successfully installed, press [Ctrl] + [Shift] + [P] to open the command palette. An instruction called ‘Upload Little FS to Pico/ESP8266/ESP32‘ should be there (just scroll down or search for the name of the instruction).

Upload LittleFS to Pico/ESP8266/ESP32

That means the plugin was installed successfully. Proceed to this section to test the filesystem uploader plugin.

Mac OS X Instructions

Follow the next steps to install the filesystem uploader if you’re using Mac OS X:

1) Go to the releases page and click the .vsix file to download.

LittleFS Uploader Plugin ESP32 ESP8266 Pico Upload Files to the Filesystem

2) In Finder, type ~/.arduinoIDE/ and open that directory.

In Finder type ~/.arduinoIDE open that directory

3) Create a new folder called plugins.

creating a plugins folder Arduino IDE 2 MacOS

4) Move the .vsix file to the plugins folder (remove any other previous versions of the same plugin if that’s the case).

Moving vsix file Arduino IDE 2 in Mac OS - Uploader Plugin

5) Restart or open the Arduino IDE 2. To check if the plugin was successfully installed, press [] + [Shift] + [P] to open the command palette. An instruction called ‘Upload LittleFS to Pico/ESP8266/ESP32‘ should be there (just scroll down or search for the name of the instruction).

Arduino IDE 2 Upload Filesystem Image ESP32

Uploading Files to ESP32 using the Filesystem Uploader in Arduino IDE 2

To upload files to the ESP32 LittleFS filesystem, follow the next instructions.

1) Create an Arduino sketch and save it. For demonstration purposes, you can save an empty sketch.

2) Then, open the sketch folder. You can go to Sketch > Show Sketch Folder. The folder where your sketch is saved should open.

Arduino IDE 2 Show Sketch Folder

3) Inside that folder, create a new folder called data.

Creating a data folder inside the sketch folder

4) Inside the data folder is where you should put the files you want to upload to the ESP32 filesystem. As an example, create a .txt file with some text called test_example.txt (and save it inside the data folder).

Testing the ESP32 filesystem txt file

5) Make sure you have the right board (Tools > Board) and COM port selected (Tools > Port).

6) Depending on the ESP32 board selected, you may need to select the desired flash size (some boards don’t have that option, don’t worry). In the Arduino IDE, in Tools > Flash size, select the desired flash size (this will depend on the size of your files).

7) Then, upload the files to the ESP32 board. Press [Ctrl] + [Shift] + [P] on Windows or [] + [Shift] + [P] on MacOS to open the command palette. Search for the Upload LittleFS to Pico/ESP8266/ESP32 command and click on it.

Upload LittleFS to Pico/ESP8266/ESP32

Important: ensure the Serial Monitor is closed. Otherwise, the upload will fail.

After a few seconds, you should get the message “Completed upload. “. The files were successfully uploaded to the ESP32 filesystem.

Arduino IDE 2: files uploaded successfully to the ESP32 filesystem

Troubleshooting

If you get the following error message “ERROR: No port specified, check IDE menus“, restart the Arduino IDE, and try again.

Testing the ESP32 LittleFS Uploader

Now, let’s check if the file was saved into the ESP32 filesystem. Upload the following code to your ESP32 board. This code will read the contents of the .txt file you saved previously on LittleFS.

#include "LittleFS.h"
 
void setup() {
  Serial.begin(115200);
  
  if(!LittleFS.begin()){
    Serial.println("An Error has occurred while mounting LittleFS");
    return;
  }
  
  File file = LittleFS.open("/test_example.txt", "r");
  if(!file){
    Serial.println("Failed to open file for reading");
    return;
  }
  
  Serial.println("File Content:");
  while(file.available()){
    Serial.write(file.read());
  }
  file.close();
}
 
void loop() {

}

View raw code

After uploading, open the Serial Monitor at a baud rate of 115200.

Open Arduino IDE 2 Serial Monitor baud rate of 115200

Press the ESP32 on-board “RST” button. It should print the content of your .txt file in the Serial Monitor.

Testing the ESP8266 Filesystem Uploader Plugin Arduino IDE 2

You’ve successfully uploaded files to the ESP32 filesystem using the plugin.

Wrapping Up

In this tutorial, we’ve shown you how to upload files to the ESP32 LittleFS filesystem on Arduino IDE 2 using an uploader plugin.

We’ve shown you how to upload a .txt file, but you can upload other file formats like HTML, CSS, and Javascript files to build a web server, images, or small icons, save configuration files, etc.

To learn more about the ESP32, check our resources:

Thanks for reading.



Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »
Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »

Recommended Resources

Build a Home Automation System from Scratch » With Raspberry Pi, ESP8266, Arduino, and Node-RED.

Home Automation using ESP8266 eBook and video course » Build IoT and home automation projects.

Arduino Step-by-Step Projects » Build 25 Arduino projects with our course, even with no prior experience!

What to Read Next…


Enjoyed this project? Stay updated by subscribing our newsletter!

35 thoughts on “Arduino IDE 2: Install ESP32 LittleFS Uploader (Upload Files to the Filesystem)”

  1. Thank you so much for this!

    As someone who used LittelFS for a couple of projects I did way-back, I found it so frustrating to read messages online that said how difficult it would be to support LittleFS in IDE2, if – indeed – it would be possible at all.

    I will read your article with interest and make rude cyber-gestures at the nay-sayers!

    Reply
  2. Howdy Again
    As usual a great tutorial which worked floorlessly and has answered alot of questions that I had about sketches that needed the data uploaded to the board.
    It took me a long time to dicover that older older arduino Ide supported this function and now you have explained wonderfully how to upload LittleFs in latest Arduino IDE.
    I thankyou and the team and look forward to your tutorials and the information from your site.
    Thanks from the UK
    Mark D

    Reply
  3. Wow, finally the LittleFS is available on Arduino IDE 2.0! Excelent post, by the way, the quality of the tutorials remains the same when I found this site, 5 yars ago: excelent!

    Reply
  4. Hi Sara and Rui,

    I was very happy to see your new tutorial about upload LittleFS now is implemented in the Arduino IDE 2.

    I’m working on MAC and stuck on one problem. My upload to LitteFS ends with this error:

    A fatal error occurred: Could not open /dev/cu.usbserial-1420, the port doesn’t exist
    ERROR: Upload failed, error code: 2

    Maybe it has to do with an open Serial-monitor connection. In the old IDE 1, you had to close this connection before starting upload of data and this was done very simple by just closing the (distinct) window were Serial-monitor was dumping it’s data.
    In the IDE 2 it’s not very clear how to close Serial-monitor. As Serial monitor is in the bottom panel of my sketch-window.

    Here the complete log output of my uploading to LittleFS:

    Using partition: default
    Building LittleFS filesystem
    /Users/jop/Library/Arduino15/packages/esp32/tools/mklittlefs/3.0.0-gnu12-dc7f933/mklittlefs -c /Users/jop/STACK/ArduinoSketches/@KENNIS/LittleFS/TestLittleFS/data -p 256 -b 4096 -s 1441792 /var/folders/vd/rhwhbr1s5j77gkn7yq_qfmlm0000gn/T/tmp-7661-q2cK0GA8qGrt-.littlefs.bin
    /test_example.txt

    Uploading LittleFS filesystem
    /Users/jop/Library/Arduino15/packages/esp32/tools/esptool_py/4.5.1/esptool –chip esp32 –port /dev/cu.usbserial-1420 –baud 921600 –before default_reset –after hard_reset write_flash -z –flash_mode dio –flash_freq 80m –flash_size detect 2686976 /var/folders/vd/rhwhbr1s5j77gkn7yq_qfmlm0000gn/T/tmp-7661-q2cK0GA8qGrt-.littlefs.bin
    esptool.py v4.5.1
    Serial port /dev/cu.usbserial-1420

    A fatal error occurred: Could not open /dev/cu.usbserial-1420, the port doesn’t exist

    ERROR: Upload failed, error code: 2

    The port cu.usbserial-1420 does exist, as I used it to upload my test sketch.
    My macOS is Sonoma.

    With kind regards,

    Jop

    Reply
    • With both the ESP32 and ESP8266 package installed on the same IDE, the plugin always finds the mkspiffs tool in the ESP32 package. This would be a problem while uploading SPIFFS to ESP8266 since the mkspffs tool is not compatible with ESP8266. I’ve made a PR to fix it.

      Reply
  5. I have Arduino 2.3.2 on Windows. I followed the instructions and reopened the IDE, did the Fn+CTRL+P and the file uploader is not on the list!

    First I put the latest release (arduino-littlefs-upload-1.1.7.vsix) in the plugins folder, with the following path: C:\Users\kevin.arduinoIDE\plugins. When it didn’t work, I deleted that file and replaced it with the version mentioned in the tutorial
    (arduino-littlefs-upload-1.1.5.vsix) but it still did not work. The board I selected is ESP32 Dev Module. Any ideas?

    Reply
    • i have the same problem like you. Sometimes i get the message “Upload LittleFS to Pico/ESP8266/esp32” on the list, but only once. When i try a second time, the message is no more there.

      Reply
  6. Hello.
    Here is a list created by the community containing plugins compatible with the Arduino IDE 2.x: github.com/MicSG-dev/list-of-compatible-plugins-with-arduino-ide-2-x

    Reply
  7. Hello,
    Thanks for the useful tutorials you keep sharing 🙂

    I used the tool. Upload went well but it erased (overwote ?) the NVS preferences on the board.
    Do you know how to upload /data to littleFS and keep “preferences” untouched ?
    Thanks

    Reply
    • Hi.
      Thanks for your feedback.
      I didn’t know about that.
      I searched for a while and found people with the same issue, but no answers… I don’t know how to fix that issue.
      If you find a solution, please share.
      Regards,
      Sara

      Reply
      • I tried on another board (Mini D1 ESP32) and this time upload did not erase preferences. Same Arduino IDE and tool version.
        I could not find a systematic way to reproduce the problem ! It is strange.

        Reply
  8. Аctivating extension ‘arduino-littlefs-upload’ failed: Cannot find module ‘c:\Users.…..arduinoIDE\plugins\arduino-littlefs-upload-1.1.8\out\extension.js’ Require stack: – C:\Users.……\AppData\Local\Programs\arduino-ide\resources\app\lib\backend\plugin-host.js

    If anyone has this problem, you need to change the file extension extension.ts from the src folder to js and move the file to the created “out” folder

    ARDUINO IDE 2.3.2
    esptool 4.5.1
    ESP32 S3 WROOM
    For Gyver project WIFI panel matrix on WS2812b 1024 LEDS

    Reply
  9. The previous steps were executed according to your steps, but an error message appeared :
    ERROR: Partition entry not found in csv file!
    How to fix it?

    Reply
  10. As always, this place is my first rescue whenever I run into an Arduino related problem and once again I found a crystal clear tutorial that works. Thank you so much!

    Reply
  11. I have a question about Step #7. Before asking, I would like to say this website has helped me a lot when building my projects. Thanks in advance for your help.

    QUESTION:

    What would happen if we DON’t perform step #7:

    “Then, upload the files to the ESP32 board. Press [Ctrl] + [Shift] + [P] on Windows or [⌘] + [Shift] + [P] on MacOS to open the command palette. Search for the Upload LittleFS to Pico/ESP8266/ESP32 command and click on it.”

    …and just programatically write:

    File file = LittleFS.open(“example_data.json”, “w”);

    then we serialize some JSON data to the file “example_data.json”

    and finally we close the file using “file.close();”

    Wouldnt that technically CREATE the file if it doesnt exist?

    Or its mandatory to ALWAYS perform manually step#7 in ArduinoIDE 2.0?

    I mean, I know we need to create a “data” folder at the root of our sketch, but do we also NEED to manually create the file we want to manipulate and ALSO perform step #7?

    Can step #7 be performed programatically inside the sketch?

    Thank you!!

    Reply
  12. I have a problem
    The plugin doesn’t work
    Wisdows 10 (PT_BR) + Arduino IDE 2.3.2 + arduino-littlefs-upload-1.1.8.vsix
    When I press SHIFT+CTRL+P some options appear, but not “Upload Little FS to Pico/ESP8266/ESP32”
    Any tips to solve the problem?
    or
    Any other way to send data to spiffs

    Reply
  13. Hello, excellent tutorial that has helped me a lot to solve doubts and problems that I had, I have managed to load the files into the esp32 memory but I cannot read them. I can read the files that I create directly from the sketch, but not the imported ones. Any advice?
    All the best

    Reply
  14. Hello, i have installed the plugin on arduino ide 2.3 (windows11). When i use the command “upload little fs” i get an error about the baud rate option :

    esptool: error: argument –baud/-b: invalid arg_auto_int value: ‘NaN’
    ERROR: Upload failed, error code: 2

    Any idea ?
    Best Regards
    Yves

    Reply

Leave a Comment

Download Our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.