Bosch Sensortec Community

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

    BME680 platform IO ESP32

    BME680 platform IO ESP32

    peter3099
    Member
     Hello
     
    I'm trying to configure the BSEC library on platform io in order to use a BME680 that I have connected to an ESP32, but no matter what I do I always get 
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec11beginCommonEv+0x4): undefined reference to
    `bsec_init'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec11beginCommonEv+0x8): undefined reference to
    `bsec_get_version'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec18updateSubscriptionEP21bsec_virtual_sensor_thf+0x0): undefined reference to `bsec_update_subscription'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec8setStateEPh+0x0): undefined reference to `bsec_set_state'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec15readProcessDataEx19bsec_bme_settings_t+0x14): undefined reference to `bsec_do_steps'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec3runEx+0x0): undefined reference to `bsec_sensor_control'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec3runEx+0x4): undefined reference to `bsec_get_state'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::beginCommon()':
    D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:477: undefined reference to `bsec_init'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::getVersion()':
    D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:477: undefined reference to `bsec_get_version'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::updateSubscription(bsec_virtual_sensor_t*,
    unsigned char, float)':
    D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:477: undefined reference to `bsec_update_subscription'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::setState(unsigned char*)':
    D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:477: undefined reference to `bsec_set_state'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::readProcessData(long long, bsec_bme_settings_t)':
    D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:386: undefined reference to `bsec_do_steps'
    .pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::run(long long)':
    D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:201: undefined reference to `bsec_init'
    D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:211: undefined reference to `bsec_update_subscription'
    D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:211: undefined reference to `bsec_sensor_control'
    D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:247: undefined reference to `bsec_get_state'
    collect2.exe: error: ld returned 1 exit status
    *** [.pio\build\esp32\firmware.elf] Error 1
     
    I saw the instructions for the library but I cannot find the platform txt nor I know what to put on it.
    Could you please advice what's the correct way to do it?
    Thanks 
    12 REPLIES 12

    handytech
    Community Moderator
    Community Moderator

    Please note that in your latest update you have changed the name of the library in the build_flags. You need to use "-lalgobsec" for the compiler to look for the file libalgobsec.a.

    Finally I got it to  compile, thanks so much for that

     

    In case anybody need it the final platform.ini file needs to have

    If you want to have the libraries install within the project folder

    build_flags =
      -I .pio/libdeps/esp32/BSEC\ Software\ Library_ID6979/src/inc
      -L .pio/libdeps/esp32/BSEC\ Software\ Library_ID6979/src/esp32
      -lalgobsec
    lib_deps = 
        BSEC Software Library
     
    One can also install the library locally and point the path to the different folders
    Stay safe!

    Hello Guy's,

    I am using STM32f103C8T6 module as a arduino framework but I am unble to complile the below mentioned BMSC library in Platform IO.

    boschsensortec/BSEC Software Library@^1.6.1480

    While complaing the basic.ino file the PIO is generating belwo mentioend error.

    c:/users/yusata infotech/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -lalgobsec
    collect2.exe: error: ld returned 1 exit status
    *** [.pio\build\genericSTM32F103CB\firmware.elf] Error 1
    =========================================================== [FAILED] Took 41.81 seconds ===========================================================

    Can anyone let me know how to fix this error???

    Yashgulati0_0-1614071622089.png

     

     

    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