I am using the latest version of BSEC2.0.61, with BME680 on a raspberry pi zero w. I am using BME68x c interface (from github) and feed the data into BSEC per request (I use timing from next_call), on LP speed. I am using the bsec_config_iaq from bsec_serialized_configurations_iaq.c for bsec_set_configuration. There are no erros from any BME or BSEC calls. BME680 gets reset and passes self-test on every start. However the issue is that STATIC_IAQ accuracy never rises above 1. It goes from 0->1 in about 5 minutes and stays there for at least a day. I feed 5 sensors into do_steps: temperature, heat_source (0.3c), humidity,pressure and gas_resistance. I verified that temperature, humidity, pressure are all valid (even though accuracy of them always stays at 0?). I have 4 other sensors in this device and they all report nearly identical values for temp, humidity and pressure. The source code is available here, with link pointing towards my "glue" file: https://github.com/shadowpho/OutsideSensor/blob/master/BSECglue.cpp The whole BSEC_BME runs in it's own thread. Here is the thread (from main.cpp). As you can see we run the init, then run the loop as needed (and add the output to mutex-protected storage space if it's valid). void BME680_loop(CMA_Data* obj, CMA_Data* obj2)
{
BSEC_BME_init();
float temp, pressure, humidity, VOC;
while (1) {
int ret = BSEC_BME_loop(&temp, &pressure, &humidity, &VOC);
if (ret != 0) { printf("BME/BSEC LOOP FAIL!!! %i\n", ret); }
if (!std::isnan(temp)) add_to_CMA(obj, temp, pressure, humidity, 0);
if (!std::isnan(VOC)) add_to_CMA(obj2, VOC, 0, 0, 0);
sleep_us(BSEC_desired_sleep_us());
}
} How can I debug this? What am I doing wrong with it? How can I debug? It's a bit painful because there are no good examples for raspberry pi.
... View more