Hello from a new user!
Thank you for providing this magnificant IDE!
It would be very helpful, if someone could give a hint for my two problems/questions:
Problem A:
Prliminary:
What do I want to achieve:
Merge two platformio projects to one project WHILE building.
Why:
I have one project with a comprehensive Webserver (call it WSP) which provides
everything for a Webserver Application. HTML-Page to provide SSID/PW,
HTML.Page for System-Services, About-Page, Callbacks for received Websocket
or Ajax packets and so on …
(I can build this project in the WS project structure for its own, even
if its useless because it does not have any application code. But for testing …)
The application functions (for several of my independant PIO projects) then come
with the second (Application-) project (I call it now APP)
There I provide callbacks for the WSP (e.g. Appli_Init() which is called
in WSP at the end of setup() or Appli_loop() which is called in WSP at the
end of loop() and several more.
What I did until now:
Written a python script and included it via platformio.ini
extra_scripts =
pre:g:/Projekte/PIO/PIOPrePYMScada2.py
The script copies from WSP all *.cpp from /src and all *.h from /include
to the accordingly locations in APP.
When then the build starts everything is at its place and it works well.
But:
Works well … but not eloquent …
What did I to create a more eloquent solution:
Two or three weeks ago I’ve read from build_src_filter, that I did not
know before. Hey!
I provided a
build_src_filter =
+<>
+<…/MScadaWS2/src/.cpp>
in the APP platformio.ini (and scratched the pre extra_script) and after that,
the *.cpp sources where included in the build without copying! Perfect!
And for the *.h I provided a build flag
build_flags =
-Ig:/Projekte/PIO/MScadaWS2/include
But this does not work. I get errors
In file included from G:/Projekte/PIO/MScadaWS2/src/93_MSCADAWS_WSHandler.cpp:8:
G:/Projekte/PIO/MScadaWS2/include/MSCADAWS_Export.h:51:17: fatal error: ESP32httpUpdate.h: No such file or directory
So the situation is as follows:
When I copy the *.h files in the APP project structure in /include
everything works.
If I have the same files not there, but via the build flag referenced from the WSP /include,the build does not find the referenced files out of the *.h files.
In the platformio.ini I have at the beginning:
[platformio]
default_envs = esp32S3-Base
lib_dir = c:\projekte\PIO\Libraries\Common
boards_dir = g:\projekte\PIO\Boards
So the lib_dir, that references the start of the library tree is there.
This is unchanged in the former solution (copy) and the new one (referencing)
But with referencing the library files are not found.
Where is my fault?
Problem B:
When, in the APP project, making a “Upload files system image”, that packs all
files from /data to a littlefs.bin I need as well all files from the WSP project.
With another pre-Script I copy all these files from WSP /data to APP /data. Works.
I have never seen a possibility to extend this path with a platfromio.ini
directive that says “Include all files from XYZ when making Upload files system image”
Does such a possibility exist?
Thank you very much for your help
Andree