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) SPIFFS data .bin file creation when compiling ? (Read 3911 times)
WoeperBe
Junior Member
**
Offline


Posts: 14
Location: Belgium
Joined: Mar 18th, 2020
SPIFFS data .bin file creation when compiling ?
Jul 30th, 2020 at 5:15pm
Print Post  
Hello everybody,
Is there a way to have the SPIFFS.bin file to be recreated and put in the release directory automaticaly when hitting the compile button ?

i'm using Visual Studio 2017 community Version
« Last Edit: Jul 30th, 2020 at 5:16pm by WoeperBe »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: SPIFFS data .bin file creation when compiling ?
Reply #1 - Jul 30th, 2020 at 5:26pm
Print Post  
Hi

Trying to get some context here so few questions:-

Which IDE?
Do you know about "vMicro>Publish Server Data Files (spiffs)"?

Thanks
  
Back to top
WWW  
IP Logged
 
WoeperBe
Junior Member
**
Offline


Posts: 14
Location: Belgium
Joined: Mar 18th, 2020
Re: SPIFFS data .bin file creation when compiling ?
Reply #2 - Jul 30th, 2020 at 5:46pm
Print Post  
Yes i do 
I use Microsoft Visual Studio 2017 with Visual Micro
I 'm looking a way to have when i click the compile button the data subfolder is compiled also to the spiffs.bin file and put together with the sketch bin file to the release directory
Then i use a homemade program to copy these files to a webserver for httpupdate calles from my nodemcu modules
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: SPIFFS data .bin file creation when compiling ?
Reply #3 - Jul 30th, 2020 at 7:16pm
Print Post  
We need to come up with something more flexible but you can call the spiffs system from a post build event. Passing an invalid port just creates the .bin withouth upload. It will show an error that releates to the invalid port but the .bin should have created OK.

Unfortunetly it will always create the bin in a sub folder below the specified folder but the sub folder name shouldn't change if your spiffs options don't change.

The default output uses the temp build folder which you can see in the verbose output or when "vMicro>Compiler>Show build folder" is enabled.

There are two esp8266 examples below. One using the build folder variables and one with hard coded output folder.

There is also an ESP32 variation in the example below (in case other readers need it).

Add the following into a board.txt in the project folder, save it then click build.

Code
Select All
# ESP8266 post build spiffs creation
#

# Use build folder -build.path="{build.path}"
# exe" -serial.port=NO_PORT -build.path="{build.path}" -target_platform="{target_platform}" -runtime.tools.mkspiffs.path="{runtime.tools.mkspiffs.path}" -board.name="{name}" -upload.verbose={upload.verbose} -upload.resetmethod={upload.resetmethod} -upload.speed={upload.speed}  -platform.path="{runtime.platform.path}" -project.name="{build.project_name}" -project.path="{build.project_path}" -tools.esptool.cmd="{tools.esptool.cmd}" -runtime.tools.esptool.path="{runtime.tools.esptool.path}" -compiler.path="{compiler.path}" -build.spiffs_start="{build.spiffs_start}" -build.spiffs_end="{build.spiffs_end}" -build.spiffs_pagesize="{build.spiffs_pagesize}" -build.spiffs_blocksize="{build.spiffs_blocksize}"

#Use specific path
exe" -serial.port=NO_PORT -build.path="C:\myrepos\Sketch17\Sketch17\Release" -target_platform="{target_platform}" -runtime.tools.mkspiffs.path="{runtime.tools.mkspiffs.path}" -board.name="{name}" -upload.verbose={upload.verbose} -upload.resetmethod={upload.resetmethod} -upload.speed={upload.speed}  -platform.path="{runtime.platform.path}" -project.name="{build.project_name}" -project.path="{build.project_path}" -tools.esptool.cmd="{tools.esptool.cmd}" -runtime.tools.esptool.path="{runtime.tools.esptool.path}" -compiler.path="{compiler.path}" -build.spiffs_start="{build.spiffs_start}" -build.spiffs_end="{build.spiffs_end}" -build.spiffs_pagesize="{build.spiffs_pagesize}" -build.spiffs_blocksize="{build.spiffs_blocksize}"



# ESP32 post build spiffs creation
#
# e" -serial.port=NO_PORT -build.path="{build.path}" -target_platform="esp32" -runtime.tools.mkspiffs.path="{runtime.tools.mkspiffs.path}" -board.name="{name}" -upload.speed={upload.speed}  -platform.path="{runtime.platform.path}" -project.name="{build.project_name}" -project.path="{build.project_path}" -compiler.path="{compiler.path}" -build.partitions="{build.partitions}" -upload.tool={upload.tool} -tools.esptool_py.cmd="{tools.esptool_py.cmd}"  -runtime.tools.esptool_py.path="{runtime.tools.esptool_py.path}" -build.flash_mode={build.flash_mode} -build.flash_freq={build.flash_freq}
 

