I am working through your Build_Web_Servers_ESP32_ESP8266 ebook.
I have installed the software, and with an ESP32 connected got the flashing LED example working ok.
But after adding the library for the BME280 sensor I get this build error ( no code changes to the blinking LED example ) :
*** [.pio\build\fm-devkit\libcf6\Adafruit BME280 Library\Adafruit_BME280.cpp.o] Error 1
Removing the line – lib_deps = Adafruit BME280 Library @ 2.1.2 – from platformio.ini which got added when I added the library returns a build success.
If I go to PIO Home / Libraries / Installed I cann see the BME280 library entry.
Any suggestions welcome !
I dont understand why adding a library, withoutchanging any code , should cause a build failure?
Are you following the blinking LED project?
You don’t need to include those libraries on the platformio.ini file. Otherwise you’ll get an error because those libraries are not being used.
Delete any library that you have added to the platformio.ini file and the code should compile. Just include libraries that are used in your code.
Yes I have completed the blinking LED project , and am moving onto the next project.
The next step in the book is to install the BME208 library , linking it during install to the blinking LED project.
Having done this the blinking LED project stops building – is this correct ?
At this time no code is accessing the library , that gets added in subsequent steps.
Are you saying it wont build until code is added to the project which accesses the library just added ?
You are telling PIO that your code depends on this library when it doesn’t. Just add the line:
And you should be good to go.
After the blinking LED project, we’re just showing how to add libraries if necessary, and we give an example on how to do it.
You’re not supposed to run the blinking LED project with the BME280 library. Just add the library when you use it in your code.
I hope this is clear.
Let me know if you have more doubts.