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) Post upload execution batch file (Read 7636 times)
Sylvain
Junior Member
**
Offline


Posts: 67
Location: Montreal, Canada
Joined: Nov 13th, 2014
Post upload execution batch file
Mar 15th, 2017 at 8:09pm
Print Post  
Hi,
   Is there a way to execure a command line batch file after ESPTOOL programming for (ESP8266) had finish?

Thanks for your time
Sylvain Bissonnette
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Post upload execution batch file
Reply #1 - Mar 16th, 2017 at 4:28pm
Print Post  
Yes you can use build actions but need to understand the arduino 3rd party hardware specification.

Take a look at pre and post build hooks

https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-speci...
  
Back to top
WWW  
IP Logged
 
Sylvain
Junior Member
**
Offline


Posts: 67
Location: Montreal, Canada
Joined: Nov 13th, 2014
Re: Post upload execution batch file
Reply #2 - Mar 17th, 2017 at 2:43pm
Print Post  
Hmmm it's complicated... Why the option in VS (post build) don't work?

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


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Post upload execution batch file
Reply #3 - Mar 17th, 2017 at 2:56pm
Print Post  
It will do when enough people have purchased or given 5 star reviews but right now it forces an Arduino compatible solution
  
Back to top
WWW  
IP Logged
 
Sylvain
Junior Member
**
Offline


Posts: 67
Location: Montreal, Canada
Joined: Nov 13th, 2014
Re: Post upload execution batch file
Reply #4 - Mar 17th, 2017 at 3:10pm
Print Post  
Can I buy twice, and where I can give you 10 stars,  Your work is fantastic,  users must contribute for your work, your continual support, and development.  I'm a programmer and it's easy to see how many work and effort you put in this peace of art.

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


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Post upload execution batch file
Reply #5 - Mar 17th, 2017 at 3:20pm
Print Post  
Thanks that's nice to hear. It takes a lot of time and doesn't get much support from reviewers. You have done more than enough, vs build events are on the road map which has only be delayed by continual changes to the build spec by arduino.cc. Yes good changes but hopefully now they have stabilised so we can get back to nice features instead of build issues  Smiley

I also need to work out how to make more people buy (don't buy again Smiley ). Most people use the software and forum free I had hoped this would spawn lots of reviews but it seems that I am naive  Smiley I am re-looking at how I can deliver quality software to people like you who support this project and how to avoid the rest.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Post upload execution batch file
Reply #6 - Mar 17th, 2017 at 4:00pm
Print Post  
I forgot to say that as a paid user you can create a local board.txt file with the action/hook

It's still the same format as published by arduino but being able to experiment with a local board.txt in the project can make life easier.

Don't forget to switch on "vmicro>compiler>show build properties" and "verbose" so you can see some examples and the available properties such as {build_path} location
  
Back to top
WWW  
IP Logged
 
Sylvain
Junior Member
**
Offline


Posts: 67
Location: Montreal, Canada
Joined: Nov 13th, 2014
Re: Post upload execution batch file
Reply #7 - Mar 18th, 2017 at 1:32pm
Print Post  
Ok I check that,  I buy a second VM,  take this for a donation.

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


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Post upload execution batch file
Reply #8 - Mar 18th, 2017 at 11:26pm
Print Post  
Thanks, you didn't have to do that.

I looked into the "hooks" and there were none for upload events so if you need them they are in the build here.

download

Example: paste the following into a board.txt that can be created via the Visual Micro "Add Code" menu. This examples gives a few useful properties. Switch on vMicro>Compiler>Verbose to see and "Show Build Properties" to see other property_name= {variables}

these hooks are just examples and will produce error outputs
Code
Select All
# project build property overrides (board.txt)
#

# before upload event - example
recipe.hooks.deploy.preupload.pattern=cmd.exe /c "c:\hooks_test\test_pre.bat" "{build.path}"  "{build.project_name}" "{build.project_path}"

# upload failed event - example
recipe.hooks.deploy.errorupload.pattern=cmd.exe /c "c:\hooks_test\test_error.bat" "{build.path}"  "{build.project_name}" "{build.project_path}"

# upload complete event - example
recipe.hooks.deploy.postupload.pattern=cmd.exe /c "c:\hooks_test\test_post.bat" "{build.path}"  "{build.project_name}" "{build.project_path}" 

« Last Edit: Mar 20th, 2017 at 12:35pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Sylvain
Junior Member
**
Offline


Posts: 67
Location: Montreal, Canada
Joined: Nov 13th, 2014
Re: Post upload execution batch file
Reply #9 - Mar 20th, 2017 at 2:27am
Print Post  
Hey thanks it work fine,  juste take note that no space can me in the path.

Thanks Again
Sylvain Bissonnette
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Post upload execution batch file
Reply #10 - Mar 20th, 2017 at 12:34pm
Print Post  
Did you have a problem with spaces in paths when the entire path was surrounded with double quotes?

My example was missing the closing quote on "{build.path}" so that would have been an issue with spaces.
« Last Edit: Mar 20th, 2017 at 12:36pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Mariusz
Newbies
*
Offline


Posts: 3
Joined: Feb 28th, 2018
Re: Post upload execution batch file
Reply #11 - Feb 28th, 2018 at 9:43am
Print Post  
Hello!

I'm trying to execute upload hooks using board.txt file but
I'm experiencing problems with the last hook on the list.

The "postupload" event seems not to be executed after successful upload.

I've tried using different boards (UNO/DUE), but still the problem remains.
Do you have any clues? Could you help a bit?

Best regards,
Mariusz

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


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Post upload execution batch file
Reply #12 - Mar 3rd, 2018 at 3:13pm
Print Post  
Thanks for the post.

For some reason the postupload event was only implemented after programmer upload.

In the next release of visual micro (few days) the postupload is also executed after standard upload.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint