trvrnrth / esphome-bsec-bme680

ESPHome component for the Bosch BME680 sensor via BSEC providing temperature, humidity, pressure and indoor air quality measurements.
85 stars 16 forks source link

Error compiling from hassio #1

Closed miroslavpetrov closed 3 years ago

miroslavpetrov commented 3 years ago

Hello, I am having trouble compiling the esphome-bsec-bme680. I get the following errors:

`INFO Reading configuration /config/esphome/bme680.yaml... INFO Generating C++ source... INFO Compiling app... INFO Running: platformio run -d /config/esphome/bme680_climate Processing bme680_climate (board: huzzah; framework: arduino; platform: espressif8266@2.6.2)

HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash PACKAGES:

trvrnrth commented 3 years ago

Have you updated to ESPHome 1.15?

This was an issue in the last with 1.14 which meant I had to stick to an older framework version but since updating to 1.15 myself I bumped the framework version and haven't had any issues.

miroslavpetrov commented 3 years ago

The version I am using is 1.15.1.

trvrnrth commented 3 years ago

Oddly, now that I look more closely at my compilation logs I think my builds are picking up a cached copy of the framework so I may have inadvertently re-introduced the error here. I'll report back when I've worked out where that is coming from...

trvrnrth commented 3 years ago

Yep, my bad. I've sorted out the mess I made of updating the patched Arduino framework. It's should now be the correct version!

Unfortunately I don't think this will get pulled automatically so you'll need to force that to happen. The easiest way I'm currently aware of is to shell into your hassio instance, hop onto the esphome docker instance and delete the packages forcing platformio to re-fetch them on the next build:

ssh root@homeassistant.local -p22222
login
docker exec -it $(docker ps -f name=esphome -q) bash
rm -Rf ~/.platformio/packages/framework-arduinoespressif8266*

This is currently a pretty unpleasant solution anyway. There's a bit of discussion about making all of this nicer in https://github.com/esphome/feature-requests/issues/16#issuecomment-692767632

trvrnrth commented 3 years ago

OK, so good news. There is now no need for a patched Arduino framework as I've implemented the changes noted for the bsec library packaging in a fork of that repo (in PR to upstream for comment at https://github.com/BoschSensortec/BSEC-Arduino-library/pull/51).

You'll probably still need to clear out the cached framework package files as noted in the last comment but after that a clean build and compile should work as expected without any extra shenanigans.

miroslavpetrov commented 3 years ago

Thank you! Now it works perfectly! I had a bit of a hard time to find where the I2C address of the BME680 sensor is defined since mine is with default address of 0x77.

trvrnrth commented 3 years ago

Excellent news. Glad it's working for you!

Just in case anyone else is reading this the line to change at the moment is https://github.com/trvrnrth/esphome-bsec-bme680/blob/master/src/bsecsensor.h#L116 with the constant for 0x77 being BME680_I2C_ADDR_SECONDARY.

I should probably have made that configurable from the node config so I'll make a note of it for a possible future improvement.

maurik69 commented 3 years ago

Excellent news. Glad it's working for you!

Just in case anyone else is reading this the line to change at the moment is https://github.com/trvrnrth/esphome-bsec-bme680/blob/master/src/bsecsensor.h#L116 with the constant for 0x77 being BME680_I2C_ADDR_SECONDARY.

I should probably have made that configurable from the node config so I'll make a note of it for a possible future improvement.

That's was really helpful for me too, I'm testing it on ESP32 and I was not able to understand why the lambda was not returning any data nor errors... Thanks!