{"id":132228,"date":"2023-06-23T10:57:19","date_gmt":"2023-06-23T10:57:19","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=132228"},"modified":"2024-05-06T16:46:46","modified_gmt":"2024-05-06T16:46:46","slug":"esp32-littlefs-arduino-ide","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp32-littlefs-arduino-ide\/","title":{"rendered":"ESP32: Upload Files to LittleFS using Arduino IDE"},"content":{"rendered":"\n<p>In this guide, you&#8217;ll learn how to upload files to the ESP32 Filesystem (LittleFS) by using a plugin for Arduino IDE (1.8.X). LittleFS is a lightweight filesystem created for microcontrollers that lets you access the flash memory like you would do in a standard file system on your computer, but simpler and more limited. The plugin we&#8217;ll install lets you use three different filesystems: LittleFS, SPIFFS, or FatFS.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Install-Filesystem-Plugin-ESP32.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 Upload Files to LittleFS using Arduino IDE\" class=\"wp-image-132246\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Install-Filesystem-Plugin-ESP32.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Install-Filesystem-Plugin-ESP32.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Install-Filesystem-Plugin-ESP32.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Install-Filesystem-Plugin-ESP32.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<p class=\"rntbox rntclblue\">Using <strong>Arduino IDE 2?<\/strong> Follow this tutorial instead: <a href=\"https:\/\/randomnerdtutorials.com\/arduino-ide-2-install-esp32-littlefs\/\">Arduino IDE 2: Install ESP32 LittleFS Uploader (Upload Files to the Filesystem)<\/a><\/p>\n\n\n\n<p>If you want to use LittleFS with the ESP8266, read: <a href=\"https:\/\/randomnerdtutorials.com\/install-esp8266-nodemcu-littlefs-arduino\/\" title=\"\">Install ESP8266 NodeMCU LittleFS Filesystem Uploader in Arduino IDE<\/a>.<\/p>\n\n\n\n<p><strong>Table of Contents<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#littlefs-introduction\" title=\"\">Introducing LittleFS<\/a><\/li>\n\n\n\n<li><a href=\"#install-filesystem-uploader-plugin\" title=\"\">Installing the Arduino ESP32 filesystem uploader<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#installing-filesystem-uploader-esp32-windows\" title=\"\">Windows Instructions<\/a><\/li>\n\n\n\n<li><a href=\"#installing-filesystem-uploader-esp32-macos\" title=\"\">Mac OS X Instructions<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#upload-files-little-fs-esp32\" title=\"\">Uploading Files to ESP32 LittleFS using the Filesystem Uploader<\/a><\/li>\n\n\n\n<li><a href=\"#testing-filesystem-uploader\" title=\"\">Testing the ESP32 Filesystem Uploader<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"littlefs-introduction\">Introducing LittleFS<\/h2>\n\n\n\n<p>LittleFS is a lightweight filesystem created for microcontrollers that lets you access the flash memory like you would do in a standard file system on your computer, but it\u2019s simpler and more limited. You can read, write, close, and delete files. Using a filesystem with the ESP32 boards is especially useful to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create configuration files with settings;<\/li>\n\n\n\n<li>Save data permanently;<\/li>\n\n\n\n<li>Create files to save small amounts of data instead of using a microSD card;<\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-web-server-spiffs-spi-flash-file-system\/\" title=\"\">Save HTML, CSS, and JavaScript files to build a web server<\/a>;<\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/display-images-esp32-esp8266-web-server\/\">Save images, figures, and icons<\/a>;<\/li>\n\n\n\n<li>And much more.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install-filesystem-uploader-plugin\">Installing the Arduino ESP32 filesystem uploader<\/h2>\n\n\n\n<p>Currently, there is a plugin for the Arduino IDE (version 1.8.X) that allows you to pack and upload files to the SPIFFS, LittleFS, or FatFS filesystem image in the ESP32 filesystem.<\/p>\n\n\n\n<p><strong>Note<\/strong>: in most of our projects we use SPIFFS for the ESP32 filesystem. It&#8217;s still compatible with the ESP32, and you can use SPIFFS without any issues. However, currently, many libraries are moving to LittleFS.<\/p>\n\n\n\n<p>The plugin we&#8217;ll install is both compatible with SPIFFS and LittleFS. So, it&#8217;s an advantage over the older plugin and you can still use SPIFFS.<\/p>\n\n\n\n<p>There are a few advantages of using LittleFS over SPIFFS:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>LittleFS is optimized for low resource usage and it employs a<strong> wear-leveling algorithm<\/strong> that evenly distributes writes across the flash memory, prolonging its lifespan.<\/li>\n\n\n\n<li>LittleFS provides faster mount times and file access by utilizing a <strong>directory indexing structure<\/strong>.<\/li>\n\n\n\n<li>LittleFS minimizes the risk of data corruption during power loss or system failures.<\/li>\n\n\n\n<li>LittleFS is under active development. <\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installing-filesystem-uploader-esp32-windows\">Windows Instructions<\/h3>\n\n\n\n<p>Follow the next steps to install the filesystem uploader if you&#8217;re using Windows:<\/p>\n\n\n\n<p><strong>1)<\/strong> Go to the <a href=\"https:\/\/github.com\/lorol\/arduino-esp32fs-plugin\/releases\" target=\"_blank\" rel=\"noopener\" title=\"\">releases page<\/a> and click the latest <strong>esp32fs.zip<\/strong> file to download.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"693\" height=\"250\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Arduino-ESP32-Uploader-Plugin-Download.png?resize=693%2C250&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino ESP32 Download Filesystem Uploader Plugin\" class=\"wp-image-132230\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Arduino-ESP32-Uploader-Plugin-Download.png?w=693&amp;quality=100&amp;strip=all&amp;ssl=1 693w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Arduino-ESP32-Uploader-Plugin-Download.png?resize=300%2C108&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/figure><\/div>\n\n\n<p><strong>2)<\/strong> Unzip the downloaded file. You should have a folder called <strong>esp32fs <\/strong>with a file called <strong>esp32fs.jar<\/strong> inside.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"735\" height=\"250\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/esp32fs-folder-file.png?resize=735%2C250&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"esp32fs file downloaded\" class=\"wp-image-132232\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/esp32fs-folder-file.png?w=735&amp;quality=100&amp;strip=all&amp;ssl=1 735w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/esp32fs-folder-file.png?resize=300%2C102&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 735px) 100vw, 735px\" \/><\/figure><\/div>\n\n\n<p><strong>3)<\/strong> Find your Sketchbook location. In your Arduino IDE, go to <strong>File<\/strong> &gt; <strong>Preferences<\/strong> and check your Sketchbook location. In my case, it&#8217;s in the following path: <span class=\"rnthl rntliteral\">C:\\Users\\sarin\\Documents\\Arduino<\/span>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"479\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/10\/Arduino-Sketchbook-location.png?resize=802%2C479&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino sketchbook location\" class=\"wp-image-110399\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/10\/Arduino-Sketchbook-location.png?w=802&amp;quality=100&amp;strip=all&amp;ssl=1 802w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/10\/Arduino-Sketchbook-location.png?resize=300%2C179&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/10\/Arduino-Sketchbook-location.png?resize=768%2C459&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 802px) 100vw, 802px\" \/><\/figure><\/div>\n\n\n<p><strong>4)<\/strong> Go to the sketchbook location, and create a <strong>tools <\/strong>folder if you don&#8217;t have it already (make sure that the Arduino IDE application is closed).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"229\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/10\/creating-tools-folder-sketchbook-location.png?resize=675%2C229&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"creating tools folder sketchbook folder LittleFS\" class=\"wp-image-110400\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/10\/creating-tools-folder-sketchbook-location.png?w=675&amp;quality=100&amp;strip=all&amp;ssl=1 675w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/10\/creating-tools-folder-sketchbook-location.png?resize=300%2C102&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/figure><\/div>\n\n\n<p><strong>5)<\/strong> Inside the <strong><em>tools <\/em><\/strong>folder, create another folder called <strong><em>ESP32FS <\/em><\/strong>if you haven&#8217;t already.<\/p>\n\n\n\n<p><strong>6)<\/strong> Inside the <strong>ESP32FS <\/strong>folder, create a folder called <strong><em>tool<\/em><\/strong>.<\/p>\n\n\n\n<p><strong>7)<\/strong> Copy the <em><strong>esp32fs.jar<\/strong><\/em> file to the <strong><em>tool <\/em><\/strong>folder (if you already have an <em><strong>esp32fs.jar<\/strong><\/em> file from a previous plugin, delete it and replace it with the new one). So, the directory structure will look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;home_dir&gt;\/Arduino\/tools\/ESP32FS\/tool\/esp32fs.jar<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"278\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/uploader-plugin-esp32-file-directory.png?resize=772%2C278&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"esp32 filesystem tool arduino directory\" class=\"wp-image-132233\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/uploader-plugin-esp32-file-directory.png?w=772&amp;quality=100&amp;strip=all&amp;ssl=1 772w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/uploader-plugin-esp32-file-directory.png?resize=300%2C108&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/uploader-plugin-esp32-file-directory.png?resize=768%2C277&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 772px) 100vw, 772px\" \/><\/figure><\/div>\n\n\n<p><strong>8)<\/strong> Now, you can open Arduino IDE.<\/p>\n\n\n\n<p>To check if the plugin was successfully installed, open your Arduino IDE and select your ESP32 board. In the <strong>Tools<\/strong> menu, check that you have the option &#8220;<strong>ESP32 Sketch Data Upload<\/strong>&#8220;. Click on that option. A window will pop up for you to choose the filesystem you want to use.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"271\" height=\"149\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Filesystem-uploader-plugin-esp32-littlefs.png?resize=271%2C149&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 Filesystem uploader Arduino IDE choose filesystem\" class=\"wp-image-132234\"\/><\/figure><\/div>\n\n\n<p>As you can see, you have the option to choose from LittleFS, SPIFFS, or FatFS and you can even have the option to erase flash if needed.<\/p>\n\n\n\n<p>Congratulations! You&#8217;ve successfully installed the Filesystem uploader plugin for the ESP32 on the Arduino IDE.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installing-filesystem-uploader-esp32-macos\">Mac OS X Instructions<\/h3>\n\n\n\n<p>Follow the next instructions if you&#8217;re using MacOS X.<\/p>\n\n\n\n<p><strong>1)<\/strong> Go to the <a href=\"https:\/\/github.com\/lorol\/arduino-esp32fs-plugin\/releases\" target=\"_blank\" rel=\"noopener\" title=\"\">releases page<\/a> and click the latest <strong><em>esp32fs.zip<\/em><\/strong> file to download.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"693\" height=\"250\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Arduino-ESP32-Uploader-Plugin-Download.png?resize=693%2C250&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino ESP32 Download Filesystem Uploader Plugin\" class=\"wp-image-132230\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Arduino-ESP32-Uploader-Plugin-Download.png?w=693&amp;quality=100&amp;strip=all&amp;ssl=1 693w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Arduino-ESP32-Uploader-Plugin-Download.png?resize=300%2C108&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/figure><\/div>\n\n\n<p><strong>2)<\/strong> Unpack the files. You should have a folder called <strong>esp32fs <\/strong>with a file called <strong>esp32fs.jar<\/strong> inside.<\/p>\n\n\n\n<p><strong>3)<\/strong> Create a folder called <strong>tools<\/strong> in <span class=\"rnthl rntliteral\">\/Documents\/Arduino\/<\/span> if you haven&#8217;t already.<\/p>\n\n\n\n<p><strong>4)<\/strong> Inside the tools folder create another one called <strong>ESP32FS<\/strong>.<\/p>\n\n\n\n<p><strong>5)<\/strong> Inside the <strong>ESP32FS <\/strong>folder, create a folder called <strong><em>tool<\/em><\/strong>. So, the directory structure will look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;home_dir&gt;\/Arduino\/tools\/ESP32FS\/tool\/<\/pre>\n\n\n\n<p><strong>6)<\/strong> Copy the unpacked <strong><em>esp32fs.jar<\/em><\/strong> file to the <strong>tool<\/strong> directory (if you already have an <em><strong>esp32fs.jar<\/strong><\/em> file from a previous plugin, delete it and replace it with the new one). You should have a similar folder structure.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"223\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/ESP32-Filesystem-tool-directory-macos.png?resize=750%2C223&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"esp32 filesystem tool arduino directory\" class=\"wp-image-132240\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/ESP32-Filesystem-tool-directory-macos.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/ESP32-Filesystem-tool-directory-macos.png?resize=300%2C89&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p><strong>7)<\/strong> Now, you can open Arduino IDE.<\/p>\n\n\n\n<p>To check if the plugin was successfully installed, open your Arduino IDE and select your ESP32 board. In the <strong>Tools<\/strong> menu, check that you have the option &#8220;<strong>ESP32 Sketch Data Upload<\/strong>&#8220;.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"329\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/ESP32-sketch-data-upload-arduino-ide-macos.png?resize=750%2C329&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 Data Sketch Upload MACOS X\" class=\"wp-image-132241\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/ESP32-sketch-data-upload-arduino-ide-macos.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/ESP32-sketch-data-upload-arduino-ide-macos.png?resize=300%2C132&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>Click on that option. A window will pop up for you to choose the filesystem you want to use.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"152\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Filesystem-uploader-plugin-esp32-littlefs-macos.png?resize=300%2C152&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 Filesystem uploader Arduino IDE choose filesystem MAC OS\" class=\"wp-image-132243\"\/><\/figure><\/div>\n\n\n<p>As you can see, you have the option to choose from LittleFS, SPIFFS, or FatFS and you can even have the option to erase flash if needed.<\/p>\n\n\n\n<p>Congratulations! You&#8217;ve successfully installed the Filesystem uploader plugin for the ESP32 on the Arduino IDE.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"upload-files-little-fs-esp32\">Uploading Files using the Filesystem Uploader<\/h2>\n\n\n\n<p>To upload files to the ESP32 LittleFS filesystem follow the next instructions.<\/p>\n\n\n\n<p><strong>1)<\/strong> Create an Arduino sketch and save it. For demonstration purposes, you can save an empty sketch.<\/p>\n\n\n\n<p><strong>2)<\/strong> Then, open the sketch folder. You can go to <strong>Sketch <\/strong>&gt; <strong>Show Sketch Folder<\/strong>. The folder where your sketch is saved should open.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rntlab.com\/wp-content\/uploads\/2018\/09\/show-sketch-folder.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino IDE Show Sketch folder to create data folder\" class=\"wp-image-17224\"\/><\/figure><\/div>\n\n\n<p><strong>3)<\/strong> Inside that folder, create a new folder called <em><strong>data<\/strong><\/em>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rntlab.com\/wp-content\/uploads\/2018\/09\/data.fodler.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 Arduino Sketch Example File Filesystem fs LittleFS\" class=\"wp-image-17225\"\/><\/figure><\/div>\n\n\n<p><strong>4)<\/strong> Inside the <strong><em>data<\/em> <\/strong>folder is where you should put the files you want to save into the ESP32 filesystem. As an example, create a <em>.txt<\/em> file with some text called <em>test_example<\/em>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rntlab.com\/wp-content\/uploads\/2018\/09\/text_txt.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 Notepad Test Example File Filesystem fs LittleFS\" class=\"wp-image-17226\"\/><\/figure><\/div>\n\n\n<p><strong>5)<\/strong> Then, to upload the files, in the Arduino IDE, you just need to go to <strong>Tools&nbsp;<\/strong>&gt; <strong>ESP32 Sketch Data Upload<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rntlab.com\/wp-content\/uploads\/2018\/09\/sketch-data-upload.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 Sketch Data Upload Arduino IDE FS Filesystem\" class=\"wp-image-17223\"\/><\/figure><\/div>\n\n\n<p>6. Select the <strong>LittleFS <\/strong>option and click OK.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"271\" height=\"149\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Filesystem-uploader-plugin-esp32-littlefs.png?resize=271%2C149&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Filesystem Plugin ESP32 - Choose filesystem\" class=\"wp-image-132234\"\/><\/figure><\/div>\n\n\n<p>Make sure the <strong>Serial Monitor is closed<\/strong> before uploading the files, otherwise, you&#8217;ll get an error related to the Serial communication, and the files won&#8217;t upload.<\/p>\n\n\n\n<p class=\"rntbox rntcred\">The uploader will overwrite anything you had already saved in the filesystem.<\/p>\n\n\n\n<p><strong>Note<\/strong>: in some ESP32 development boards you need to press the on-board <strong>BOOT <\/strong>button for around two seconds to upload the files.<\/p>\n\n\n\n<p>The files were successfully uploaded to the ESP32 filesystem when you see the message &#8220;<strong>LittleFS Image Uploaded<\/strong>&#8220;.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"655\" height=\"162\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/LittleFS-image-uploaded-successfully.png?resize=655%2C162&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Filesystem image Uploaded successfully arduino ide ESP32\" class=\"wp-image-132238\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/LittleFS-image-uploaded-successfully.png?w=655&amp;quality=100&amp;strip=all&amp;ssl=1 655w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/LittleFS-image-uploaded-successfully.png?resize=300%2C74&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 655px) 100vw, 655px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"testing-filesystem-uploader\">Testing the Filesystem Uploader Plugin<\/h2>\n\n\n\n<p>Now, let\u2019s just check if the file was actually saved into the ESP32 filesystem. Simply upload the following code to your ESP32 board.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\r\n  Rui Santos &amp; Sara Santos - Random Nerd Tutorials\r\n  Complete project details at https:\/\/RandomNerdTutorials.com\/esp32-littlefs-arduino-ide\/\r\n*********\/\r\n\r\n#include &quot;LittleFS.h&quot;\r\n \r\nvoid setup() {\r\n  Serial.begin(115200);\r\n  \r\n  if(!LittleFS.begin()){\r\n    Serial.println(&quot;An Error has occurred while mounting SPIFFS&quot;);\r\n    return;\r\n  }\r\n  \r\n  File file = LittleFS.open(&quot;\/test_example.txt&quot;);\r\n  if(!file){\r\n    Serial.println(&quot;Failed to open file for reading&quot;);\r\n    return;\r\n  }\r\n  \r\n  Serial.println(&quot;File Content:&quot;);\r\n  while(file.available()){\r\n    Serial.write(file.read());\r\n  }\r\n  file.close();\r\n}\r\n \r\nvoid loop() {\r\n\r\n}\r\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ESP32\/ESP32_Read_Files_LittleFS.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>After uploading, open the Serial Monitor at a baud rate of 115200. Press the ESP32 &#8220;<strong>ENABLE<\/strong>\/<strong>RST<\/strong>&#8221; button. It should print the content of your <em>.txt<\/em> file on the Serial Monitor.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rntlab.com\/wp-content\/uploads\/2018\/09\/testing-file-system-serial-monitor.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 LittleFS Filesystem Example Arduino IDE Serial Monitor\" class=\"wp-image-17230\"\/><\/figure><\/div>\n\n\n<p>You\u2019ve successfully uploaded files to the ESP32 filesystem using the plugin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this tutorial, you installed a plugin for the Arduino IDE that allows you to upload files to the ESP32 filesystem. This plugin supports three different filesystems: SPIFFS, LittleFS, and FatFS.<\/p>\n\n\n\n<p>While many libraries and projects are moving to LittleFS, SPIFSS is still used and your previous projects that use SPIFFS should still be working.<\/p>\n\n\n\n<p>Because this new plugin supports both SPIFFS and LittleFS, you should consider installing this one instead of the <a href=\"https:\/\/randomnerdtutorials.com\/install-esp32-filesystem-uploader-arduino-ide\/\" title=\"\">SPIFFS plugin<\/a> so that you have more flexibility with the choice of filesystem.<\/p>\n\n\n\n<p>We hope you&#8217;ve found this tutorial useful.<\/p>\n\n\n\n<p>Learn more about the ESP32 using our resources:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\">Learn ESP32 with Arduino IDE (eBook)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/build-web-servers-esp32-esp8266-ebook\/\">Build Web Servers with ESP32 and ESP8266 (eBook)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/firebase-esp32-esp8266-ebook\/\">Firebase Web App with ESP32 and ESP8266 (eBook)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/projects-esp32\/\">Free ESP32 Projects and Tutorials\u2026<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you&#8217;ll learn how to upload files to the ESP32 Filesystem (LittleFS) by using a plugin for Arduino IDE (1.8.X). LittleFS is a lightweight filesystem created for microcontrollers &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"ESP32: Upload Files to LittleFS using Arduino IDE\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/esp32-littlefs-arduino-ide\/#more-132228\" aria-label=\"Read more about ESP32: Upload Files to LittleFS using Arduino IDE\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":132246,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[281,276,277,299,264],"tags":[],"class_list":["post-132228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32-project","category-esp32","category-esp32-arduino-ide","category-0-esp32","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/06\/Install-Filesystem-Plugin-ESP32.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/132228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=132228"}],"version-history":[{"count":18,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/132228\/revisions"}],"predecessor-version":[{"id":154953,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/132228\/revisions\/154953"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/132246"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=132228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=132228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=132228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}