Bosch Sensortec Community

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

    Reading multiple BME688 with Bsec2

    Reading multiple BME688 with Bsec2

    hugehead
    Established Member

    Hello,

    I would like to readout multiple BME688 simultaniously. I created two instances of Bsec2, and afterwards i do each step for both instances. I kept the NewDataCallback the same, as one input parameter is the BSEC instance. In BSEC2 i get an error 100 from BSEC2.

    Please let me know what is the problem .

    Bsec2 envSensors[2];

     

       for(int i = 0; i < NUMBEROFDEVICES; i ++)
          {
              
    
              //Set multiplexer
    
              if (!envSensors[i].begin(BME68X_I2C_ADDR_LOW, Wire))
              {
                  checkBsecStatus(envSensors[i]);
              }
          
              /* Subsribe to the desired BSEC2 outputs */
              if (!envSensors[i].updateSubscription(sensorList, ARRAY_LEN(sensorList), BSEC_SAMPLE_RATE_LP))
              {
                  checkBsecStatus(envSensors[i]);
              }
              
              /* Whenever new data is available call the newDataCallback function */
              envSensors[i].attachCallback(newDataCallback);
              envSensors[i].index = i;
              Serial.println("BSEC library version " + \
                String(envSensors[i].version.major) + "." \
                + String(envSensors[i].version.minor) + "." \
                + String(envSensors[i].version.major_bugfix) + "." \
                + String(envSensors[i].version.minor_bugfix));
                
          }
    
    
    }

     

    if (!envSensors[i].begin(BME68X_I2C_ADDR_LOW, Wire))
    {
    checkBsecStatus(envSensors[i]);
    }

     

     

    I checked the Arduino example for x8 board, which has 8 times BME688 and Multiplexer. It seems like the example is reading and processing only 1 BME688 sensor.

    Kind Regards

    23 REPLIES 23

    BSTRobin
    Community Moderator
    Community Moderator

    hugehead
    Established Member

    Hello Robin,

    the example is from BSEC(v1), i am using BSEC V2 right now. Which - iguess - is the most recent, right? I am running on MKRZero right now, using the basic example without writing to the EEPROM. It seems that the example above is for BME680, not for BME688.

    I have attached 2x BME688 Pi3g dev board (ADDR HIGH, ADDR LOW), this example works different and has the newDataCallback. can assume from the output that sometimes it reads sensor 1 and sometimes sensor 2 (because of different "Gas resistance") but the values are coming irregularly. I assume it should come every ~3 seconds.

    Additionally, i get warning 100, which is relate to timing from your precompiled library? Output is below and attached my example code.

    • Can I run multiple different sensors on the BSEC2? What do I need to do?
    14:16:51.072 -> BSEC library version 2.0.6.1
    14:16:51.072 -> BSEC library version 2.0.6.1
    14:16:51.141 -> BSEC warning code : 100
    14:16:54.102 -> BSEC outputs:
    14:16:54.102 -> 	timestamp = 3875
    14:16:54.102 -> 	iaq = 25.00
    14:16:54.102 -> 	iaq accuracy = 0
    14:16:54.102 -> 	temperature = 22.49
    14:16:54.102 -> 	pressure = 99600.37
    14:16:54.102 -> 	humidity = 42.72
    14:16:54.102 -> 	gas resistance = 5684.85
    14:16:54.102 -> 	stabilization status = 1.00
    14:16:54.102 -> 	run in status = 0.00
    14:16:54.102 -> BSEC warning code : 100
    14:16:57.072 -> BSEC outputs:
    14:16:57.072 -> 	timestamp = 6875
    14:16:57.072 -> 	iaq = 25.00
    14:16:57.072 -> 	iaq accuracy = 0
    14:16:57.072 -> 	temperature = 22.60
    14:16:57.072 -> 	pressure = 99604.23
    14:16:57.106 -> 	humidity = 42.71
    14:16:57.106 -> 	gas resistance = 5684.85
    14:16:57.106 -> 	stabilization status = 1.00
    14:16:57.106 -> 	run in status = 0.00
    14:16:57.106 -> BSEC warning code : 100
    14:17:00.069 -> BSEC outputs:
    14:17:00.069 -> 	timestamp = 9875
    14:17:00.104 -> 	iaq = 25.00
    14:17:00.104 -> 	iaq accuracy = 0
    14:17:00.104 -> 	temperature = 22.70
    14:17:00.104 -> 	pressure = 99610.11
    14:17:00.104 -> 	humidity = 42.56
    14:17:00.104 -> 	gas resistance = 5684.85
    14:17:00.104 -> 	stabilization status = 1.00
    14:17:00.104 -> 	run in status = 0.00
    14:17:00.104 -> BSEC warning code : 100
    14:17:03.156 -> BSEC warning code : 100
    14:17:06.099 -> BSEC outputs:
    14:17:06.099 -> 	timestamp = 15875
    14:17:06.099 -> 	iaq = 25.00
    14:17:06.099 -> 	iaq accuracy = 0
    14:17:06.099 -> 	temperature = 25.06
    14:17:06.099 -> 	pressure = 99588.34
    14:17:06.099 -> 	humidity = 38.31
    14:17:06.099 -> 	gas resistance = 87581.25
    14:17:06.099 -> 	stabilization status = 1.00
    14:17:06.099 -> 	run in status = 0.00
    14:17:06.099 -> BSEC warning code : 100
    14:17:09.089 -> BSEC outputs:
    14:17:09.089 -> 	timestamp = 18875
    14:17:09.089 -> 	iaq = 25.00
    14:17:09.089 -> 	iaq accuracy = 0
    14:17:09.089 -> 	temperature = 25.12
    14:17:09.089 -> 	pressure = 99589.26
    14:17:09.089 -> 	humidity = 38.24
    14:17:09.089 -> 	gas resistance = 97061.61
    14:17:09.089 -> 	stabilization status = 1.00
    14:17:09.089 -> 	run in status = 0.00
    14:17:09.089 -> BSEC warning code : 100
    14:17:12.086 -> BSEC outputs:
    14:17:12.086 -> 	timestamp = 21875
    14:17:12.086 -> 	iaq = 25.00
    14:17:12.086 -> 	iaq accuracy = 0
    14:17:12.086 -> 	temperature = 25.19
    14:17:12.086 -> 	pressure = 99587.47
    14:17:12.086 -> 	humidity = 38.11
    14:17:12.086 -> 	gas resistance = 102359.05
    14:17:12.086 -> 	stabilization status = 1.00
    14:17:12.086 -> 	run in status = 0.00
    14:17:12.086 -> BSEC warning code : 100
    14:17:15.081 -> BSEC outputs:
    14:17:15.081 -> 	timestamp = 24875
    14:17:15.081 -> 	iaq = 25.00
    14:17:15.081 -> 	iaq accuracy = 0
    14:17:15.081 -> 	temperature = 22.74
    14:17:15.081 -> 	pressure = 99607.55
    14:17:15.081 -> 	humidity = 42.38
    14:17:15.081 -> 	gas resistance = 5974.61
    14:17:15.081 -> 	stabilization status = 1.00
    14:17:15.081 -> 	run in status = 0.00
    14:17:15.081 -> BSEC warning code : 100
    14:17:18.083 -> BSEC outputs:
    14:17:18.083 -> 	timestamp = 27875
    14:17:18.083 -> 	iaq = 25.00
    14:17:18.083 -> 	iaq accuracy = 0
    14:17:18.083 -> 	temperature = 22.61
    14:17:18.083 -> 	pressure = 99604.16
    14:17:18.083 -> 	humidity = 42.30
    14:17:18.083 -> 	gas resistance = 6412.83
    14:17:18.083 -> 	stabilization status = 1.00
    14:17:18.083 -> 	run in status = 0.00
    14:17:18.083 -> BSEC warning code : 100

     

    Really apperciate your help.

    Kind Regards
    Matthias

    BSTRobin
    Community Moderator
    Community Moderator

    Hello hugehead,

    For BSE2, you could refer BSEC2 code on github that supported multiple BME68X sensors.
    https://github.com/BoschSensortec/Bosch-BSEC2-Library

    Multiple sensors example code: https://github.com/BoschSensortec/Bosch-BSEC2-Library/tree/master/examples/x8_board_examples

     

    hugehead
    Established Member

    Hello Robin,

    as described above, i checked that example already. My assumption has been, as yours, that it will read multiple BME688 sensors. But in fact, I can read one BME688 from the x8 board.

    As you can see, it is creating ONE object of BME688, not multiple.

    /* Create an object of the class Bsec2 */
    Bsec2 envSensor;
    commMux commConfig;

     and is reading one sensor at a time. I would like to accomplish a scenario, where i can read multiple sensors at a time like in my attached arduino example above. Then, i get some error 100. Please help me to find a solution to read multiple BME688 at a time.

    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