MENU

Fun & Interesting

#203 SPIFFS vs LITTLEFS for ESP32✅ & ESP8266✅ (not Arduino UNO❌)

Ralph S Bacon 72,852 lượt xem 4 years ago
Video Not Working? Fix It Now

So we have the equivalent of a very small SSD in each of our ESP8266s and ESP32s but it mostly remains unused. Instead of using SD cards for trivial files let's use the built in flash file store.
JLCPCB Only $2 for PCB Prototype any colour https://jlcpcb.com/

00:00 Welcome Back!
01:06 Sponsor Message - JLCPCB https://jlcpcb.com/
02:09 Video continues
04:22 SPIFFS explained
07:25 Installing the LITTLEFS.h library
09:30 Installing the "data file upload" tools into the IDE (one-time operation)
13:10 The ESP32 parameters for the SPIFFS partition and more!
18:02 Uploading our files from the DATA folder
19:12 Uploading the sketch to read those files
20:31 The sketch walk-through
23:46 Summary

See more info: https://github.com/RalphBacon/203-SPIFFS-vs-LITTLEFS

SPIFFS stands for SPI Flash File System. A bit like your SSD in your PC.

SPI is a protocol that is often used in the Arduino arena (it stands for Serial Peripheral Interconnect, but that's why we call it SPI).

Flash is the memory on your μController. Yes, your sketch resides in Flash memory.

File System is the term for storing "files" in that memory. Yes, just like on that SD card.

So we can store files in this SSD-like memory on our ESP8266s and ESP32s? Yes, but not on an Arduino UNO or similar because we just don't have anywhere near the memory required for this.

The bad news is that SPIFFS has been deprecated by Espressif (the designers of ESP8266/ESP32) because it was not resilient enough. And relatively slow, too.

The replacement LITTLEFS is even power-interruption resilient and the File System will not be corrupted if the power disappears during a write operation. Allegedly. Even if one file gets corrupted, the rest are safe.

Espressif state: "SPIFFS is the original filesystem and is ideal for space and RAM constrained applications that utilize many small files and care about static and dynamic wear levelling and don’t need true directory support. Filesystem overhead on the flash is minimal as well."

Read more on my GitHub: https://github.com/RalphBacon/203-SPIFFS-vs-LITTLEFS

### List of all my videos
(Special thanks to Michael Kurt Vogel for compiling this)
http://bit.ly/YouTubeVideoList-RalphBacon

Benny's Life Story, Best Cat Ever.
https://wordpress.com/post/ralphbacon.blog/456

-----------
INFORMATION
-----------
Official document regarding SPIFFS vs LITTLEFS
https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#uploading-files-to-file-system

All about the ESP32 - features guide
https://www.exploreembedded.com/wiki/Overview_of_ESP32_features._What_do_they_practically_mean%3F

### List of all my videos
(Special thanks to Michael Kurt Vogel for compiling this)
http://bit.ly/YouTubeVideoList-RalphBacon

-----
ESP32
-----

ESP32 Universal SPIFFS, LITTELFS and FATFS tools for Arduino IDE
https://github.com/lorol/arduino-esp32fs-plugin
https://github.com/lorol/arduino-esp32fs-plugin/releases

Dennis Phillips (viewer) says:
I thought it might be worth mentioning that for users of PlatformIO the tools are also available. https://github.com/lorol/LITTLEFS/tree/master/examples/LITTLEFS_PlatformIO
Thanks Dennis!

Note: You need the following 3 files:
esp32fs.zip, mkfatfs.zip and x86_64-64.minw32-mklittlefs-....zip

Above is a fork from the original code here:
https://github.com/me-no-dev/arduino-esp32fs-plugin

-------
ESP8266
-------
Arduino IDE ESP8266 filesystem:
https://github.com/earlephilhower/arduino-esp8266littlefs-plugin
https://github.com/earlephilhower/arduino-esp8266littlefs-plugin/releases

Note: You need the following 1 file:
ESP8266FS-0.5.0.zip (if there is a higher version, take it)

--------
PRODUCTS
--------
ESP32 modules are inexpensive these days. Here are a few examples.

The links might be affiliate links which can earn my channel some money to buy more stuff. Just click on a link before you buy *anything* from Banggood, Aliexpress or Amazon (UK).

ESP32 Development Board WiFi+Bluetooth Ultra Low Power Consumption Dual Cores About $7 + shipping
https://www.banggood.com/custlink/mvGhHywKDr

Similar board, but cheaper at $4.99 (on sale until 31 Dec 2020):
https://www.banggood.com/custlink/DKGhPYTGdm
Note: from China, USA and UK

ESP8266 (bare - no USB socket) $3.99
https://www.banggood.com/custlink/K33EVh7vRl

ESP8266 by Geekcreit® NodeMcu Lua CH340G V3 with USB socket $4.99
https://www.banggood.com/custlink/vDDEVYTvd0

Two line (16 x 2) LCD display, Black/Green, very easy to use with I2C only £3.99
https://amzn.to/34fEOhG

ESP32-DevKitC core board ESP32 development board (ESP32-WROOM-32D or 32U) $3.99 plus shipping
https://s.click.aliexpress.com/e/_AASDSr

If you like this video please give it a thumbs up, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite journey

My channel, GitHub and blog are here:
https://www.youtube.com/RalphBacon
https://ralphbacon.blog
https://github.com/RalphBacon

Comment