Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BSEC Compensated Temperature and Humidity wrong

    BSEC Compensated Temperature and Humidity wrong


    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.


    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.


    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

    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 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:
    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/

    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.