I’ve been trying to add a library to my ep=sp-idf project (PubSubClient) in the simplest possible way without installing it with pio IDE. What I’m essentially doing is placing the PubSubClient folder with both sourcer files (.h and .cpp) inside the /lib folder of the pio project and including it in my main.cpp.
Always build the project once and look for compiler errors before you believe VSCode’s crying "oh no can’t find header file ". IntelliSense is updated after the build or with an explicit request.
I’m not sure what you mean by always building the project first, the error occurs precisely when trying to build it, right? Please let me know if my understanding is correct.
I’ll try do rebuild IntelliSense and post the result down below.
Edit1: After rebuilding IntelliSense index it still can’t find the header files, for now it seems to only find it when I place the file inside the include folder.
Edit2: After changing the platformio.ini lib_compat_mode to off it did recognize the PubSubClient as a lib, which does not have a manifest.json, I will further investigate if any other libs in my project ‘state’ that they are incompatible with PubSubClient.
The full project is in a devops repo, but I cannot disclose it fully due to it being proprietary source code, however, I can share the public libraries I intend to add to it, which are:
I believe most if not all of these are ‘standard’ Arduino libraries, that I’m adding to a ESP-IDF project using Arduino as a component.
One issue I can see is that esp_http_client idf component conflicts with some Wi-Fi/internet libraries from Arduino, I think I should open a new topic for that.
Edit3: The problem seems a little bit clearer now, it seems to be a difference on how the number that corresponds to the HTTP method is represented, not sure on how to solve it though, the image below shows the error:
I know this is far from an ideal solution, but the plan now is to replace ESPAsyncWebServer.h HTTP methods for HTTPESP methods, for example, use some find and replace commands to change HTTP_GET to HTTP_GETESP just as a proof of concept, I will do that and post the results later.