Open explo910 opened 1 year ago
Sorry to step in, but this is kind of related as the BME680 is an I2C device: does I2C work in your setup (referring to https://github.com/esphome/issues/issues/3838)? What happens if you set
platform: bme680
(without BSEC, some of the parameters are different/nonexistent, though)
I tried it before with the BME680 component and had no issues. I will try to find my yaml file and update you on my findings in #3838.
This issue here seems only to happen with the BSEC Library.
Thanks!
On Windows I was able to compile it by adding a few build flags.
esphome:
...
platformio_options:
build_flags:
- -I .piolibdeps/<device-name>/BSEC\ Software\ Library/src/inc
- -L .piolibdeps/<device-name>/BSEC\ Software\ Library/src/cortex-m0plus
- -lalgobsec
I'm trying to make it work from the ESPHome dashboard in Home Assistant but I'm struggling to get that to work :x
Any luck getting this working? Seeing the same thing. If I had to guess, it seems like the library wasn't built for this variant?
@avaneerd: Thank you for sharing your findings. For it to work in the ESPHome Dashboard an absolute path must be specified:
esphome:
name: <device-name>
platformio_options:
build_flags:
- -I /data/<device-name>/.piolibdeps/<device-name>/BSEC\ Software\ Library/src/inc
- -L /data/<device-name>/.piolibdeps/<device-name>/BSEC\ Software\ Library/src/cortex-m0plus
- -lalgobsec
This is an issue with the BSEC Library. It's probably broken for all ARM chips. I just created a Pull Request for BSEC2: https://github.com/boschsensortec/Bosch-BSEC2-Library/pull/22
I concluded the same. Just not enough time to investigate further. Looks like the last drop of the bsec lib broke esp32 arch. The binaries are not present in the distro. --dw On Mar 18, 2023, at 10:34 AM, David K. @.***> wrote: This is an issue with the BSEC Library. It's probably broken for all ARM chips. I just created a Pull Request for BSEC2: boschsensortec/Bosch-BSEC2-Library#22
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
Hi,
I'm having the same issue but I'm unable to fix it using a method suggested by @swoga.
Setup: HA Supervised 2023.4.2 running on ODROID-N2 ESP32-S3 WROOM1 chip with BME680 sensor Compiling Esphome code using Esphome add-on in HA
It all worked fine when using bme680 platform without BSEC. After switching to BSEC library, I got the following error:
/data/cache/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: cannot find -lalgobsec
collect2: error: ld returned 1 exit status
*** [/data/multisensor-01/.pioenvs/multisensor-01/firmware.elf] Error 1
After adding platformio_options, cleaning files and compiling I was getting this:
/data/cache/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: skipping incompatible /data/multisensor-01/.piolibdeps/multisensor-01/BSEC Software Library/src/cortex-m0plus/libalgobsec.a when searching for -lalgobsec
/data/cache/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: cannot find -lalgobsec
collect2: error: ld returned 1 exit status
*** [/data/multisensor-01/.pioenvs/multisensor-01/firmware.elf] Error 1
My code:
esphome:
name: multisensor-01
friendly_name: Multi-Sensor 1
platformio_options:
# board_upload.flash_size: 2MB
# board_upload.maximum_size: 4194304
# board_build.partitions: "minimal.csv"
# board_build.flash_mode: dio
build_flags:
- -I /data/multisensor-01/.piolibdeps/multisensor-01/BSEC\ Software\ Library/src/inc
- -L /data/multisensor-01/.piolibdeps/multisensor-01/BSEC\ Software\ Library/src/cortex-m0plus
- -lalgobsec
esp32:
board: adafruit_feather_esp32s3_tft
variant: esp32s3
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret api_key
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
use_address: 192.168.1.95
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Multi-Sensor 01 Fallback Hotspot"
password: !secret ap_password
captive_portal:
i2c:
- id: bus_a
sda: 14
scl: 13
scan: false
#sensor:
# - platform: bme680
# temperature:
# name: "BME680 Temperature"
# oversampling: 16x
# pressure:
# name: "BME680 Pressure"
# humidity:
# name: "BME680 Humidity"
# gas_resistance:
# name: "BME680 Gas Resistance"
# address: 0x77
# update_interval: 60s
#switch:
# - platform: gpio
# pin: GPIO11
# id: gpio11
# restore_mode: ALWAYS_OFF
bme680_bsec:
sensor:
- platform: bme680_bsec
temperature:
name: "BME680 Temperature"
pressure:
name: "BME680 Pressure"
humidity:
name: "BME680 Humidity"
iaq:
name: "BME680 IAQ"
id: iaq
co2_equivalent:
name: "BME680 CO2 Equivalent"
breath_voc_equivalent:
name: "BME680 Breath VOC Equivalent"
text_sensor:
- platform: bme680_bsec
iaq_accuracy:
name: "BME680 IAQ Accuracy"
- platform: template
name: "BME680 IAQ Classification"
icon: "mdi:checkbox-marked-circle-outline"
lambda: |-
if ( int(id(iaq).state) <= 50) {
return {"Excellent"};
}
else if (int(id(iaq).state) >= 51 && int(id(iaq).state) <= 100) {
return {"Good"};
}
else if (int(id(iaq).state) >= 101 && int(id(iaq).state) <= 150) {
return {"Lightly polluted"};
}
else if (int(id(iaq).state) >= 151 && int(id(iaq).state) <= 200) {
return {"Moderately polluted"};
}
else if (int(id(iaq).state) >= 201 && int(id(iaq).state) <= 250) {
return {"Heavily polluted"};
}
else if (int(id(iaq).state) >= 251 && int(id(iaq).state) <= 350) {
return {"Severely polluted"};
}
else if (int(id(iaq).state) >= 351) {
return {"Extremely polluted"};
}
else {
return {"error"};
}
Any ideas?
Hi,
I'm having the same issue but I'm unable to fix it using a method suggested by @swoga.
Try to replace "cortex-m0plus" with "esp32". Cortex will not work, ESP doesn't use ARM cores.
Amazing! Works like a charm. Thank you so much.
That fix is not working to me unfortunately:
Archiving /data/esp-ikea4/.pioenvs/esp-ikea4/libFrameworkArduino.a Linking /data/esp-ikea4/.pioenvs/esp-ikea4/firmware.elf /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: cannot find -lalgobsec collect2: error: ld returned 1 exit status *** [/data/esp-ikea4/.pioenvs/esp-ikea4/firmware.elf] Error 1 ========================= [FAILED] Took 108.40 seconds =========================
Where did you put the lalgobsec.a file?
Started playing around with updating bsec/bsec2 libraries myself to see if I can get it working since it fails for me too with the above error. But Im not sure where to place the libalgobsec.a file that is required, using esphome dashboard.
Started playing around with updating bsec/bsec2 libraries myself to see if I can get it working since it fails for me too with the above error. But Im not sure where to place the libalgobsec.a file that is required, using esphome dashboard.
not sure but i think you have to copy the file around manually for now: https://github.com/boschsensortec/BSEC-Arduino-library/pull/57
The problem
I am not sure if this problem is related to ESPHome or Platform.io. Please let me know so I can create the problem in the correct project.
When I try to compile a firmware for the Raspberry Pi Pico W with a bme680_bsec component, the compilation fails. I tried the Home Assistant addon and the pip installation with the same error:
|-- BSEC Software Library @ 1.6.1480 | |-- SPI @ 1.0 | |-- Wire @ 1.0 |-- MD5Builder @ 1.0.0 Linking /data/testesphome/.pioenvs/testesphome/firmware.elf /data/cache/platformio/packages/toolchain-rp2040-earlephilhower/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld: cannot find -lalgobsec collect2: error: ld returned 1 exit status *** [/data/testesphome/.pioenvs/testesphome/firmware.elf] Error 1
With the pip version, I was able to isolate and fix the error by manually copying libalgobsec.a from: .esphome\build\testesphome.piolibdeps\testesphome\BSEC Software Library\src\cortex-m0plus to: .esphome\build\testesphome.piolibdeps\testesphome\BSEC Software Library\src\rp2040
After that, the compilation went through and worked after flashing to the Pico W.
Which version of ESPHome has the issue?
2022.12.0
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
No response
What platform are you using?
RP2040
Board
Raspberry Pi Pico W
Component causing the issue
bme680_bsec
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
I tried ESPHome 2022.11.4 to 2022.12.0