How to debug library dependency installation

I am trying to develop a library that works with both ESP32 and ESP8266. The dependencies are different for the two builds.

For ESP8266, the dependencies are:
AsyncMqttClient = 0.8.1
ESPAsyncTCP

For ESP32 the dependencies are:
AsyncMqttClient=GitHub - marvinroger/async-mqtt-client: đŸ“¶ An Arduino for ESP8266 asynchronous MQTT client implementation
AsyncTCP

my libraries library.json contains:
“dependencies”: [
{
“name”: “ESPAsyncTCP”,
“version”: “^1.1.3”,
“platforms”: “espressif8266”
},
{
“name”: “AsyncMqttClient”,
“version”: “^0.8.1”,
“platforms”: “espressif8266”
},
{
“name”: “AsyncTCP”,
“platforms”: “espressif32”
},
{
“name”: “AsyncMqttClient”,
“version”: “GitHub - marvinroger/async-mqtt-client: đŸ“¶ An Arduino for ESP8266 asynchronous MQTT client implementation”,
“platforms”: “espressif32”
}
]

But when I try to build on ESP32, I see that both AsyncTCP and ESPAsyncTCP getn installed in .piolibdeps, and the build tries to compile ESPAsyncTCP which is not compatible with the ESP32.

I am trying to figure out how to debug the dependency handling code so I can figure out why ESPAsyncTCP keeps getting installed.

Do you use the latest PIO Core 3.5.0RC?

AsyncTCP IS compatible with ESP32, where ESPAsyncTCP IS NOT compatible

Thanks, switching to platformio 3.5.0RC does help things a lot.

Also, sorry for the typo. I meant that pio tries to compile EspAsyncTCP as well as AsyncTCP for the ESP32 platform.

Now I can build both for the ESP32 and ESP8266 as long as I delete .piolibdeps 1st.
If I don’t do so, and I compile for esp32 platform 1st, then when I go to compile for esp8266, I get an error trying to compile ‘Ticker-esp32’

My dependencies includes:
{
“name”: “Ticker-esp32”,
“platforms”: “espressif32”
},

which should only apply to esp32.

The error looks like:

[Fri Dec 15 15:31:16 2017] Processing nossl (platform: https://github.com/platformio/platform-espressif8266.git#feature/stage; lib_deps: ESP8266MQTTMesh; board: esp01_1m; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------
LibraryManager: Installing id=1747
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%
Verbose mode can be enabled via `-v, --verbose` option
Converting ESP8266MeshHelloWorld.ino
Collected 38 compatible libraries
Looking for dependencies...
Library Dependency Graph ( http://bit.ly/configure-pio-ldf )
|-- <ESP8266MQTTMesh> v0.8.8
|   |-- <ESPAsyncTCP> v1.1.3
|   |   |-- <ESP8266WiFi> v1.0
|   |-- <AsyncMqttClient> v0.8.1
|   |   |-- <ESPAsyncTCP> v1.1.3
|   |   |   |-- <ESP8266WiFi> v1.0
|   |-- <Ticker-esp32> v1.0.0
|   |-- <ESP8266WiFi> v1.0
|   |-- <Ticker> v1.0
Compiling .pioenvs/nossl/src/ESP8266MeshHelloWorld.ino.o
Archiving .pioenvs/nossl/lib/libAsyncMqttClient.a
Compiling .pioenvs/nossl/lib/Ticker-esp32_ID1938/ESP32Ticker.o
In file included from .piolibdeps/Ticker-esp32_ID1938/src/ESP32Ticker.cpp:25:0:
.piolibdeps/Ticker-esp32_ID1938/src/ESP32Ticker.h:28:32: fatal error: freertos/FreeRTOS.h: No such file or directory
#include "freertos/FreeRTOS.h"
^

I don’t know if it is expected behavior that I need to delete .piolibdeps when changing platforms or not.

We need

Thanks, but I’d really like to learn how to fish here. How do I go about debugging an issue like this?

  1. Please run pio update
  2. Remove .piolibdeps folder from a project
  3. Start build again.

Does it work now?

P.S: Library has been updated in Registry but a version was not changed. You need to remove existing version from your machine.

Yes it is now fixed, but I am still in the dark about how I can debug future dependency related issues without resorting to message boards. This has been my biggest frustration with platformio. When it works, it is really great. When it doesn’t work, I have a lot of difficulty finding any information on how to proceed.

You can manually control Library Dependency Finder (LDF) — PlatformIO latest documentation

[env:board]
...
lib_compat_mode = 2