« Last Edit: Aug 1st, 2020 at 2:01pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
WoeperBe
Junior Member
**
Offline


Posts: 14
Location: Belgium
Joined: Mar 18th, 2020
Re: SPIFFS data .bin file creation when compiling ?
Reply #4 - Aug 1st, 2020 at 9:37am
Print Post  
Hello,

You made my day  Smiley
Thanks a lot

Marc
  
Back to top
 
IP Logged
 
WoeperBe
Junior Member
**
Offline


Posts: 14
Location: Belgium
Joined: Mar 18th, 2020
Re: SPIFFS data .bin file creation when compiling ?
Reply #5 - Aug 1st, 2020 at 2:13pm
Print Post  
Hello,
Is there something similar that i could add to board.txt that after uploading the sketch allows me to also upload the spiffs file ?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: SPIFFS data .bin file creation when compiling ?
Reply #6 - Aug 1st, 2020 at 2:29pm
Print Post  
Is this what you need? 

"After build do same as clicking "vMicro>Publish Server Data Files" using the current COM port or IP address (OTA) from the uploader settings"

« Last Edit: Aug 1st, 2020 at 2:29pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
WoeperBe
Junior Member
**
Offline


Posts: 14
Location: Belgium
Joined: Mar 18th, 2020
Re: SPIFFS data .bin file creation when compiling ?
Reply #7 - Aug 1st, 2020 at 2:33pm
Print Post  
Will this work when i click on the Upload button ?
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
WoeperBe
Junior Member
**
Offline


Posts: 14
Location: Belgium
Joined: Mar 18th, 2020
Re: SPIFFS data .bin file creation when compiling ?
Reply #8 - Aug 1st, 2020 at 2:43pm
Print Post  
To be more clear:
With the compile button i have now the both .bin files created where i want them.
Now i would like when i click on the upload button the sketch is uploaded as it does but i would like to add there the SPIFFS .bin file upload ...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: SPIFFS data .bin file creation when compiling ?
Reply #9 - Aug 1st, 2020 at 2:59pm
Print Post  
1)
Can you explain why you needed the bin created prior to upload? The standard "vMicro>Upload Server Data Files" creates the bin and then does the upload at the same time. It would help to understand why you need the task split into two parts.

2) General Info

You can add any pre or post build and upload events that you want. If you switch on vMicro>Compiler>Verbose, vMicro>Compiler>Show build properties and vMicro>Uploader>Verbose you will see all the available build/upload properties when you perform the various tasks. All the properties that show for each task (build or upload) can be used to make up event hooks.

recipe.hooks.prebuild
recipe.hooks.postbuild
recipe.hooks.preupload
recipe.hooks.postupload

nb:

Events support multiple hooks. That is why my previous postbuild example is suffixed with ".1.pattern". This means you could add ".2.pattern" if needed but you might only need .1

A top tip is to look at the build properties and verbose output to see if your selected toolchain already uses any of the events. I think teensy is the only one that currently uses the postbuild. I don't recall another tool chain that uses any of the "post" events. If a tool chain does use an event yours will probably need to be ".2"






  
Back to top
WWW  
IP Logged
 
WoeperBe
Junior Member
**
Offline


Posts: 14
Location: Belgium
Joined: Mar 18th, 2020
Re: SPIFFS data .bin file creation when compiling ?
Reply #10 - Aug 1st, 2020 at 6:50pm
Print Post  
Hello,
Answer to 1.
I compile both the sketch and spiffs .bin files 
Then i have a homemade program to upload this files to a webserver for httpupdate usage
Afterwards i can if i like upload locally to one or more modules by selecting the IP address and clicking the upload button.
Here i needed that the spiffs .bin is every time uploaded at the same time .

Answer to 2.
This answer gives me all what i need to make my preferences possible Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: SPIFFS data .bin file creation when compiling ?
Reply #11 - Aug 1st, 2020 at 7:06pm
Print Post  
That sounds like an amazing OTA mode Smiley Interesting thanks
  
Back to top
WWW  
IP Logged
 
WoeperBe
Junior Member
**
Offline


Posts: 14
Location: Belgium
Joined: Mar 18th, 2020
Re: SPIFFS data .bin file creation when compiling ?
Reply #12 - Aug 2nd, 2020 at 7:56am
Print Post  
Hello,
I have one more question : I now need to put the ipaddress i selected into the  command i put behind recipe.hooks.postupload to upload the spiffs file
  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: SPIFFS data .bin file creation when compiling ?
Reply #13 - Aug 2nd, 2020 at 9:24am
Print Post  
If you click the Upload server data files menu item it will show the params
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint