PlatformIO Community

QUESTION: library.json - installing library dependencies dependent libraries

Hello. I’ve composed a library.json file for a library I’ve created targeting the ttgo-lora32-v1 board. Some of the libraries in my library have dependencies, specifically Wire, SPI, WiFi, HTTPClient, and WiFiClientSecure.

If I place these names in platformio.ini lib_dep section, build from scratch works. But I want install of my library to be automatic i.e. to only have to specify the name of my library in platformio.ini and for everything to install automatically.

I’m a bit hazy about what specifying the platform and board in platformio.ini does with regard to the platform libraries. I’m also hazy about how to specify dependencies’ dependencies if you only know their name i.e. not where they are hosted or their version. But what ever is supposed to happen, these are not getting installed.

May I ask for some guidance on how to configure library.json when you don’t know the source or version of library dependencies own dependencies?

Thank you

I have the same problem…

If i define a dependency via library.json, for example

"dependencies": 
{
    "MQTT": "^2.4.7"
}

I get a compile error “fatal error: MQTT.h: No such file or directory”

When the dependency is defined via platformio.ini, it is installed correctly.
After it has been installed, the depencency can be removed from platformio.ini and everything is working fine. Also the dependency graph recognizes the correct dependency of the lib:

Dependency Graph
|-- <MyLib> 0.0.15
|   |-- <MQTT> 2.4.7

Before including the dependency into platformio.ini, it didn’t appear in the Dependency Graph…

What am I doing wrong?

Report bugs as fully-reprodicable samples in https://github.com/platformio/platformio-core.