Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Running BME680 + BSEC2, STATIC_IAQ accuracy always 1

    Running BME680 + BSEC2, STATIC_IAQ accuracy always 1

    shadowpho
    New Poster

    I am using the latest version of BSEC2.0.61, with BME680 on a raspberry pi zero w. I am using BME68x c interface (from github) and feed the data into BSEC per request (I use timing from next_call), on LP speed.

    I am using the bsec_config_iaq from bsec_serialized_configurations_iaq.c for bsec_set_configuration.

    There are no erros from any BME or BSEC calls. BME680 gets reset and passes self-test on every start.

    However the issue is that STATIC_IAQ accuracy never rises above 1.  It goes from 0->1 in about 5 minutes and stays there for at least a day.  I feed 5 sensors into do_steps:  temperature, heat_source (0.3c), humidity,pressure and gas_resistance.   I verified that temperature, humidity, pressure are all valid (even though accuracy of them always stays at 0?). I have 4 other sensors in this device and they all report nearly identical values for temp, humidity and pressure.

    The source code is available here, with link pointing towards my "glue" file: https://github.com/shadowpho/OutsideSensor/blob/master/BSECglue.cpp

    The whole BSEC_BME runs in it's own thread.  Here is the thread (from main.cpp). As you can see we run the init, then run the loop as needed (and add the output to mutex-protected storage space if it's valid).

    void BME680_loop(CMA_Data* obj, CMA_Data* obj2)
    {
      BSEC_BME_init();
      float temp, pressure, humidity, VOC;
      while (1) {
        int ret = BSEC_BME_loop(&temp, &pressure, &humidity, &VOC);
        if (ret != 0) { printf("BME/BSEC LOOP FAIL!!! %i\n", ret); }
        if (!std::isnan(temp)) add_to_CMA(obj, temp, pressure, humidity, 0);
        if (!std::isnan(VOC)) add_to_CMA(obj2, VOC, 0, 0, 0);
        sleep_us(BSEC_desired_sleep_us());
      }
    }

     

    How can I debug this? What am I doing wrong with it?

    How can I debug?  It's a bit painful because there are no good examples for raspberry pi.

    6 REPLIES 6

    Ah, ok I can adapt that to my solution. Let me code it up and I'll come back with data tomorrow!

    BSTRobin
    Community Moderator
    Community Moderator

    Hi shadowpho,

    Did you have further feedback?

    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