Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BME680 Save and Load State Issue

    BME680 Save and Load State Issue

    New Poster


    I am using BSEC library with BME680 5min interval. The flow of our device goes like this:

    • Wakeup from device deep sleep "uC is off" then on, only external RTC is up,
    • Collect BME680 reading (accuracy 0), save state on each reading in EEPROM



    bsec_iot_loop(bme680_sleep, esp_timer_get_time, output_ready, state_save, 1/* 10000 */);​



    • Power-off uC.
    • Wake up, load the previous reading, and get new reading then save state, and so on..

    The problem is that accuracy is always 0. Appreciate your support on this and if I misunderstood the whole mechanism.. the assumption is that we'll store the state regardless of the accuracy, as it should be cumulatively changed to acc=3 over time.. also I didnt change the timestamp, so each time the device restart (wake-up from deep sleep it'll start counting from the beginning, since in my implementation the uC is completely off), each time it will reset, assuming it will load the state regardless of the timestamp since it should start from there? or I should only store it if its acc=3? Appreciate more clarification.

    Note: The sensor works perfectly in normal operation, with 5 min intervals; no deepsleep.

    14 REPLIES 14

    Community Moderator
    Community Moderator

    Hi Adi,

    Which config file you used?
    And you can record you print information for check.

    Hi BSTRobin,

    Thanks for your prompt response! Sure, this is the configuration file:

    set (BME_PROFILE "generic_33v_300s_28d")


    I am using ULP profile while initializing the sensor.

    Here is the logs:

    "18/9/2023 6:32:04 PM",I (10) I2C initialized
    "18/9/2023 6:32:04 PM",I (510)  bme680_sleep entered
    "18/9/2023 6:32:04 PM",I (520) Loading configuration: buffer-size 454 config size 454
    "18/9/2023 6:32:04 PM",I (520)  Entering into the loop
    "18/9/2023 6:32:06 PM",I (2510)  iaq 25.000000 temp 27.860001 hum 37.143002 press 93348.000000 static iaq 25.000000 co2_equivalent 500.000000 breath voc 0.500000 iaq_accuracy 0
    "18/9/2023 6:32:06 PM",I (2530) BME680 - state_save: Saving configuration: buffer-size 139
    "18/9/2023 6:32:06 PM",I (2550) bme680_sleep entered

    It continue like this, nothing is changing even after two days. I would like to add that I am not considering the newly calculated timestamp. I just updated the when to save the statefile parameter from 10000 to 1

    New Poster

    @BSTRobin Would really appreciate the feedback on my last post

    Community Moderator
    Community Moderator

    Hi Adi,

    1.You can print timestamp, BSEC output values every 300s for check;
    2.Which BSEC version you used?