ESP32 & ESP8266 - How to upload a file to LittleFS and SPIFFS, ESP32 with Arduino IDE

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome to my channel so today we are going to talk about how to upload some file to your esp32 microcontroller file system and file system that we are going to talk about it's little FS or SPI FS as I mentioned these two file system you are going to use interchangeably because some ESP models support a little fs and some support SPI FS but you don't have to bother about that syntax it's almost the same so if you have problems to set up little FS try SPI fs and vice versa so question about this subject has been published to my channel to episode little FS file system by subscriber pal and I'm sorry if I'm not pronouncing this very well so in short how you can transfer file from your PC to your esp32 or uh esp8266 microcontroller well you can't but at least not directly there is a way around it let me show you I'm going to open my Firefox uh go to GitHub and find this repository me o Dev Arduino esp32 FS plugin and find releases but keep in mind that there are many branches of this project so find the one that suits your needs the best then go and download this file it's zip I have already did that so we have a esp32 FS uh 1.1 then you are going to extract this and we are going to get this folder so in it we are going to have a esp32 FS tool and we are going to have this jar and because we are dealing with jar files you would have to install Java on your system so for this example I'm using Linux but you can follow this uh using Windows as well so what you should do uh find your Arduino directory my it's in home directory but if you're on Windows uh it could be on home or in uh C program files for example open it and if you don't have it create a tools directory open it and and now you are going to copy this entire uh ESP 32 Fs in it so now when you open this esp32 FS you're going to find tool and you're going to find this ESP 32 FS jar and this is necessary part in order to get this plugin to your Arduino IDE so if that part is done we don't need this window anymore and now with my command line I'm going to call ESP Tools in order to erase entire flash memory from my microcontroller all right now start Arduino IDE and the first thing that we are going to do we are going to save this project save as navigate where you want to store it name it whatever you like something descriptive all right now find that directory and what I want to transfer to uh my ESP 32 microcontroller it's this small image 25 by 25 pixels so I'm going to copy it I'm going to uh find the location of my project it's in e ESP and let me find it PC to ESP file system and now create new folder in here call it data and in data store files that you want to upload all right now I'm going to maximize this window go to tools and this is uh what I told you this is plug-in that we need in order to upload our files but now before we continue to our code what you have to check out first make sure that with programmer you have selected ESP tool then with Partition scheme go and select one that you prefer so in my case that is no OTA so 2 megabytes for application and 2 megabytes for SPI ffs and now when all of that is done go to ESP 32 sketch data upload and click on it okay now I have my uh file uploaded to esp32 microcontroller memory and now I'm going to write some code in order to prove that so first I'm going to include SPI fs.h so now I'm going to use SPI ffs because my uh microcontroller doesn't like little FS but as I said you don't have to worry about that part the only important thing is that your project is is going to work at the end and code it's actually almost exact the same so what I want to do I'm going to remove this going to initialize serial [Music] monitor 9,600 that's fine now if SPI ffs dot begin not not meaning if we cannot initialize our file system I want to print something FS error now I'm going to create file file SPI ffs open name of my picture it's uh image.png don't forget forward slash and now if not file file can't be found else so as you know this is PNG file but I just want to print this content to serial monitor in order for you to see that that file actually exists so I'm going to use vile Loop while file it's available serial write file do read all right and when that is done file do close all right now I'm just going to upload uh this code okay my code it's uploaded let me check serial monitor give me a second to restart my microcontroller let me see what we have in here so file printing commenced we have PNG and this is content of our picture so guys that's all for this episode I hope that you have learned something interesting so please like subscribe and see you around
Info
Channel: Kind Spirit Technology
Views: 987
Rating: undefined out of 5
Keywords: upload file from pc to esp32, upload file from pc to spiffs, upload file from pc to littlefs
Id: nEqSCR3gb_0
Channel Id: undefined
Length: 8min 6sec (486 seconds)
Published: Thu Feb 15 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.