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
Normal Topic ESP8266 build code and server file (littleFs) and copy to directory (Read 1069 times)
Acuario
Full Member
***
Offline


Posts: 233
Location: Spain
Joined: Aug 28th, 2015
ESP8266 build code and server file (littleFs) and copy to directory
Jul 31st, 2021 at 10:58am
Print Post  
The following may be of use to anyone that wants to build both their project and the server data file (littleFs) with one click and then have them both copied to a directory so they are together in one place.

1. In your project create a file called copyme.bat
2. Paste the following code into the copyme.bat file

Code
Select All
@echo off
setlocal enableextensions EnableDelayedExpansion

set from=%1
set dest=%2
set name=%~n5
del %dest%%name%.bin

set mkspiffs=%3
set spiffsdir=%4
set /A spiffstart=%6%
set /A spiffend=%7
set spiffBlock=%8%

set /A spiffSize=spiffend-spiffstart

%mkspiffs%\mklittlefs -c %spiffsdir% -p 256 -b %spiffBlock% -s %spiffSize% %dest%%name%.spiffs.bin

copy %from% %dest%%name%.bin

 



3. Add the following line in your board.txt file

Code
Select All
recipe.hooks.postbuild.1.pattern=cmd.exe /c {build.project_path}\copyme.bat {build.path}\{build.project_name}.bin {build.project_path}\php\bin\ {runtime.tools.mklittlefs.path} {build.project_path}\data {build.project_name} {build.spiffs_start} {build.spiffs_end} {build.spiffs_blocksize}
 



The highlighted text is the directory where you want the output files to be copied to. Change this for your needs.

At the end of the build the server data files will automatically be created with the correct settings from VM.
Unlike the 'Publish' button (which creates the data file and then uploads it) this does NOT upload the file.
I'm not sure if VM has an option to just build the data file without uploading it..

Hope this helps someone. 
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint