Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Uploading files to ESP32 using SPIFFS (Read 4433 times)
HomerRamone
Junior Member
**
Offline


Posts: 43
Joined: Feb 5th, 2022
Uploading files to ESP32 using SPIFFS
Feb 6th, 2022 at 3:32pm
Print Post  
I understand you can upload files to an ESP32 device using something called  Serial Peripheral Interface Flash File System (SPIFFS). 
There is a plugin/extension for the Arduino IDE that lets to upload an arbitrary file. (Here: https://randomnerdtutorials.com/install-esp32-filesystem-uploader-arduino-ide/)

Just wondering if Visual Micro supports anything similar ?

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading files to ESP32 using SPIFFS
Reply #1 - Feb 6th, 2022 at 9:57pm
Print Post  
Hi, 

Visual Micro works the same as the Arduino IDE. The link you have posted is valid. 

You can review the spiffs and other board settings on the vMicro menu, then ensure you have file(s) in the \data sub folder of your project and finally click "vMicro>Publish Server Data Files"

Does this help?
  
Back to top
IP Logged
 
HomerRamone
Junior Member
**
Offline


Posts: 43
Joined: Feb 5th, 2022
Re: Uploading files to ESP32 using SPIFFS
Reply #2 - Feb 7th, 2022 at 7:19am
Print Post  
Ill try that later today, thanks.

Is there a way I can have it automatically upload as part of the build process.
I tried adding my data file to the source folder but not sure it was uploaded - The open call on the file failed, but this might be "user error" Smiley
  
Back to top
 
IP Logged
 
HomerRamone
Junior Member
**
Offline


Posts: 43
Joined: Feb 5th, 2022
Re: Uploading files to ESP32 using SPIFFS
Reply #3 - Feb 7th, 2022 at 9:18am
Print Post  
Where does the data folder need to be relative the the .ino file?
MyProject      (DIR)
     myproject.sln      
     MyProject (DIR)
           myproject.ino
           src (DIR)
Ive tried creating a data folder in both the MyProject where my .ino file is and one in sec (and adding a adding config.json file)

then doing 
Quote:
if (!SPIFFS.begin())      
{            
     Debug.print(DBG_WARNING, "Failed to start SPIFFS");            
     return false;      
}      
bool Exists = SPIFFS.exists("config.json");      
bool ExistsData = SPIFFS.exists("data/config.json");
Debug.print(DBG_WARNING, "Ex:%d Ex2:%d", (int)Exists, (int)ExistsData); 

I tried build/run as well as trying build then using "Publish Sever Data Files" (which does seem to do something):
Quote:
SPIFFS Creating Image...[SPIFFS] data   : C:\Git\Ardunio\MyProject\MyProject\data[SPIFFS] size   : 1472[SPIFFS] page   : 256[SPIFFS] block  : 4096

In both cases exists returns false.
« Last Edit: Feb 7th, 2022 at 10:11am by HomerRamone »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Uploading files to ESP32 using SPIFFS
Reply #4 - Feb 7th, 2022 at 10:53am
Print Post  
The data folder should be at the same level as the ino file:

MyProject      (DIR)
     myproject.sln      
     MyProject (DIR)
           myproject.ino
           src (DIR)
           data (DIR)

The Publish Server Data files is the way to manually upload the SPIFFs data.  Can you enable the below options:
vMicro > Compiler > Verbose
vMicro > Compiler > Show Build Properties
vMicro > Uploader > Verbose

And then attach the content from Output > Micro Build, after running a build and running Publish Server Data files so we can investigate further?

There are two additional board options which allow you to specify which file system to use (SPIFFS/LittleFS/FatFS), as well as an option to Automatically upload the filesystem data with each code upload:
https://www.visualmicro.com/page/ESP8266-SPIFFS-and-LittleFS-FileSystems.aspx
  
Back to top
IP Logged
 
HomerRamone
Junior Member
**
Offline


Posts: 43
Joined: Feb 5th, 2022
Re: Uploading files to ESP32 using SPIFFS
Reply #5 - Feb 7th, 2022 at 11:22am
Print Post  
Log attached.
Looking at the output of the upload it does look like its uploaded, but - open still fails Sad

Looked at the page you linked and see no reference an option to Automatically upload the filesystem data. 
(Though I do see a note about SPIFFS is no longer maintained so will possibly look to use little FS)
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Uploading files to ESP32 using SPIFFS
Reply #6 - Feb 7th, 2022 at 11:59am
Print Post  
We will update the page for the Automatic FS upload option, it is a simple on/off board menu option in vMicro for the versions after 21.09.17.0.

Once enabled it simply runs the Publish Server Data files for your configuration after the upload.

The file paths need to begin with a '/' in your code as well, and if you have the config.json in the data folder, this will be uploaded as "/config.json" when using SPIFFS in your code.
  
Back to top
IP Logged
 
HomerRamone
Junior Member
**
Offline


Posts: 43
Joined: Feb 5th, 2022
Re: Uploading files to ESP32 using SPIFFS
Reply #7 - Feb 7th, 2022 at 12:09pm
Print Post  
The missing / looks to have been the problem. Doh.

Thanks.

Still no luck finding auto upload

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Uploading files to ESP32 using SPIFFS
Reply #8 - Feb 7th, 2022 at 12:22pm
Print Post  
You will need to update your copy of Visual Micro to gain the additional board options on the menu.

If you're using VS2019 this can be downloaded from the link below:
https://1drv.ms/u/s!AsT00oFsGAmRoO4JVG47LeCEaM5-cQ?e=IZ9bnD

If you're using VS2022 this can be done from Manage Extensions in Visual Studio.
  
Back to top
IP Logged
 
HomerRamone
Junior Member
**
Offline


Posts: 43
Joined: Feb 5th, 2022
Re: Uploading files to ESP32 using SPIFFS
Reply #9 - Feb 7th, 2022 at 1:04pm
Print Post  
Ah, ok. Thanks.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint