Bosch Sensortec Community

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

    BSEC Compensated Temperature and Humidity wrong

    BSEC Compensated Temperature and Humidity wrong

    marsfan
    Member

    I'm working on getting the BSEC library working with Rust, as it has support for linking to C libraries. I have the system almost working perfectly, but I have run into one problem. The compensated temperature and humidity values are very wrong. I should be reading around 40% humidity, and around 22 degrees C, but the outputs from the library are reporting 100% humidity and  -3.4 degrees C.

    marsfan_1-1705902244167.png

    I've been able to trace the issue down to my call of `bsec_do_steps` in the library. The data I pass into it all looks accurate, but the output data has the issues as shown in the previous image.

    marsfan_2-1705902380349.png

    Is there any information that could suggest what I am doing wrong with passing the information into this function? Maybe I misconfigured something somehwhere else in the code.

    I understand that actual help with rust is probably outside of the normal realm of support for this forum, but was hoping for some more general pointer on where I could look for that may be causing this issue.

    4 REPLIES 4

    BSTRobin
    Community Moderator
    Community Moderator

    Hi marsfan,

    Could we know which sensor(BME680, BME688) and BSEC version you used?

    And which official BSEC example code you refer to?

    Sorry, I should have provided that. I'm using the BME688 with BSEC version 2.4.0.0. I'm not sure what you mean by BSEC example code. I'm not using any existing example code, as I am integrating the library with Rust.

    The code I am working with is pretty much a direct port of some work I was doing a couple of months ago in C++ (which does not have this issue), but I wanted to try using Rust instead. The source code for my rust project is not currently a public repository on github, but I was planning on making it public soon. I can make it public now if that helps.

    @BSTRobinI have made the code that is having issues open-source. It is available here: https://github.com/marsfan/envionment_monitor_rust
    The bindings for the BSEC library are auto-generated from the BSEC header files  and then I hook into them in the file environment_monitor_rust/src/bsec/mod.rs

    I figured it out myself. I had mixed up the use of "Ambient Temperature" in the BME68x Driver with the "temp_offset" used in the BSEC library, and was passing a value of 25 into the entire BSEC library, which was being applied as an offset to all of the temperature readings.

    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