I’m quite new to PlatformIO and VSCode, although have quite a bit of experience with coding. I am however stumped as to why VSCode seems to think my libraries do not exist.
My code works fine with the IDE, so its just a PlatformIO/VSCode setup issue.
I’ve setup a Wemos D1 Mini project with my ini file looking like so:
That’s what I would have expected to happen. To be honest, I hadn’t tried installing a library via PIO home that way before… I always just put the lib_deps entries in manually. It seems pretty pointless to have the project install option though if it a) doesn’t add to the lib_deps entry and b) doesn’t install the library to the project library cache folder.
I believe using PIO Home to install project library should just save it to the {projectname}\.pio\libdeps\esp01_1m\{libraryname} folder (if it was working) which will then be automatically included. No need to add it to lib_deps. lib_deps is used to automatically grab the library for you.
Yup, that’s what I expected also. I still would have liked it to have an option to add to the lib_deps automatically, as that saves the need to manual install to project if you’ve moved to a different computer, etc, either way, it’s currently not doing the core job of actually installing to the right place!
lol… true… thanks for reminding me of that… I forgot that option was added… mainly since I ‘install’ libraries via the lib_deps entry. I was thinking more along the lines of a checkbox in the GUI for when installing that way.
This is a known bug and was fixed in the latest PlatformIO Core 4.2.2-dev version. Please switch to development version of PIO Core => Redirecting...platformio-ide.useDevelopmentPIOCore: true or use lib_deps as described above.
Hi, I’m not sure if it is related, but I try since several days to get the include of a library working.
it works in espidf mode but not in arduino mode:
here the ini file:
pio lib list
Library Storage: XXXXX/Documents/PlatformIO/Projects/test3/.pio/libdeps/wemos_d1_mini32
esp32-owb
=========
ESP32-compatible C component for the Maxim Integrated 1-Wire protocol.
Version: 0.1
Keywords: onewire, 1-wire, bus, sensor, temperature
Compatible frameworks: espidf
Compatible platforms: espressif32
Authors: David Antliff, Chris Morgan
main.cpp:
#include <Arduino.h>
#include "owb.h"
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Processing wemos_d1_mini32 (platform: espressif32; board: wemos_d1_mini32; framework: arduino)
-----------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/wemos_d1_mini32.html
PLATFORM: Espressif 32 (3.1.0) > WeMos D1 MINI ESP32
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 3.10005.210308 (1.0.5)
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 31 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/wemos_d1_mini32/src/main.cpp.o
Compiling .pio/build/wemos_d1_mini32/FrameworkArduino/Print.cpp.o
Compiling .pio/build/wemos_d1_mini32/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/wemos_d1_mini32/FrameworkArduino/StreamString.cpp.o
src/main.cpp:3:17: fatal error: owb.h: No such file or directory
The library declares only compatibiility with the ESPIDF framework.
Since you’re trying to use it with framework = arduino, PlatformIO rejects it as incompatible.
You can try to ignore the incompatibility by setting lib_compat_mode = off in the platformio.ini, but this is not guranteed to work if the code is truly incompatible especially if it’s written against an ESP-IDF version that is different than the one used in Arduino-ESP32.