PlatformIO Community

Include multiple folders in library.json

Hello all,

I’ve been trying to do baby steps towards building AWS’s mqtt mutual auth demo with platformio, and I am having issues with telling where to find the header files needed for compiling.

My code is empty since the intention is just to build the most basic possible with the right libraries, so my platformio.ini looks like such:

[env:esp32dev]

platform = espressif32@1.11.2

framework = arduino, espidf

build_flags =

-D CONFIG_BLINK_GPIO=2

monitor_speed = 115200

platform_packages = platform_packages = framework-arduinoespressif32 @ https://github.com/marcovannoord/arduino-esp32.git#idf-release/v4.0

board = esp32dev

and my library.json looks like such:

“build”: {

  "srcDir": "source",

  "includeDir": "include"

}

I’m getting the following warning “Warning! Ignoring broken library manifest in C:\Users\Gustavo Fernandes\Documents\PlatformIO\Projects\mqtt-teste-gk\lib\logging”

and then the error “In file included from src/mqtt_demo_mutual_auth.c:54:0:**
**lib/config_files/mqtt_demo_mutual_auth_config.h:41:28: fatal error: logging_levels.h: No such file or directory”

I’d like to know what should I change in the library.json file in order to make the compiler find the logging_levels.h file, which by the way is located in the logging lib inside the project.

pio_4

Thanks in advance.

The screenshot shows the “Warning Ignoring broken library manifest…” already. The library.json is not complete, the entire file must describe one JSON object, but you’re missing the high-level {} braces. So, the entire manifest file is ignored and your options are not applied.

{
  "build" : { ..... },
  "other_stuff": ....
}

Also you should at least have a name, version, frameworks and platforms field in the manifest.

1 Like

Hello @maxgerhardt ,

Thanks for the fast response!

Adding the outer braces and also name, version, frameworks and platforms in the manifest solved the problem :smiley:

The resulting library.json file is now:

{

“build”: {

  "name": "logging",

  "version": "1.0.0",

  "frameworks": ["espidf", "arduino"],

  "platforms": ["espressif32"],

  "srcDir": "source",

  "includeDir": "include"

}

}

What happened after that may not be direclty related, but still quite interesting since it’s a library coming direclty from pio.

First I noticed the “.h” was missing from the string library include (it was #include instead of #include <string.h>), then, when I changed it the following happened:

pio_5

Any clues on what happened?

Thanks.

Your mqtt_demo_mutual_auth.c is including FreeRTOS.h which is somehow… found in the BLE Arduino library (this already looks weird) and it has class definitions for C++ code – so including this header file in a C file will result in that error. Are you using BLE? If not not try lib_ignore = BLE in the platformio.ini or get rid of the Arduino+ESP-IDF and only do ESP-IDF.

As for the aws_demo.h file not being found, I don’t know where in the project that is for you but it’s not in one of the included paths (include/, on of the libraries, etc)

1 Like

Hello @maxgerhardt ,

I am trying to run the coreMQTT AWS demo, so there is no need for BLE, I followed your suggestion and lib_ignore = BLE did not work :frowning: .

I tried only ESP-IDF and then I got really confused on this ‘porting’ from AmazonFreeRTOS to ‘classic’ FreeRTOS.

I’ve seen you have a very active participation on this topic and many members tried to do this, this being to download from AmazonFreeRTOS console a pack of libraries and some demos and try to build it inside platformio. I have also seen there’s some discussion about amazon’s using kernel v10 and platformio using v8.4 kernel, are there any updates on that issue?

I will keep trying to build the coreMQTT demo using only esp-idf, but I’m afraid I’ll need to add the Arduino framework later on.

Thanks in advance.