members
Basics: Project 070i ESP32 Development board - Filesystem Uploader
of Acoptex.com in ESP8266 ESP-32
Basics: Project 070i
Project name: ESP32 Development board - Filesystem Uploader
Tags: EESP32 Dev Module, ESP32 development board, ESP32 Development board with WiFi and Bluetooth, ESP32-DevKitC V4 development board, ESP-WROOM-32 module with ESP32‑D0WDQ6 chip, Espressif Systems, ESP32-based development board, ESP32 modules, ESP32-WROOM-32, ESP32-WROOM-32U, ESP32-WROOM-32D, ESP32-SOLO-1, USB-UART bridge, IOT, ESP-WROOM-32 Dev Module, ESP32 DEVKITV1, Installing the ESP32 Board in Arduino IDE, Uploading sketch, ESP32 Development board Filesystem Uploader, Serial Peripheral Interface Flash File System, SPIFFS
Attachments: esp32filesystemtestsketch
In this project, you need these parts :
1. ESP32 development board with WiFi and Bluetooth and USB A / micro USB B cable 1 pc
2. Arduino IDE ( you can download it from here )
General
We will learn how to upload files to the ESP32 development board's filesystem using a plugin for the Arduino IDE.
Understanding the SPIFFS
The ESP32 development board contains a Serial Peripheral Interface Flash File System (SPIFFS). SPIFFS is a lightweight filesystem created for microcontrollers with a flash chip, which are connected by SPI bus, like the ESP32 development board's flash memory.
SPIFFS lets 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. SPIFFS doesn’t support directories.
Using SPIFFS with the ESP32 Development 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;
- And so on.
You can write the HTML and CSS used for the web server in a separated file and save them on the ESP32 Development board's filesystem with SPIFFS. It's very useful as in most of our web server DIY projects we have written the HTML code for the web server as a String directly in an Arduino sketch.
There is a plugin for the Arduino IDE that allows you to upload files directly to the ESP32 Development board's filesystem from a folder in your computer. This makes it really easy and simple to work with files as you do not need to type the content of your files in the Arduino sketch.
Understanding the ESP32 Development board with WiFi and Bluetooth
You can read more about it here.
Signals and connections of the ESP32 Development board with WiFi and Bluetooth
You can find more information (datasheets, schematics, pins descriptions, functional desgn descriptions) about each board (made by Espresiff Systems) by pressing Getting started link close to each board here.
Let's check our development board - ESP32 DEVKITV1with ESP-WROOM-32 module from Espressif Systems:
Pinout diagram for the ESP Wroom 32 breakout:
ESP32-WROOM-32 - ESP32-WROOM-32 module soldered to the development board. Optionally ESP32-WROOM-32D, ESP32-WROOM-32U or ESP32-SOLO-1 module may be soldered instead of the ESP32-WROOM-32.
USB-UART Bridge - A single chip USB-UART bridge provides up to 3 Mbps transfers rates.
BOOT button - Download button: holding down the Boot button and pressing the EN button initiates the firmware download mode. Then user can download firmware through the serial port.
EN button - Reset button: pressing this button resets the system.
Micro USB Port - USB interface. It functions as the power supply for the board and the communication interface between PC and the ESP module.
TX0, TX2 - transmit pin. GPIO pin
RX0, RX2 - receive pin. GPIO pin
3V3 (or 3V or 3.3V) - power supply pin (3-3.6V).
GND - ground pin.
EN - Chip enable. Keep it on high (3.3V) for normal operation.
Vin - External power supply 5VDC.
Step by Step instruction
The ESP32 is currently being integrated with the Arduino IDE like it was done for the ESP8266. There’s an add-on for the Arduino IDE that allows you to program the ESP32 using the Arduino IDE and its programming language.
1. Installing ESP32 add-on in the Arduino IDE (Windows 10 OS)
- Download and install the latest Arduino IDE Windows Installer from arduino.cc
- Download and install Git and Git GUI from git-scm.com
- Search for Git GUI, right-click the icon and select “Run as administrator“
- Select the Clone Existing Repository option.
- Select source and destination. Source Location: https://github.com/espressif/arduino-esp32.git
- Target Directory:C:/Users/[YOUR_USER_NAME]/Documents/Arduino/hardware/espressif/esp32
- Do not create the espressif/esp32 folders, because they will be created automatically.
- Click Clone to start cloning the repository.Wait a few seconds while the repository is being cloned.
- Open the folder: C:/Users/[YOUR_USER_NAME]/Documents/Arduino/hardware/espressif/esp32/tools
- Right-click the get.exe file and select “Run as administrator“.
- You will see that necessary files will be downloaded and upzipped. It will take some time.
- When get.exe finishes, you should see the following files in the directory.
2. Installing the Arduino ESP32 Filesystem Uploader
- Download the ESP32FSv0.1.zip file. Home page on Github.
- Go to the Arduino IDE directory and open the Tools folder.
- Restart your Arduino IDE.
- Open your Arduino IDE. Go to Tools menu. If you have the option ESP32 Sketch Data Upload Arduino ESP32 filesystem uploader was successfully installed.
3. Uploading files using the Arduino ESP32 Filesystem Uploader
- Plug the ESP32 development board to your PC and wait for the drivers to install (or install manually any that might be required).
- Open Boards manager. Go to Tools -> Board -> Boards Manager… (in our case it’s the DOIT ESP32 DEVKIT V1)
- Select COM port that the board is attached to (if you don’t see the COM Port in your Arduino IDE, you need to install the ESP32 CP210x USB to UART Bridge VCP Drivers)
- Make an Arduino sketch and save it. It can be an empty sketch - test.ino.
- Open the sketch folder. Go to Sketch -> Show Sketch Folder. You will open the folder where your sketch is saved.
- Make a new subfolder with name data inside of this folder.
- The data folder is where you should put the files you want to be saved into the ESP32 filesystem. Let's make a .txt file with some text called test. Type some text and save the file.
- Go to Tools -> ESP32 Sketch Data Upload to upload the files.
- If everything went as expected, you should see a “SPIFFS Image Uploaded” message. (You need to hold the ESP32 on-board Boot button while uploading).
- Press the ESP32 on-board EN button to reboot it.
- Let’s check if the file was saved into the ESP32 Development board's filesystem. Open esp32filesystemtestsketch, compile and upload it to your ESP32 development board. If everything went as expected, you should see a “Done uploading” message. (You need to hold the ESP32 on-board Boot button while uploading).
- Press the ESP32 on-board EN button to reboot it.
- Open the Serial Monitor at a baud rate of 115200.
- It will print the content of your .txt file. Congrats!!! You have successfully uploaded files to the ESP32 filesystem using the plugin.
Summary
We have learnt how to upload files to the ESP32 development board's filesystem using a plugin for the Arduino IDE.
Libraries
- None
Sketch
- See attachments on the begining of this project
Other projects of Acoptex.com










jobs.viewed