0% found this document useful (0 votes)
97 views

Install ESP8266 Filesystem Uploader in Arduino IDE

The document discusses installing the ESP8266 Filesystem Uploader plugin for the Arduino IDE. This plugin allows uploading files from a computer to the ESP8266's SPIFFS filesystem, making it easy to work with files rather than typing everything in the sketch. The steps are to install the ESP8266 add-on for Arduino IDE, then install the uploader plugin. A test file can then be uploaded and its contents printed on the serial monitor to confirm successful installation.

Uploaded by

Hanny Berchmans
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

Install ESP8266 Filesystem Uploader in Arduino IDE

The document discusses installing the ESP8266 Filesystem Uploader plugin for the Arduino IDE. This plugin allows uploading files from a computer to the ESP8266's SPIFFS filesystem, making it easy to work with files rather than typing everything in the sketch. The steps are to install the ESP8266 add-on for Arduino IDE, then install the uploader plugin. A test file can then be uploaded and its contents printed on the serial monitor to confirm successful installation.

Uploaded by

Hanny Berchmans
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Install ESP8266

Filesystem Uploader in
Arduino IDE
• The ESP8266 contains a Serial Peripheral Interface Flash File System
(SPIFFS). SPIFFS is a lightweight filesystem created for microcontrollers
with a flash chip. This article shows how to easily upload files to the
ESP8266 filesystem using a plugin for Arduino IDE.
Introducing SPIFFS
• SPIFFS lets you access the flash chip 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. SPIFFS doesn’t support
directories, so everything is saved on a flat structure.

• Using SPIFFS with the ESP8266 board is specially 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 and CSS files to build a web server;
• Save images, figures and icons;
• And much more.
• In most of our web server projects, we’ve written the HTML code for the web server as a String directly
on the Arduino sketch. With SPIFFS, you can write the HTML and CSS in separated files and save them on
the ESP8266 filesystem.
Installing the Arduino ESP8266 Filesystem
Uploader
• You can create, save and write files to the ESP8266 filesystem by writing the
code yourself in Arduino IDE. This is not very useful, because you’d have to
type the content of your files in the Arduino sketch.

• Fortunately, there is a plugin for the Arduino IDE that allows you to upload files
directly to the ESP8266 filesystem from a folder in your computer. This makes it
really easy and simple to work with files. Let’s install it.

• First, make sure you have the latest Arduino IDE installed, and you have the
ESP8266 add-on for the Arduino IDE. If you don’t, follow the next tutorial to
install the add-on:
Installing the Arduino
ESP8266 Filesystem Uploader
• You can create, save and write files to the ESP8266 filesystem by writing
the code yourself in Arduino IDE. This is not very useful, because you’d
have to type the content of your files in the Arduino sketch.

• Fortunately, there is a plugin for the Arduino IDE that allows you to upload
files directly to the ESP8266 filesystem from a folder in your computer. This
makes it really easy and simple to work with files. Let’s install it.

• First, make sure you have the latest Arduino IDE installed, and you have
the ESP8266 add-on for the Arduino IDE. If you don’t, follow the next
tutorial to install the add-on:To check if the plugin was successfully
installed, open your Arduino IDE and select your ESP8266 board. In the
Tools menu check that you have the option “ESP8266 Sketch Data Upload“.
Uploading Files using the Filesystem
Uploader
• To upload files to the ESP8266
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.
Uploading Files • Inside that folder, create a new folder called data.

using the Filesystem • In the Arduino IDE, in the Tools menu, select the desired
Uploader SPIFFS size (this will depend on the size of your files)
• Then, to upload the files, in the Arduino IDE, you just need to
Uploading Files go to Tools > ESP8266 Sketch Data Upload.
using the Filesystem • You should get a similar message on the debugging window.
The files were successfully uploaded to the ESP8266
Uploader filesystem.
• Now, let’s just check if the file was actually saved into the
ESP8266 filesystem. Simply upload the following code to your
ESP8266 board.
Testing the Uploader • After uploading, open the Serial Monitor at a baud rate of
115200. Press the ESP8266 “RST” button. It should print the
content of your .txt file on the Serial Monitor.
/*********
Rui Santos
Complete project details at
https://RandomNerdTutorials.com
*********/
#include "FS.h"
void setup() {
Serial.begin(115200);
if(!SPIFFS.begin()){
Serial.println("An Error has occurred while mounting
SPIFFS");
return;
}
File file = SPIFFS.open("/test_example.txt", "r");
if(!file){
Serial.println("Failed to open file for reading");
return;
}
Serial.println();
Serial.println("File Content:");
while(file.available()){
Serial.write(file.read());
}
file.close();
}
void loop() {
}

You might also like