Hello. I am using the 1. BME688 Sensor 2. BME68x API downloaded form: https://github.com/BoschSensortec/BME68x-Sensor-API 3. BSEC library Version 2.0.6.1 downloaded from: https://www.bosch-sensortec.com/products/environmental-sensors/gas-sensors/bme688/ 4. using the esp32 huzzah32 as the electronics base 5. I have a custom board, similar to the BME688 Shuttle Board, with 8 BME688 sensors on the PCB. I am using SPI to communicating with only 1 sensor for now. It seems that: a) SPI communications drivers work well, b) BME68x API works well to read/write BME688 sensor registers, set modes and retrieve measurement data. c) BSEC library was successfully integrated into the firmware source code. After Hardware initialization, BME68x API and BSEC library configuration and init successfully, I call bsec_sensor_control on a loop without any timing delay. I see that every 35 milliseconds the (curr_time_ns >= bsec_bme_settings.next_call) condition is accomplished. So it means that bsec_sensor_control function is exactly called every 35 milliseconds on the firmware. On the very first bsec_sensor_control call, the Parallel Mode is set to the BME688 sensor. 989 milliseconds after the Parallel Mode is set, a bsec_bme_settings.trigger_measurement condition is accomplished and the bme68x_get_data function is called to read data from sensor. In this case only Temperature, Pressure, Humidity, Gas resistance and Gas index is gotten from the BSEC library and printed as follows: timestamp bsec [ns] = 4027000000 timestamp [ns] = 4027000000 #### bsec_do_steps returned 0 Temperature = 27.568842 Pressure = 73798.656250 Humidity = 48.260582 Gas resistance = 39421.003906 Gas index = 0.000000 280 milliseconds after again bsec_bme_settings.trigger_measurement condition is accomplished and the bme68x_get_data function is called to read data from sensor and again only Temperature, Pressure, Humidity, Gas resistance and Gas index is gotten from the BSEC library and printed as follows: timestamp bsec [ns] = 4307000000 timestamp [ns] = 4307000000 #### bsec_do_steps returned 0 Temperature = 27.365967 Pressure = 73800.343750 Humidity = 48.222721 Gas resistance = 1254517 Gas index = 1.000000 This condition repeats for different time periods. 1,365 milliseconds, 4,165 milliseconds, 700 milliseconds, ...... You can see the LOG file I attached to better understand And on the millisecond 14002 (current_time [ms] = 14002 equals to next_call [ms]: 14002) the BSEC library issues a bsec_bme_settings.trigger_measurement condition and bme68x_get_data function is called to read data from sensor. But at this time different variables are processed and printed out as follows: current_time [ms] = 14002, next_call [ms]: 14002 timestamp bsec [ns] = 14002000000 timestamp [ns] = 14002000000 #### bsec_do_steps returned 0 IAQ = 25.000000 IAQ accuracy = 0 Co2 Equivalent = 500.000000 Breathe VOC Equivalent = 0.500000 Temperature = 28.608572 Pressure = 73786.507812 Humidity = 45.241417 Gas resistance = 80553.804688 Stabilization status = 1.000000 Run in status = 0.000000 Compensated temperature = 25.608572 Compensated humidity = 53.947281 Gas Estimate 1 = 0.250000 Gas Estimate 1 accuracy = 3 Gas Estimate 2 = 0.250000 Gas Estimate 2 accuracy = 3 Gas Estimate 3 = 0.250000 Gas Estimate 3 accuracy = 3 Gas Estimate 4 = 0.250000 Gas Estimate 4 accuracy = 3 Gas index = 9.000000 I see Compensated temperature, Compensated humidity are pretty similar to environment. I calculate Air Pressure by mysel from: Pressure at sea Level: 101,325 Pa, Ambient Temperature at 25.6°C, Aproximate Altitude over sea level at I am 2700 m and the calculation result is: 73,709.93 Pa, which is similar to the Pressure = 73,786.507812 printed out by the Firmware. I could say that the environment measurements from BME688 are close to reality. So far, so good!!! But, I am facing similar problems with IAQ value (25) and Accuracy (0). They are not changing even after several minutes executing the firmware. I don't really know too if Gas resistance, stabilization, Gas Estimate 1,2,3,4 and Gas Estimate accuracy 1,2,3,4 are good. I attach the source code I am using. The bsec_integration.c .h have all fuctions called by the firmware and they have the same logic and function calls on the Bosch BSEC library example folder (bsec.c .h source code), but in this case is on C language. I found these implementation source code on C language from: https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/Not-able-to-get-Gas-Estimate-Channel-X-from-BSEC/td-p/25462/page/2 Can you see any timing anomaly or do you think it could be timing on lower SPI communication level? Thank you and my best regards
... View more