Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BME688 - Arduino MKR WiFi 1010 Communication failure I2C

    BME688 - Arduino MKR WiFi 1010 Communication failure I2C

    Christoforos
    Established Member

    Hello,

    I am trying to get raw data from the BME688 sensor on a Sparkfun board on the Arduino MRK WiFi 1010 board using Arduino IDE 2.0.3 and I2C protocol. I have installed both BME68x and BSEC2 from GitHub. I am not sure if I actually need BSEC2 if I only neet raw data and not iaq. 

    I can compile and upload the parallel_mode, sequential_mode and forced_mode examples and I get the same error in the Serial monitor: 

    Sensor error:Communication failure

     I guess that the error comes from the code below:

    #ifndef PIN_CS
    #define PIN_CS SS
    #endif
     
    /* initializes the sensor based on SPI library */
    bme.begin(PIN_CS, Wire);
     
    I modified the line:  " bme.begin(PIN_CS, SPI); " to " bme.begin(PIN_CS, Wire); " such that I2C protocol is used instead of SPI. 
     
    Any help please?
     
    Many thanks!
    6 REPLIES 6

    Minhwan
    Community Moderator
    Community Moderator

    Hi, 

     

    I believe you are using Arduino since your boards for Arduino. 

    If so, you have to download BME68x API and BSEC2 for Arudino in below URL. 

    https://www.bosch-sensortec.com/software-tools/software/bme688-software/

    Minhwan_0-1676584258665.png

    You should add those 2 zip files in your Arduino library. 

    Then, open BSEC2 example like basic.ino 

    \Arduino\libraries\Bosch-BSEC2-Library-master\examples\generic_examples\basic\basic.ino

    You shouldn't touch BME68x API part. 

    The default interface for BSEC2 is i2c, so you can directly use it. 

    Thank you. 

    Dear  Minhwan,

    Thank you for your reply!

    Yes, I use Arduino IDE 2.0.3. 

    I followed the steps you described exactly. When I compile for MKR Wifi 1010 I get the following warning:

    "

    In file included from /Users/christoforospanteli/Documents/Arduino/libraries/Bosch-BSEC2-Library-master/src/bsec2.cpp:39:0:
    /Users/christoforospanteli/Documents/Arduino/libraries/Bosch-BSEC2-Library-master/src/bsec2.h: In member function 'const bsecData Bsec2::getData(bsecSensor)':
    /Users/christoforospanteli/Documents/Arduino/libraries/Bosch-BSEC2-Library-master/src/bsec2.h:154:13: warning: missing initializer for member 'bsec_output_t::signal' [-Wmissing-field-initializers]
    { 0 };
    ^
    /Users/christoforospanteli/Documents/Arduino/libraries/Bosch-BSEC2-Library-master/src/bsec2.h:154:13: warning: missing initializer for member 'bsec_output_t::signal_dimensions' [-Wmissing-field-initializers]
    /Users/christoforospanteli/Documents/Arduino/libraries/Bosch-BSEC2-Library-master/src/bsec2.h:154:13: warning: missing initializer for member 'bsec_output_t::sensor_id' [-Wmissing-field-initializers]
    /Users/christoforospanteli/Documents/Arduino/libraries/Bosch-BSEC2-Library-master/src/bsec2.h:154:13: warning: missing initializer for member 'bsec_output_t::accuracy' [-Wmissing-field-initializers]

    "

    When I compile for esp32 I get the following error: 

    "

    /Users/christoforospanteli/Documents/Arduino/libraries/Bosch-BSEC2-Library-master/src/bsec2.cpp:138: undefined reference to `bsec_sensor_control'
    collect2: error: ld returned 1 exit status

    "

    This means BSEC2 library works for MKR WiFi 1010 and I do get readings, but not for esp32. The parallel_mode example in the BME68x library compiles and uploads on both boards but I get "

    > Sensor error:Communication failure

    in the serial monitor. I want to save the raw data on an SD card, so my question is: Do I actually need BSEC or just BME68x library? 

    Many thanks!

     

     

    I attach a document showing the circuit I am using. 

    Minhwan
    Community Moderator
    Community Moderator

    Did you check that you need pull up resistor for I2C or not? 

    If you need, please put it. 

    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