05-27-2021 05:29 PM
I am not sure, if my approach is a good one, or if I simply do not fully understand how things work, yet. It would be great, if you could give me some hints to get it working 🙂
In my use case I want to calculate the iAQ values of multiple BME680 sensors on a RaspberryPi or x86. The sensors are running on very low end Arduinos (328p) and send the raw data to the x86/RPi.
For this, I created an array of multiple BSEC objects, which I feed whenever new raw data arrive from the sensors:
My_BSEC bsec; // Array of My_BSEC, a class wrapping and managing the bsec functions (e.g. bsec_set_configuration, bsec_update_subscription, bsec_sensor_control, bsec_do_steps, ...) bsec[bsecId].calculateData(input); // one sensor is fed with new data
With following input:
bsec.calculateData(F105C79AB0000014279641C1DE6847DB23704231A17048); // sensor one is fed with new data bsec.calculateData(F105C79AB0000014279641C1DE6847DB23704231A17049); // sensor two is fed with slightly different data, but the same timestamp
... BSEC returns warning 4
// from bsec_datatypes.h: BSEC_W_DOSTEPS_TSINTRADIFFOUTOFRANGE = 4, /*!< Duplicate timestamps passed to bsec_do_steps() */)
This indicates, that altough there are two separate instances of My_BSEC in my code, the same bsec data structures are used in the background/ external library. The BSEC library has only one context.
Am I mistaken or is this wanted or expected behaviour?
Some code is attached (sorry for using the Qt framwork, it is not really a minimal example)
Solved! Go to Solution.
05-28-2021 08:33 AM
I guess you are right with the assumption that there is only one underlying data instance.
But simply feeding in the raw data of each sensor with a different unique timestamp should be an easy workaround.
06-01-2021 12:09 PM
Currently, BSEC algorithm only supported to analyse one sensor data. On SW driver side, you could read different sensors's data via I2C or SPI.
The algorithm needs to continuously analyze the data, which takes some time. It is suggested that the same instances analyze the data of one sensor.
06-01-2021 08:23 PM
thank you both for your replies. I guess I will stick to the one process one sensor approach / workaround 😕