{"id":100844,"date":"2020-12-22T15:36:32","date_gmt":"2020-12-22T15:36:32","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=100844"},"modified":"2020-12-23T15:36:28","modified_gmt":"2020-12-23T15:36:28","slug":"esp8266-nodemcu-vs-code-platformio-littlefs","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp8266-nodemcu-vs-code-platformio-littlefs\/","title":{"rendered":"ESP8266 NodeMCU with VS Code and PlatformIO: Upload Files to Filesystem (LittleFS)"},"content":{"rendered":"\n<p>Learn how to upload files to the ESP8266 NodeMCU board filesystem (LittleFS) using VS Code with the PlatformIO IDE extension (quick and easy). Using the filesystem with the ESP8266 can be useful to save HTML, CSS and JavaScript files to build a web server instead of having to write everything inside the Arduino sketch.<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><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\/2020\/12\/ESP8266-LittleFS-VSCode-PlatformIO.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP8266 NodeMCU with VS Code and PlatformIO IDE Upload Files to Filesystem LittleFS\" class=\"wp-image-100862\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/ESP8266-LittleFS-VSCode-PlatformIO.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/ESP8266-LittleFS-VSCode-PlatformIO.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/ESP8266-LittleFS-VSCode-PlatformIO.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/ESP8266-LittleFS-VSCode-PlatformIO.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\n<p>If you&#8217;re using Arduino IDE follow this tutorial instead: <a href=\"https:\/\/randomnerdtutorials.com\/install-esp8266-filesystem-uploader-arduino-ide\/\">Install ESP8266 Filesystem Uploader in Arduino IDE<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introducing SPIFFS\/LittleFS<\/h2>\n\n\n\n<p>There are two filesystems you can use for the onboard ESP8266 flash: SPIFFS and LittleFS.<\/p>\n\n\n\n<p>SPIFFS and LittleFS let you access the flash memory like you would do in a normal filesystem in your computer, but simpler and more limited. You can read, write, close, and delete files.<\/p>\n\n\n\n<p><strong>SPIFFS:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>original filesystem;<\/li><li>ideal for space and RAM constrained applications that use many files;<\/li><li>doesn&#8217;t support directories &#8211; everything is saved on a flat structure;<\/li><li>filesystem overhead on the flash is minimal;<\/li><li><span style=\"color: #e33112;\"><strong>SPIFFS is currently deprecated and may be removed in future releases of the core.<\/strong><\/span><\/li><\/ul>\n\n\n\n<p><strong>LittleFS:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>recent;<\/li><li>focuses on higher performance;<\/li><li>supports directories;<\/li><li>higher filesystem and per-file overhead (4K minimum vs. SPIFFS\u2019 256 byte minimum file allocation unit).<\/li><\/ul>\n\n\n\n<p>For more information about SPIFFS and LittleFS, refer to the <a href=\"https:\/\/arduino-esp8266.readthedocs.io\/en\/latest\/filesystem.html\" target=\"_blank\" rel=\"noreferrer noopener\">ESP8266 Arduino Core documentation<\/a>.<\/p>\n\n\n\n<p>SPIFFS is currently deprecated and may be removed in future releases of the ESP8266<br>core. It is recommended to use LittleFS instead. <\/p>\n\n\n\n<p>LittleFS is under active development, supports directories, and is many times faster for most operations. The methods used for SPIFFS are compatible with LittleFS, so, we can simply use the expression <span class=\"rnthl rntliteral\">LittleFS<\/span> instead of <span class=\"rnthl rntliteral\">SPIFFS<\/span> when converting a code from SPIFFS to LittleFS. <\/p>\n\n\n\n<p>For example, converting most applications from SPIFFS to LittleFS simply requires changing the <span class=\"rnthl rntliteral\">SPIFFS.begin()<\/span> to <span class=\"rnthl rntliteral\">LittleFS.begin()<\/span> and <span class=\"rnthl rntliteral\">SPIFFS.open()<\/span> to <span class=\"rnthl rntliteral\">LittleFS.open()<\/span>.<\/p>\n\n\n\n<p>Using the filesystem with the <a href=\"https:\/\/makeradvisor.com\/tools\/esp8266-esp-12e-nodemcu-wi-fi-development-board\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP8266 board<\/a>&nbsp;is specially useful to:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create configuration files with settings;<\/li><li>Save data permanently;<\/li><li>Create files to save small amounts of data instead of using a microSD card;<\/li><li>Save HTML, CSS and JavaScript files to build a web server;<\/li><li>Save images, figures and icons;<\/li><li>And much more.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Upload Files to ESP8266 NodeMCU LittleFS<\/h2>\n\n\n\n<p>The files you want to upload to the ESP8266 filesystem should be placed in a folder called <em>data<\/em> under the project folder. For you to understand how everything works, we&#8217;ll upload a <span class=\"rnthl rntliteral\">.txt<\/span> file with some random text. You can upload any other file type.<\/p>\n\n\n\n<p>If you&#8217;re not familiar with VS Code + PlatformIO IDE, follow the next tutorial first:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/vs-code-platformio-ide-esp32-esp8266-arduino\/\">Getting Started with VS Code and PlatformIO IDE for ESP32 and ESP8266<\/a><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Using LittleFS as Default Filesystem<\/h3>\n\n\n\n<p>SPIFFS is currently deprecated and may be removed in future releases of the ESP8266 core. It is recommended to use LittleFS instead. LittleFS is under active development, supports directories, and is many times faster for most operations. So, we&#8217;ll use LittleFS in this tutorial.<\/p>\n\n\n\n<p>In VS Code + PlatformIO, when uploading files, we must specify that we want to use LittleFS filesystem instead of SPIFFS (default), so you need to add the following line to the ESP826 <span class=\"rnthl rntliteral\">platformio.ini<\/span> configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>board_build.filesystem = littlefs<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"844\" height=\"365\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Use-littlefs-VS-Code-PlatformIO-ESP8266-NodeMCU.jpg?resize=844%2C365&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Use LittleFS as default filesystem ESP8266 VS Code + PlatformIO\" class=\"wp-image-100854\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Use-littlefs-VS-Code-PlatformIO-ESP8266-NodeMCU.jpg?w=844&amp;quality=100&amp;strip=all&amp;ssl=1 844w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Use-littlefs-VS-Code-PlatformIO-ESP8266-NodeMCU.jpg?resize=300%2C130&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Use-littlefs-VS-Code-PlatformIO-ESP8266-NodeMCU.jpg?resize=768%2C332&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 844px) 100vw, 844px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Creating a data Folder<\/h3>\n\n\n\n<p>Create a folder called <em>data <\/em>inside your project folder. This can be done on VS Code.<br>With your mouse, select the project folder you\u2019re working on. Click on the <strong>New Folder<\/strong> icon to create a new folder.<\/p>\n\n\n\n<p>This new folder must be called <em>data<\/em>, otherwise, it won\u2019t work.<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"708\" height=\"308\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Create-data-folder-VS-Code-PIO-ESP8266-LittleFS.png?resize=708%2C308&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Create a data folder VS Code PlatformIO ESP8266\" class=\"wp-image-100847\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Create-data-folder-VS-Code-PIO-ESP8266-LittleFS.png?w=708&amp;quality=100&amp;strip=all&amp;ssl=1 708w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Create-data-folder-VS-Code-PIO-ESP8266-LittleFS.png?resize=300%2C131&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/figure><\/div>\n\n\n\n<p>Then, select the newly created <em>data <\/em>folder and create the files you want to upload by clicking on the <strong>New File<\/strong> icon. In this example, we&#8217;ll create a file called <span class=\"rnthl rntliteral\">text.txt<\/span>. You can create and upload any other file types like <em>.html<\/em>, <em>.css<\/em> or <em>.js<\/em> files, for example.<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"676\" height=\"332\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Create-files-under-data-folder-VS-Code-PIO-ESP8266-LittleFS.png?resize=676%2C332&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Create files under data folder VS Code with PlatformIO ESP8266\" class=\"wp-image-100848\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Create-files-under-data-folder-VS-Code-PIO-ESP8266-LittleFS.png?w=676&amp;quality=100&amp;strip=all&amp;ssl=1 676w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Create-files-under-data-folder-VS-Code-PIO-ESP8266-LittleFS.png?resize=300%2C147&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 676px) 100vw, 676px\" \/><\/figure><\/div>\n\n\n\n<p>Write some random text inside that <span class=\"rnthl rntliteral\">.txt<\/span> file.<\/p>\n\n\n\n<p>The <em>data <\/em>folder should be under the project folder and the files you want to upload should be inside the <em>data <\/em>folder. Otherwise, it won&#8217;t work.<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"860\" height=\"293\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Create-Text-File-VS-Code-PlatformIO-ESP8266.jpg?resize=860%2C293&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Create text file VS Code PlatformIO ESP8266\" class=\"wp-image-100849\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Create-Text-File-VS-Code-PlatformIO-ESP8266.jpg?w=860&amp;quality=100&amp;strip=all&amp;ssl=1 860w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Create-Text-File-VS-Code-PlatformIO-ESP8266.jpg?resize=300%2C102&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Create-Text-File-VS-Code-PlatformIO-ESP8266.jpg?resize=768%2C262&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Uploading Filesystem Image<\/h3>\n\n\n\n<p>After creating and saving the file or files you want to upload under the <em>data<\/em> folder, follow the next steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Click the PIO icon at the left side bar. The project tasks should open.<\/li><li>Select <strong>env:nodemcuv2<\/strong> (it may different depending on the board you\u2019re using).<\/li><li>Expand the <strong>Platform <\/strong>menu.<\/li><li>Select <strong>Build Filesyste<\/strong>m Image.<\/li><li>Finally, click <strong>Upload Filesystem Image<\/strong>.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"696\" height=\"427\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Upload-filesystem-image-ESP8266-VS-Code-PlatformIO-LittleFS.jpg?resize=696%2C427&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Upload Filesystem Image VS Code PlatformIO ESP8266\" class=\"wp-image-100851\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Upload-filesystem-image-ESP8266-VS-Code-PlatformIO-LittleFS.jpg?w=696&amp;quality=100&amp;strip=all&amp;ssl=1 696w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Upload-filesystem-image-ESP8266-VS-Code-PlatformIO-LittleFS.jpg?resize=300%2C184&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/figure><\/div>\n\n\n\n<p class=\"rntbox rntcred\"><strong>Important: <\/strong> to upload the filesystem image successfully you must close all serial<br>connections (Serial Monitor) with your board.<\/p>\n\n\n\n<p>After a while, you should get a success message.<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"608\" height=\"160\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Upload-filesystem-image-ESP8266-VS-Code-PlatformIO-success-message.jpg?resize=608%2C160&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Upload filesystem image ESP8266 VS Code PlatformIO success message\" class=\"wp-image-100852\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Upload-filesystem-image-ESP8266-VS-Code-PlatformIO-success-message.jpg?w=608&amp;quality=100&amp;strip=all&amp;ssl=1 608w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Upload-filesystem-image-ESP8266-VS-Code-PlatformIO-success-message.jpg?resize=300%2C79&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 608px) 100vw, 608px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Troubleshooting<\/h3>\n\n\n\n<p>Here&#8217;s a common mistake:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Could not open port &#8220;COMX&#8221; Access is denied.<\/h4>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"590\" height=\"162\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Upload-filesystem-image-permission-error-ESP8266.jpg?resize=590%2C162&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Upload filesystem image ESP32 VS Code PlatformIO Access Denied Error ESP8266\" class=\"wp-image-100853\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Upload-filesystem-image-permission-error-ESP8266.jpg?w=590&amp;quality=100&amp;strip=all&amp;ssl=1 590w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Upload-filesystem-image-permission-error-ESP8266.jpg?resize=300%2C82&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><\/figure><\/div>\n\n\n\n<p>This error means that you have a serial connection opened with your board in VS Code or in any other program. Close any program that might be using the board serial port, and make sure you close all serial connections in VS Code (click on the recycle bin icon on the terminal console).<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"698\" height=\"40\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/VS-Code-PlatformIO-Close-Terminal-Window.jpg?resize=698%2C40&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code PlatformIO Close Terminal Window\" class=\"wp-image-100828\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/VS-Code-PlatformIO-Close-Terminal-Window.jpg?w=698&amp;quality=100&amp;strip=all&amp;ssl=1 698w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/VS-Code-PlatformIO-Close-Terminal-Window.jpg?resize=300%2C17&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 698px) 100vw, 698px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Testing<\/h2>\n\n\n\n<p>Now, let\u2019s just check if the file was actually saved into the ESP8266 filesystem. Copy the following code to the <span class=\"rnthl rntliteral\">main.cpp<\/span> file and upload it to your board.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos\n  Complete project details at https:\/\/RandomNerdTutorials.com\/esp8266-nodemcu-vs-code-platformio-littlefs\/  \n*********\/\n\n#include &lt;Arduino.h&gt;\n#include &quot;LittleFS.h&quot;\n \nvoid setup() {\n  Serial.begin(9600);\n  \n  if(!LittleFS.begin()){\n    Serial.println(&quot;An Error has occurred while mounting LittleFS&quot;);\n    return;\n  }\n  \n  File file = LittleFS.open(&quot;\/text.txt&quot;, &quot;r&quot;);\n  if(!file){\n    Serial.println(&quot;Failed to open file for reading&quot;);\n    return;\n  }\n  \n  Serial.println(&quot;File Content:&quot;);\n  while(file.available()){\n    Serial.write(file.read());\n  }\n  file.close();\n}\n \nvoid loop() {\n\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ESP8266\/VS_Code\/VS_Code_LittleFS_Test.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>You may need to change the following line depending on the name of your file.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>File file = LittleFS.open(\"\/text.txt\");<\/code><\/pre>\n\n\n\n<p>Open the Serial Monitor and it should print the content of your file.<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"233\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Reading-Content-of-File-ESP8266-VSCode-PlatformIO.jpg?resize=610%2C233&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Reading File Content LittleFS ESP8266 VS Code PlatformIO\" class=\"wp-image-100850\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Reading-Content-of-File-ESP8266-VSCode-PlatformIO.jpg?w=610&amp;quality=100&amp;strip=all&amp;ssl=1 610w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/Reading-Content-of-File-ESP8266-VSCode-PlatformIO.jpg?resize=300%2C115&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 610px) 100vw, 610px\" \/><\/figure><\/div>\n\n\n\n<p>You&#8217;ve successfully uploaded files to the ESP8266 filesystem (LittleFS) using VS Code + PlatformIO.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>With this tutorial you&#8217;ve learned how to upload files to the ESP8266 filesystem (LittleFS) using VS Code + PlatformIO. It is quick and easy.<\/p>\n\n\n\n<p>This can be specially useful to upload HTML, CSS and JavaScript files to build web server projects with the ESP8266 NodeMCU boards.<\/p>\n\n\n\n<p>We have a similar tutorial for the ESP32:\u00a0<a href=\"https:\/\/randomnerdtutorials.com\/esp32-vs-code-platformio-spiffs\/\">ESP32 with VS Code and PlatformIO: Upload Files to Filesystem (SPIFFS)<\/a><\/p>\n\n\n\n<p>Learn more about the ESP8266 NodeMCU with our resources:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/home-automation-using-esp8266\/\" target=\"_blank\" rel=\"noreferrer noopener\">Home Automation using ESP8266 (eBook)<\/a><\/li><li><a style=\"font-size: inherit; background-color: initial;\" href=\"https:\/\/randomnerdtutorials.com\/micropython-programming-with-esp32-and-esp8266\/\">MicroPython Programming with Arduino IDE (eBook)<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/projects-esp8266\/\">More ESP8266 NodeMCU Tutorials and Projects\u2026<\/a><\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to upload files to the ESP8266 NodeMCU board filesystem (LittleFS) using VS Code with the PlatformIO IDE extension (quick and easy). Using the filesystem with the ESP8266 can &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"ESP8266 NodeMCU with VS Code and PlatformIO: Upload Files to Filesystem (LittleFS)\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/esp8266-nodemcu-vs-code-platformio-littlefs\/#more-100844\" aria-label=\"Read more about ESP8266 NodeMCU with VS Code and PlatformIO: Upload Files to Filesystem (LittleFS)\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":100862,"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":[265,214,246,300,240,264],"tags":[],"class_list":["post-100844","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp8266-project","category-esp8266","category-esp8266-arduino-ide","category-0-esp8266","category-esp8266-projects","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/12\/ESP8266-LittleFS-VSCode-PlatformIO.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\/100844","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=100844"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/100844\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/100862"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=100844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=100844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=100844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}