Coder Social home page Coder Social logo

Comments (17)

ivankravets avatar ivankravets commented on May 30, 2024 1

Sorry, this is our bug and has been fixed in platformio/platformio-core#3658

We will release 5.0.1 tomorrow.

A temporary solurion is to switch to dev-version via pio upgrade --dev

from sensesp.

ba58smith avatar ba58smith commented on May 30, 2024

@wefleenor - please search your hard drive for a filed called Adafruit_Sensor.h. When I do that, I find it in a LOT of places. But I can't think of any reason it should work on the boat, but not at home. BTW, be careful with all of your research into this: there is a BME280 sensor, and a BMP280 sensor, and SensESP works with both, and has file names for both.
image

from sensesp.

ba58smith avatar ba58smith commented on May 30, 2024

Notice that it's down in the directory structure of each of my PlatformIO Projects, and also in /.platformio/lib/.... I'm guessing yours should be, too.

from sensesp.

wefleenor avatar wefleenor commented on May 30, 2024

from sensesp.

BjarneBitscrambler avatar BjarneBitscrambler commented on May 30, 2024

Hi Bill: It's a workaround, but here's how I managed to get builds to complete when I was faced with similar issues. After locating the *.h file the compiler is complaining about, put its directory into the compiler's search path using the following flag:

build_flags =
   -I/full/path/to/file/.platformio/packages/framework-arduinoespressif32/libraries/ESPmDNS/src

The build_flags = setting goes into your project's platformio.ini file, located anywhere inside the block corresponding to your target board. In your case it sounds like you are using a d1_mini, so put it below the [env:d1_mini] tag.

In my case it seemed that PlatformIO was having trouble with its library management. I observed multiple installs of the same library, wrong libraries, wrong versions, etc over a week-long period...it was tough on my hair. My compile errors eventually disappeared, after multiple times of uninstalling and reinstalling PIO, deleting the .pio folder within the project, and trying other solutions mentioned on the web. I'm still not sure why it finally fixed itself, but in the meantime, hopefully the above will get you going.

One interesting related behaviour I noticed about PIO that still persists is that its Library Manager seems to need a restart of PIO before it recognizes changes to a project's libraries. I can reproduce the problem on my setup by creating a new PIO project, and then browsing PIO Home->Libraries->Installed. In that tab, the new project is not listed until after I quit and restart PIO.

from sensesp.

ba58smith avatar ba58smith commented on May 30, 2024

After updating Python2 and Python3 on my computer today, I also started getting the error first reported in this Issue. I don't know how those updates could have had anything to do with it, but that is all I did (unless I unwittingly did something else during the Python updating - that was not a simple process).

UPDATE: The reason I updated Python was that PlatformIO wouldn't start the build process without doing a PIO Core update, which was failing because my Python versions were too old. As soon as I updated Python, then PIO updated its Core, and THAT'S what broke the library thing. See below.

I started by just adding the library with the missing .h file (Adafruit_Sensor.h) to library.json. That resolved that compiler error, but gave me another very similar one - also about an Adafruit .h file. So I added THAT library to library.json, which resolved that error, and gave another, and another. I eventually added all of these to library.json:
Adafruit Unified Sensor
Adafruit BusIO
Adafruit Sensor Calibration
Adafruit FXAS21002C
Adafruit FXOS8700

I know that PIO is supposed to be smart enough to pull in any library that's required, but it doesn't seem to be doing that. @mairas, is it a bad idea to add these libraries to library.json? Does it make the firmware bigger than it needs to be?

I believe that all of these libraries are new to SensESP with PR #145 , adding the Magnetometer sensor. Could there be a problem with the way some libraries were included in those new files? Maybe all of the missing .h files should just be added to that one new sensor's .h file?

There was one missing .h file that the above approach didn't resolve: EEPROM.h - because I didn't find an Adafruit EEPROM library. (The EEPROM.h that it was complaining about was being called from an Adafruit header, which is why I wanted to find an Adafruit library that included it.) I ended up doing what Ivan Kravets, creator of PlatformIO, said to do in this forum answer: add #include <EEPROM.h> to main.cpp. It worked. https://community.platformio.org/t/eeprom-h-no-such-file-or-directory/626

from sensesp.

mairas avatar mairas commented on May 30, 2024

