02-21-2023 02:45 PM - edited 02-21-2023 02:45 PM
I'm trying to use the 2022_05_17_01_09_bsec_h2s_nonh2s_2_2_0_0.config file from the BSEC2.2.0.0 library to get the estimates for the H2S/non H2S that should be given by the BSEC_OUTPUT_GAS_ESTIMATE_1 and BSEC_OUTPUT_GAS_ESTIMATE_2 in the virtual sensors . I also requested TPHG and all the sample rates are set to SCAN.
The first thing that differs from what should be the standard way to do it is that i don't actually load the .config file (bsec_set_configuration returns a mismatch version error) but i use the bsec_serialized_configurations_selectivity.h and bsec_serialized_configurations_selectivity.c files to load the configuration since it works and gives me the OK code as a return.
Next i initialize the bme library and call the bsec update subscription.
Inside the main loop i then call the sensor control from which the returned mode is the parallel (2) and from which i take all the parameters for the oversampling and the heater duration and temperature profiles and then i set all the configurations and the op mode.
Next i check if i the trigger measuramente is 1 and if so i call the get data.
Then i check i process_data is not 0 and if so a for loop is called to initialize the input[] array with the data[i] values that are then passed to bsec do steps.
When checking the output parameter from bsec_do_steps() though i don't have the values for the estimates but only for TPHG.
How do i get the values for the gas estimates? Do i have to call the bsec_do_step() with different parameters with respect to the forced mode? Do i have to wait more time?
Solved! Go to Solution.
02-21-2023 03:41 PM
I also noticed that if i request TPHG the bietfield of process_data in bsec_bme_settings_t is 15 that is ..001111 in binary so requesting the signals for TPHG as the input. When i add the GAS_ESTIMATE_1 in the virtual sensors the bitfield becomes the equivalent of 8388623 in deciamal (something like 1000..001111 at 24 bits). Why is that 1 at the beginning? What does it mean? Does it influence the output somehow?
02-23-2023 01:38 PM
Hi Prop4et,
Did you strictly refer the example code "bsec_2-2-0-0_generic_release_30052022\examples\Bosch_BSEC2_Library\examples\generic_examples\basic_config_state" and document "bsec_2-2-0-0_generic_release_30052022\integration_guide\BST-BME688-Integration-Guide-AN011-20.pdf"?
02-24-2023 10:48 AM - edited 02-24-2023 11:44 AM
Hi Robin,
I strictly referred to the integration guide, while i needed to adapt the example code to my case because i am using a raspberry pi pico.
The main problem is that i don't get any values for requesting the gas estimates. I don't even get zeros. One more difference is that when loading the configuration i cannot use the .config file because i get a version mismatch error, while i can load the .h and .c file, and i don't know if this changes something (referring to the BSEC_2.2.0.0_Generic_Release_30052022\config\bsec_sel_iaq_33v_3s_4d files).
The workflow in my code is the one defined in the sequence diagram in the integration guide.
EDIT: i checked the version of the bsec loaded by the pico through bsec_get_version and it is 2.2.0.0
02-27-2023 09:40 AM
I understood that the 24th bit is set because BSEC_INPUT_PROFILE_PART is requested as a input. I am providing this value to the sensor but it still doesn't output anything.