ESP32 and SPIFFS Step By Step

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi welcome back to satoku Tech in my previous video getting started with esp32 and the ili 9341 TFT LCD display we got the wiring done and did the hello world example sketch so I felt confident that we could proceed with video on the esp32 just as outlined in this project here and they have several different example sketches using the SD card and different video formats so I was getting kind of excited thinking that this was going to be pretty cool now you got to remember the original articles using an Ila 9225 yeah see here I added the amplifier in the speaker the amplifier gets wired into pin 26 we're going to go into this in another video but here yeah SD card Mount failed and I tried I have two redundant sets of hardware of course two SD cards so I've replaced everything tested all known good and I still have the same result so we're going to plow ahead with spiffs examples because the SD card's not working so I removed the wiring for the SD card oh now I come to realize I don't know how to I don't know how to use spiffs I've never done that before what does Fifth stand for it stands for SPI flash filing system that could be a tongue twister if you said it fast enough basically we're going to use a portion of the flash Ram as file storage on the esp32 and this tells us that we need to have a partition scheme no OTA one Mega apps three mixed biffs and we need this Arduino esp32 FS plugin I've never worked with spiffs before so let's uh figure out what we're doing here yeah I'll leave a link in the description down below to this GitHub site oh and something to consider Arduino 2.x doesn't allow for plugins yet they didn't add any code to support plugins so yeah right here people are saying when is it going to be in 2.x it's really up to the Arduino team to enable that plug-in support in Arduino 2.x 2.10 I've been trying to use Arduino two point whatever to be modern but now I find out I need to use the older version to do this so the first thing we're going to do is from the releases page we're going to go ahead and download that zip file there it is you're just going to click on that and download it go back to the instructions in your Arduino Sketchbook directory you need to create a tools folder so in my case it's documents Arduino tools let's go take a look at documents Arduino we will sort alphabetically and down here under the letter T you see the tools folder I just created document Arduino tools and in that I've already copied and pasted the contents of that zip file copy paste that into the tools folder just like that Arduino tools esp32fs and of course you want to close and reopen the 1.8 version of Arduino IDE to pick up that plugin So within each sketch you have to have a data folder so you see this spiffs RGB 565 video has a data folder in the directory and the data folder contains the files that you want to copy to the spiffs let's go ahead and open that sketch okay so let's check out all the settings here under Tools yeah we've got our esp32 Dev module there's our partition scheme no Oda one Meg app three megabytes spiffs you do have this option here erase all Flash before sketch upload if you enable that that's going to wipe everything out it seems the esp32 sketch data upload function replaces any existing files so we won't need to do that wipe of the flash memory and let's go look see now see inside that data folder is the output RGB that's that little video file 1.6 Megs and that's going to get copied to this fifths on the esp32 yeah we're compiling the sketch there in the background yeah remember when it goes to connect and upload in the Arduino IDE you want to press and hold that button just to the right of the USB plug there and once you see it start to go across then you can release the button and it will continue to upload there we go the sketch is uploaded but you'll notice we haven't copied the file over yet to the spiff so we're going to get this error on the screen here yeah failed to open output RGB file for reading that's because it's not there yet so now we need to go into tools esp32 sketch data upload you click on that it it's attempting to connect so you got to hold down the button hold that button down there we go now we can release that button and it's copying that output RGB folder from the data folder in the Sketchbook to the spiff on the esp32 there's no hierarchical file system it's flat so that spiff just has files in it at the root so everything's slash file name there's no child directory underneath that okay so it's hard resetting after copying that file over this is a rather simple video it's basically like just a few frames a guy eating looks like he's eating Ramen or something yeah but we see we can play video at least this simple RGB file from the spiff on the esp32 so we are playing video on esp32 we're going to make another video about the example video sketches but I had to learn how to use spiffs First I'm going to go one further and show you some additional management capabilities using this sketch from this article look for the link in the description below yeah I just copied this final code from the article I created a new sketch called list spiffs and their example sketch actually creates a test text file does a directory read and then deletes the test text file and does a directory read again yeah we open up serial monitor gonna hit reset on the device there we go there it created yeah file was written it created test dot text and there's your directory read out there the output RGB file in the test text file are in there and then it deletes test.text and leaves that output rgp and leaves that output RGB file there these functions are remarkably simple you'll be able to use this example code to suit your needs if you need to remove a file from spiffs or if you need to write a file to spiffs all right I feel confident working with spiffs now I hope you learned something leave a comment down below also please make sure to check out getting started with esp32 and the ili 9341 if you haven't already and we're going to work through some of the example sketches of playing video on the esp32 using spiffs so stay tuned and give this video a like leave a comment down below and before you go watch more of my ili 9341 videos please click on subscribe thank you very much
Info
Channel: ShotokuTech
Views: 4,182
Rating: undefined out of 5
Keywords: ESP32 and SPIFFS Step By Step, ESP32 and SPIFFS, Step By Step, ESP32, SPIFFS, ILI9341
Id: sl3d6SgBd6c
Channel Id: undefined
Length: 8min 11sec (491 seconds)
Published: Thu May 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.