Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BME680 warning code : 2

    BME680 warning code : 2




    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

    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: