Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
SPIFFS data .bin file creation when compiling ? (Read 224 times)
WoeperBe
Junior Member
**
Offline



Posts: 12
SPIFFS data .bin file creation when compiling ?
Jul 30th, 2020 at 6:15pm
 
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
Back to top
« Last Edit: Jul 30th, 2020 at 6:16pm by WoeperBe »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10753
United Kingdom
Re: SPIFFS data .bin file creation when compiling ?
Reply #1 - Jul 30th, 2020 at 6:26pm
 
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: 12
Re: SPIFFS data .bin file creation when compiling ?
Reply #2 - Jul 30th, 2020 at 6:46pm
 
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
 
Visual Micro
Administrator
*****
Offline



Posts: 10753
United Kingdom
Re: SPIFFS data .bin file creation when compiling ?
Reply #3 - Jul 30th, 2020 at 8:16pm
 
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:
# ESP8266 post build spiffs creation
#

# Use build folder -build.path="{build.path}"
# recipe.hooks.postbuild.1.pattern="{vm.platform.root.path}/../../ESP8266FSUpload.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
recipe.hooks.postbuild.1.pattern="{vm.platform.root.path}/../../ESP8266FSUpload.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
#
# recipe.hooks.postbuild.1.pattern="{vm.platform.root.path}/../../ESP32FSUpload.exe" -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}
 

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



Posts: 12
Re: SPIFFS data .bin file creation when compiling ?
Reply #4 - Aug 1st, 2020 at 10:37am
 
Hello,

You made my day  Smiley
Thanks a lot

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



Posts: 12
Re: SPIFFS data .bin file creation when compiling ?
Reply #5 - Aug 1st, 2020 at 3:13pm
 
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
 
Visual Micro
Administrator
*****
Offline



Posts: 10753
United Kingdom
Re: SPIFFS data .bin file creation when compiling ?
Reply #6 - Aug 1st, 2020 at 3:29pm
 
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"

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



Posts: 12
Re: SPIFFS data .bin file creation when compiling ?
Reply #7 - Aug 1st, 2020 at 3:33pm
 
Will this work when i click on the Upload button ?
Back to top
 

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



Posts: 12
Re: SPIFFS data .bin file creation when compiling ?
Reply #8 - Aug 1st, 2020 at 3:43pm
 
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
 
Visual Micro
Administrator
*****
Offline



Posts: 10753
United Kingdom
Re: SPIFFS data .bin file creation when compiling ?
Reply #9 - Aug 1st, 2020 at 3:59pm
 
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: 12
Re: SPIFFS data .bin file creation when compiling ?
Reply #10 - Aug 1st, 2020 at 7:50pm
 
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
 
Visual Micro
Administrator
*****
Offline



Posts: 10753
United Kingdom
Re: SPIFFS data .bin file creation when compiling ?
Reply #11 - Aug 1st, 2020 at 8:06pm
 
That sounds like an amazing OTA mode Smiley Interesting thanks
Back to top
 
WWW  
IP Logged
 
WoeperBe
Junior Member
**
Offline



Posts: 12
Re: SPIFFS data .bin file creation when compiling ?
Reply #12 - Aug 2nd, 2020 at 8:56am
 
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
Back to top
 

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



Posts: 10753
United Kingdom
Re: SPIFFS data .bin file creation when compiling ?
Reply #13 - Aug 2nd, 2020 at 10:24am
 
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 Topic Print