@user001 wrote:
I guess I don't understand how to set the 5min config in "basic_config_state.ino".
The config file is one thing, but you need to inform the Arduino library that you want to run in ULP mode too. This is done by simpling updating this line:
iaqSensor.updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_LP);
into:
iaqSensor.updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_ULP);
@user001 wrote:
I also tried to add/remove a connection to a server so I can save my data (which probably adds delay and makes my interval between my measurement unstable).
This is a known issue, and especially with all the ESP users around 😉 BSEC requires precising timings, and if the WiFi (for the ESP8266) needs to (re)connect, it is most likely to generate timing violations. I understand that you initial goal was to refresh at most every 60seconds, but I would strongly recommend to use BSEC's ULP mode instead, with 300s of sampling period. In this mode the measurement and BSEC operation take just a few seconds, which leaves some minutes to do any other actions, such as WiFi connections/transmissions.
@user001 wrote:
But I still get the BME680 warning code : 2 and BME680 error code : -2 and I even get BSEC warning code : 100 and BSEC error code : -2
○ BSEC Error code : -2 = "BSEC_E_DOSTEPS_VALUELIMITS" which means the value of the input (physical) sensor signal passed to bsec_do_steps() is not in the valid range.The solution proposed here is a fix in the code but I already have it.
○ BSEC warning code : 100 = "BSEC_W_SC_CALL_TIMING_VIOLATION " : Difference between actual and defined sampling intervals of bsec_sensor_control() greater than allowed
Please note that BME680 warning/error codes are different than BSEC warning/error codes. In you case, it seems that you have "BME680 error code : -2" which is typically cause by communication failures. If this only happens from time to time, I would make sure that you have proper sensor connections, and that no other components/tasks may interfere with communication to the BME680 (e.g. any other components on the bus?).
@user001 wrote:
I found a way to step this up with my NodeMU esp8266 and the ticker library.
Sounds good. If you follow my recommendation to use ULP mode, don't forget to update your timeout periods accordingly. Also note that if you switch to ULP mode, I am confident that you could put the data printout/transmission in the same scope right after running BSEC.
PS: On a side note, I have heard that in some case it is better to add at least a 'delay(1);' rather that leaving your loop() function empty, to improve the stability of your program.