exxamalte / esphome-customisations

ESPHome customisations.
Apache License 2.0
20 stars 8 forks source link

fatal error: Adafruit_I2CDevice.h: No such file or directory #2

Closed duojianghuji closed 2 years ago

duojianghuji commented 2 years ago

Hi, I tried to follow your instructions, but something wrong happened. it shows "Adafruit_I2CDevice.h: No such file or directory" It has been a long since I have been stuck in. Can you help to tackle it? I'm running the ESPHome version(2021.12.4) image

exxamalte commented 2 years ago

Thanks for reporting this. I can confirm that I can reproduce this issue. Just to make sure the error message is searcheable, here is the output

Compiling .pioenvs/esp-43-fireplace/src/main.cpp.o
Generating LD script .pioenvs/esp-43-fireplace/ld/local.eagle.app.v6.common.ld
Compiling .pioenvs/esp-43-fireplace/lib0cb/ESPAsyncTCP-esphome/AsyncPrinter.cpp.o
Compiling .pioenvs/esp-43-fireplace/lib0cb/ESPAsyncTCP-esphome/ESPAsyncTCP.cpp.o
In file included from src/mlx90614_sensor.h:3:0,
                 from src/main.cpp:46:
.piolibdeps/esp-43-fireplace/Adafruit MLX90614 Library/Adafruit_MLX90614.h:18:32: fatal error: Adafruit_I2CDevice.h: No such file or directory

****************************************************************************
* Looking for Adafruit_I2CDevice.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:Adafruit_I2CDevice.h"
* Web  > https://platformio.org/lib/search?query=header:Adafruit_I2CDevice.h
*
****************************************************************************

 #include <Adafruit_I2CDevice.h>
                                ^
compilation terminated.
*** [.pioenvs/esp-43-fireplace/src/main.cpp.o] Error 1
======================================================================================================= [FAILED] Took 14.49 seconds ================
exxamalte commented 2 years ago

It seems as if more libraries need to be defined explicitly for the custom component to compile. On top of that a specific version of BusIO appears to be needed.

Can you please try the following configuration:

esphome:
  ...
  includes:
    - "custom_components/mlx90614_sensor.h"
  libraries:
    - SPI
    - Wire
    - adafruit/Adafruit BusIO @ 1.9.6
    - "Adafruit MLX90614 Library"
duojianghuji commented 2 years ago

Yes, it's working perfectly after adding more libraries. Thanks a lot!

jkeys1989 commented 1 year ago

It seems as if more libraries need to be defined explicitly for the custom component to compile. On top of that a specific version of BusIO appears to be needed.

Can you please try the following configuration:

esphome:
  ...
  includes:
    - "custom_components/mlx90614_sensor.h"
  libraries:
    - SPI
    - Wire
    - adafruit/Adafruit BusIO @ 1.9.6
    - "Adafruit MLX90614 Library"

This worked! Thanks.

zandiarash commented 1 year ago

For users who use platformio:

Your in platformio.ini file lib_deps should be something like this : As @exxamalte mentioned.


lib_deps = 
    SPI
    Wire
    adafruit/Adafruit SSD1306@^2.5.7
    adafruit/Adafruit GFX Library@^1.11.7
    adafruit/Adafruit BusIO@^1.14.1
    Adafruit MLX90614 Library