Bosch Sensortec Community

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

    BME680 warning code : 2

    BME680 warning code : 2

    sinameshksar
    Member

    Hello

     

    I'm trying to use BSEC-Arduino-library for BME680 on ESP32 using the I2C interface. I installed bsec v1.8.9 lib on my Arduino IDE v1.8.11. I was able to compile the "basic" sample project and run it successfully on my esp32 dev-kit. However, I don't get any valid measurement value; instead, it continuously prints "BME680 warning code :2" on the serial. 

    I did add a 5sec delay in the main loop but didn't help. It seems I2C interface is working though, as I get Ack signal from the sensor chip (logic analyzer).

     

    Any idea what could be wrong? 

     

    Thanks in advance

    7 REPLIES 7

    handytech
    Community Moderator
    Community Moderator

    "BME680 warning code :2" typically indicates that no new data sample was available in the data registers. If you have a logic analyzer available, could you confirm that not only read but also your write transactions look as expected, and that your timings (e.g. delay function) look correct too?

    As a follow up on this issue, I did some debugging and noticed the issue is nailed down to function read_field_data(...). In this function, because of some reason, the gas_valid_r <5> and heat_stab_r<4> bits in gas_r_lsb (0x2B) doesn't get set!!!

    Note that all the variables such as calibration data and chip-ID are read correctly from BME680. Also, the written values seem to be ok. I was able to confirm it by reading the same values as they are written. Attached some screen shut from both read and write. Also, the timing is correct.

    It is interesting that I was able to run the exact same code on an ESP8266 dev-board. Simply, set the Arduino IDE board to  NodeMCU and it worked!! The timing is the same for both boards.

    It must be a sneaky subtle issue somewhere. Any idea what could be wrong?

    If the same code runs on the ESP8266 but not on the ESP32, the issue is indeed quite sneaky. Would you be able to share your Logic captures for both boards (from BME680 init all the way to the data read-out) for side-by-comparison?

    Here are the captures for ESP32 and ESP8266. As you can see all transactions are exactly the same up to the point where they start reading from the status register (0x1D). It happens at 1.6969926 s and 19.9563494 s for ESP32 and ESP8266 respectively. The only difference is that the duration of reads/writes for esp8266 is a bit longer so I did slow down the i2c_clock of the esp32 but didn't change the outcome.

    I was wondering if anyone has run this code on an esp32 board successfully? 

     

    PS. To open the cap files you can use Logic from Saleae: https://support.saleae.com/logic-software/latest-beta-release

     

     

    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