Library management : choose a specific version in platformio.ini

Hello,
I’m trying to use platformio for the first time so the answer might be obvious (sorry if it is)
I couldn’t find a way to tell what version of a lib I’d like to use when setting lib dependency inside the file platformio.ini.

First, I found the option (–version) when you use the command line to install a lib. That’s fine when you, a human, are doing things.
But CI (Travis) is meant to use
pio run
In this case I found that I can specify my project dependencies inside the platformio.ini file.
Sounds great to me. So I ended with this :
[env:nodemcuv2] platform = espressif framework = arduino board = nodemcuv2 lib_install = 16,166

I tried to build and it failed … because one of the lib changed (compared to the version I had locally when I used Arduino IDE).

So is there a way to specify the version for each lib I depend on?
Something like :
lib_install = 16-0.5.0,166-1.0.1

Thank you for the help

From what I know, there is no way to specify a dependency version in platformio.ini yet. You can, however, configure Travis to run pio lib install --version ... during its install step. Your .travis.yml may look like this:

install:
  - pip install -U platformio
  - platformio lib install 16 --version=0.5.0
  - platformio lib install 166 --version=1.0.1
1 Like

Thank you for the answer
I hoped for a ‘built in’ solution but I’ll follow this Travis scripting way

See Redirecting...