I started by just adding the library with the missing .h file (Adafruit_Sensor.h) to library.json. That resolved that compiler error, but gave me another very similar one - also about an Adafruit .h file. So I added THAT library to library.json, which resolved that error, and gave another, and another. I eventually added all of these to library.json:
Adafruit Unified Sensor
Adafruit BusIO
Adafruit Sensor Calibration
Adafruit FXAS21002C
Adafruit FXOS8700

I know that PIO is supposed to be smart enough to pull in any library that's required, but it doesn't seem to be doing that. @mairas, is it a bad idea to add these libraries to library.json? Does it make the firmware bigger than it needs to be?

Ideally it'd be better to let PIO resolve the dependencies but if it can't do that, it's not too harmful if they're added. It's just that if any of those explicit dependencies turn out to be unneeded, it'll be unnecessarily downloaded and built. I don't think they'd be linked in the binary if they're not used, so the firmware size shouldn't be affected.

Anyway, I wanted to see what these build problems were all about and pulled the latest commits and deleted the .pio directory just for kicks and BAM, everything went haywire. For some reason PIO doesn't seem to be downloading the dependencies. This needs some investigation...

from sensesp.

mairas avatar mairas commented on May 30, 2024

PlatformIO 5.0.0 was released on 2020-09-03 and got automatically updated at least for me. I bet it introduced some incompatibility. I'll dig into the issue properly tomorrow.

from sensesp.

mairas avatar mairas commented on May 30, 2024

This sounds similar to our issue: https://community.platformio.org/t/dependencies-from-private-lib-disappear-after-upgrading-to-core-5-0-0/15720

from sensesp.

mairas avatar mairas commented on May 30, 2024

OK, tried downgrading platformio:

.platformio/penv/bin/pip install platformio==4.3.4

A new build successfully uses pio 4.3.4 but results in the same failure. So it doesn't seem to be due to PIO 5.0.0.

from sensesp.

doubledutch2 avatar doubledutch2 commented on May 30, 2024

I had some issues installing PIO on my a new machine yesterday and the guys from Platform IO provided brilliant support to get it resolved (don't let Time Machine try to move VSC / PIO basically as it breaks all sorts of stuff).

I've pointed them into the direction of this issue so maybe they can provide some guidance.

from sensesp.

ivankravets avatar ivankravets commented on May 30, 2024

Please file an issue at https://github.com/platformio/platformio-core and provide a simple project to reproduce this issue.

See https://docs.platformio.org/en/latest/core/history.html

Automatically enable LDF dependency chain+ mode (evaluates C/C++ Preprocessor conditional syntax) for Arduino library when “library.property” has “depends” field (issue #3607)

It was a bug in whole PIO Core 4.

from sensesp.

ba58smith avatar ba58smith commented on May 30, 2024

Thank you, @ivankravets !!!

from sensesp.

ba58smith avatar ba58smith commented on May 30, 2024

UPDATE: Version 5.0.1 of PIO doesn't seem to fix the problem - maybe for a few people, but not everyone (me included). Currently, the "fix" seems to be to include several more Adafruit libraries in the SensESP library.json, (PR # 161), which solves all but one compiler error: "Can't find <EEPROM.h>". That can be worked around by adding #include <EEPROM.h> in your main.cpp.

from sensesp.

BjarneBitscrambler avatar BjarneBitscrambler commented on May 30, 2024

Just a note that another workaround for the missing EEPROM library (and any other libraries that fail to get automatically loaded) is to list them in platformio.ini under lib_deps =. This might be preferred over the option of changing source code.

from sensesp.

GaryWSmith avatar GaryWSmith commented on May 30, 2024

I recently installed vscode and pio for the first time and immediately began having issues with dependencies.
I'm on the latest version of pio - 5.0.1. Ubuntu 18.04
The problem is very inconsistent but I've never managed to get a clean build first time round using the library - https://github.com/SignalK/SensESP.git

The workaround for me also has been to add additional dependencies to lib_deps such as ESP Async Webserver and others as required.

from sensesp.

mairas avatar mairas commented on May 30, 2024

This issue seems to be an aggregate of multiple individual bugs. There’s a temporary fix in place, provided by PR#170 and SensESP has been verified to build just fine. The remaining SensESP and PIO issues are tracked in #168 and platformio/platformio-core#3668, respectively. Closing.

from sensesp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.