Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Getting error in bme680 calibration function.

    Minhwan
    Community Moderator

    Re: Getting error in bme680 calibration function.

    Hello Sudeep, 

     

    Currently, I'm checking with HQ whether we can read and write i2c data in case i2c communication length is less than BME68x requires. 

    I will let you know, but possibly you can't use it. 

    Thanks, 

    Sudeep1310
    Member

    Re: Getting error in bme680 calibration function.

    Hello Minhwan,

    Thanks for  your  valuable assistance. Once you check with HQ let me know. Your feedback is important to me.

    kgoveas
    Community Moderator

    Re: Getting error in bme680 calibration function.

    Hi Sudeep1310,

    I would recommend migrating to the newer version of the sensor API that supports both the BME680 and BME688. Given that your platform only supports 16 byte reads, you have to achieve longer reads by modifying your I2C read to perform consecutive reads to acheive longer transactions. It would look something like below

     

    int8_t i2c_read(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
    {
    	int8_t rslt = 0; /* Return 0 for Success, non-zero for failure */
    	uint16_t max_len = 16; /* BlueNRG RX FIFO depth */
    	uint16_t bytes_left = len;
    	uint16_t len_to_read = 0;
    	uint16_t i = 0;
    		
    	for(i = 0; (i < len) && (rslt == 0);)
    	{
    		bytes_left = len - i;
    		len_to_read = (bytes_left < max_len) ? bytes_left : max_len;
    		
    		rslt = SdkEvalI2CRead(&reg_data[i], dev_id, reg_addr + i, len_to_read);
    		i += len_to_read;
    	}
    	
    	return rslt;
    }

     

     

    Sudeep1310
    Member

    Re: Getting error in bme680 calibration function.

    Hello Kgoveas,

    Thank you very much for your guidance. I will modify my I2C read function as per your suggestion and will give you feedback soon. 

     

    BR

    Sudeep

    Sudeep1310
    Member

    Re: Getting error in bme680 calibration function.

    Hello Kgoveas,

    Thanks once again for your great suggestons. Your trick is working  with my code. I getting forced example output as below,

    Sample, TimeStamp(ms), Temperature(deg C), Pressure(Pa), Humidity(%), Gas resistance(ohm), Status
    1, 1000, 28.75, 94488.88, 35.88, 5825.59, 0xa0
    2, 1000, 28.98, 94491.52, 35.91, 1831.92, 0xb0
    3, 1000, 29.48, 94483.83, 35.98, 1680.24, 0xb0
    4, 1000, 29.97, 94487.53, 36.05, 1686.79, 0xb0
    5, 1000, 30.32, 94488.09, 36.12, 1692.28, 0xb0
    6, 1000, 30.56, 94490.24, 36.14, 1724.87, 0xb0
    7, 1000, 30.76, 94494.60, 36.15, 1746.91, 0xb0
    8, 1000, 30.94, 94484.99, 36.14, 1765.91, 0xb0
    9, 1000, 31.09, 94492.68, 36.11, 1779.22, 0xb0
    10, 1000, 31.22, 94493.74, 36.07, 1806.44, 0xb0

     

    As compared to my previous output of my register based code Temperature, Pressure, Humidity output looks same.

    Look here,

    Temperature: 27.299999  
    Humidity: 36.500977  
    Pressure: 947.539978   (in  KPa)
    Altitude: 561.994995
    Gas: 0.000000 

    I have tested sensor intefaced with Arduino board and Gas resistance output  is between 1800-2000 always whenever I was testing with Arduino board. Means Now after implemeted your trick the output of gas resistance I am getting is nearly about same. So I conclude that it is working. 

    I have one doubt, As I seen  in output there is taken 10 samples and each time temperature is incremented by 1. So I am worried about this temperature value. Because I have refered with standard temperature monitor device and temperature here in testing room is 27.30 degree celcius. Please Guide on it. And tell me about Status value getting in Output (0xa0 and 0xb0)

    BR

    Sudeep

    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