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 »

Enjoyed this project? Stay updated by subscribing our newsletter!

14 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

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.