Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    Error compiling BSEC on ESP8266 with Arduino IDE

    Error compiling BSEC on ESP8266 with Arduino IDE

    Davide
    Member
    Hi everyone,
    I would kindly need support for compiling a script for the ESP8266 controller with Arduino IDE.
    I have a BME680 sensor connected to a NodeMCU 8266 controller and some time ago I already created a working script to read the air quality index (Arduino IDE 1.8.11 and I don't remember which version of BSEC).
    Today I tried to load the same script again with Arduino IDE 1.8.12 and BSEC 1.4.7.4, but there is no way to compile it, I always find the same error. Also trying with basic example provided with BSEC library.
    I read on the internet that there are problems with the IDE 1.8.12, so I tried to remove it completely (even doing folder cleaning) and to install version 1.8.9, but unfortunately without success.
    I state that I have applied exactly the indications for Arduino contained in the pdf present in the BSEC package.
    I replaced the arduino-builder-219.exe file, modified the platform.txt and eagle.app.v6.common.ld files as indicated and placed the libalgobsec.a files in the BSEC library folder (trying both the normal and light version).
    Despite this, I find the following error:
    ***************************************************************************************************************************************************
    Arduino:1.8.9 (Windows 10), Scheda:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
    c:/users/david/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\bsec\bsec.cpp.o: in function `Bsec::i2cRead(unsigned char, unsigned char, unsigned char*, unsigned short)':
    C:\Users\david\Documents\Arduino\libraries\bsec\src/bsec.cpp:442: undefined reference to `bsec_init'
    c:/users/david/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\david\Documents\Arduino\libraries\bsec\src/bsec.cpp:442: undefined reference to `bsec_get_version'
    c:/users/david/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\bsec\bsec.cpp.o: in function `Bsec::beginCommon()':
    C:\Users\david\Documents\Arduino\libraries\bsec\src/bsec.cpp:448: undefined reference to `bsec_init'
    c:/users/david/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\david\Documents\Arduino\libraries\bsec\src/bsec.cpp:133: undefined reference to `bsec_get_version'
    c:/users/david/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\bsec\bsec.cpp.o: in function `Bsec::begin(unsigned char, TwoWire&)':
    C:\Users\david\Documents\Arduino\libraries\bsec\src/bsec.cpp:104: undefined reference to `bsec_update_subscription'
    c:/users/david/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\bsec\bsec.cpp.o: in function `Bsec::updateSubscription(bsec_virtual_sensor_t*, unsigned char, float)':
    C:\Users\david\Documents\Arduino\libraries\bsec\src/bsec.cpp:155: undefined reference to `bsec_update_subscription'
    c:/users/david/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\bsec\bsec.cpp.o: in function `Bsec::Bsec()':
    C:\Users\david\Documents\Arduino\libraries\bsec\src/bsec.cpp:70: undefined reference to `bsec_do_steps'
    c:/users/david/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\bsec\bsec.cpp.o: in function `Bsec::readProcessData(long long, bsec_bme_settings_t)':
    C:\Users\david\Documents\Arduino\libraries\bsec\src/bsec.cpp:288: undefined reference to `bsec_do_steps'
    c:/users/david/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\bsec\bsec.cpp.o:(.text._ZN4Bsec3runEv+0x4): undefined reference to `bsec_sensor_control'
    c:/users/david/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\bsec\bsec.cpp.o: in function `Bsec::run()':
    C:\Users\david\Documents\Arduino\libraries\bsec\src/bsec.cpp:166: undefined reference to `bsec_sensor_control'
    collect2.exe: error: ld returned 1 exit status
    exit status 1
    ***************************************************************************************************************************************************
    Could anyone kindly help me?
    Thanks
    Yours sincerely
    David
    16 REPLIES 16

    handytech
    Community Moderator
    Community Moderator

    In the meantime, I have edited my previous post with hyperlinks to temporarily hosted files, I will attach them again here in the Community as soon as things have been figured out.

    Thank you Handytech for your support.
    I have tried replacing the 2 files but unfortunately the error is still presents (exact the same).
    Can't understand which could be the problem...
    I also tried default Arduino-builder but same error...
    Maybe you use different libalgobsec library?

    I have also another doubt... why there are "bsec_datatypes.h" and "bsec_interface.h" files together with "libalgobsec.a" in generic release package?
    Should I replace them somewhere?

    handytech
    Community Moderator
    Community Moderator

    Since I did a fresh install of both the IDE and the the board support I am also running short on further ideas 😞 I also selected the "NodeMCU 1.0 (ESP-12E Module)" which compiles successfully (but I only have the Adafruit Feather HUZZAH to confirm that it actually runs as expected).

    The generic release package on our website is the official package for BSEC. The BSEC Arduino Library is a wrapper (intended) to ease the use/integration of the BSEC library in the Arduino environment. The current version of the BSEC Arduino Library is up-to-date to run/support the current latest official BSEC release package (v1.4.7.4), thefore these files should be identical with no need to manually replace anything manually.

    Handytech, you did a fresh installation deleting before AppData\...\Arduino and Programs\...\Arduino folders?
    Could you try another PC with clean Windows installation?
    Because I did it on my PC last week (same for IDE) ... and retried today but same error again.
    How do you install the board? Manual o automated?
    Thank you again.

    UPDATE: got it works! 😁

    I did fresh installation of IDE 1.8.11 and everythings works fine...

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist