I have to correct my statement.The code above is not a solution for the main case - it may work if the state_save / state_load functions will work with right values. It seems (as previously suspected) that the saved (or loaded) values are not correct and the following calculated results from sensor will be wrong. We can see in the values that the IAQ estimated it wrong after restart. Gas resistance is also in same range as before loading the saved values. There is a high difference between static IAQ and estimated IAQ. Sensor below was running before restarting for 15hours without any drops in values (saving state every 3 hours without reload). So - it seems there is no workaround - I think it should be fixed by the Bosch development team - and in the meantime we should work without the state_load() function and wait some time for calibration after restarting device (what should not be a major problem in most cases) Time, device, Timestamp, gas/Ohm, IAQ, IAQ accur., temp/°C, hum./%, staticIaq, co2Eq., VocEq.
Feb 21 08:32:16 ,BME680-2, 53998825, 180600.64, 65.05, 1, 21.70, 35.04, 42.50, 569.98, 0.65
Feb 21 08:32:19 ,BME680-2, 54001825, 179242.75, 67.62, 1, 21.70, 35.07, 43.62, 574.46, 0.66
Feb 21 08:32:19 ,BME680-2, Writing state to EEPROM
...
Feb 21 08:38:58 ,BME680-2, 54400824, 182776.56, 76.45, 1, 21.38, 34.60, 47.48, 589.90, 0.70
...
Feb 21 08:39:46 ,BME680-2, Begin OTA
Feb 21 08:39:56 ,BME680-2, End OTA
Feb 21 08:40:07 ,BME680-2, Begin (setup)
Feb 21 08:40:07 ,BME680-2, Reading state from EEPROM
Feb 21 08:40:07 ,BME680-2, 10909, 193847.34, 67.62, 0, 21.43, 35.82, 32.31, 529.25, 0.56
Feb 21 08:40:10 ,BME680-2, 13909, 180016.17, 67.66, 0, 21.34, 35.92, 36.16, 544.63, 0.59
Feb 21 08:40:13 ,BME680-2, 16909, 180992.41, 67.79, 0, 21.36, 35.77, 37.99, 551.97, 0.61
...
Feb 21 08:43:37 ,BME680-2, 220909, 184596.23, 279.48, 0, 21.31, 35.10, 42.11, 568.44, 0.65
...
Feb 21 08:45:04 ,BME680-2, 307909, 183580.86, 491.39, 0, 21.35, 35.05, 41.80, 567.21, 0.64
Feb 21 08:45:07 ,BME680-2, 310909, 184392.28, 500.00, 0, 21.35, 35.05, 41.27, 565.10, 0.64
Feb 21 08:45:10 ,BME680-2, 313909, 184188.73, 250.00, 2, 21.34, 35.03, 41.09, 564.36, 0.64
Feb 21 08:45:13 ,BME680-2, 316909, 184596.23, 243.53, 2, 21.34, 35.02, 40.63, 562.51, 0.63
Feb 21 08:45:16 ,BME680-2, 319909, 183783.05, 248.75, 3, 21.34, 35.01, 41.00, 564.00, 0.64
Feb 21 08:45:19 ,BME680-2, 322909, 183985.67, 250.08, 2, 21.34, 35.00, 41.09, 564.38, 0.64
Feb 21 08:45:22 ,BME680-2, 325908, 184596.23, 243.84, 2, 21.34, 35.01, 40.65, 562.59, 0.63
Feb 21 08:45:25 ,BME680-2, 328909, 184596.23, 239.39, 3, 21.34, 35.02, 40.33, 561.32, 0.63
Feb 21 08:45:28 ,BME680-2, 331909, 184188.73, 241.16, 3, 21.34, 35.03, 40.46, 561.82, 0.63
Feb 21 08:45:31 ,BME680-2, 334908, 184800.67, 235.07, 3, 21.35, 35.01, 40.02, 560.08, 0.63
Feb 21 08:45:34 ,BME680-2, 337909, 185210.88, 226.09, 3, 21.34, 35.01, 39.38, 557.51, 0.62
Feb 21 08:45:37 ,BME680-2, 340909, 184800.67, 224.77, 3, 21.34, 35.01, 39.28, 557.13, 0.62
...
Feb 21 08:55:40 ,BME680-2, 943912, 185517.63, 237.61, 3, 20.44, 36.63, 40.09, 560.38, 0.63
Feb 21 08:55:43 ,BME680-2, 946912, 183379.13, 261.80, 2, 20.44, 36.62, 41.81, 567.25, 0.64
Feb 21 08:55:46 ,BME680-2, 949912, 185412.78, 254.57, 2, 20.42, 36.62, 41.30, 565.19, 0.64
...
Feb 21 09:00:07 ,BME680-2, 1210912, 186036.78, 57.29, 3, 20.91, 36.71, 27.29, 509.14, 0.52
Feb 21 09:00:10 ,BME680-2, 1213912, 185829.63, 58.87, 3, 20.91, 36.70, 27.40, 509.59, 0.52
...
Feb 21 09:03:31 ,BME680-2, 1414912, 186036.78, 27.54, 3, 21.28, 36.21, 25.18, 500.72, 0.50
Feb 21 09:03:34 ,BME680-2, 1417912, 186244.42, 23.42, 2, 21.28, 36.22, 24.89, 499.55, 0.50
Feb 21 09:03:37 ,BME680-2, 1420912, 186036.78, 22.90, 2, 21.29, 36.17, 24.85, 499.41, 0.50
Feb 21 09:03:40 ,BME680-2, 1423911, 184890.38, 36.05, 2, 21.30, 36.18, 25.78, 503.12, 0.51
...
Feb 21 09:06:31 ,BME680-2, 1594911, 185308.06, 10.38, 2, 21.51, 35.95, 23.97, 495.88, 0.49
Feb 21 09:06:34 ,BME680-2, 1597912, 186244.42, 0.50, 2, 21.51, 35.94, 23.27, 493.10, 0.49
Feb 21 09:06:37 ,BME680-2, 1600912, 186244.42, 0.00, 2, 21.52, 35.93, 22.78, 491.12, 0.48
Feb 21 09:06:40 ,BME680-2, 1603911, 185210.88, 0.94, 2, 21.53, 35.92, 23.31, 493.22, 0.49
Feb 21 09:06:43 ,BME680-2, 1606912, 185203.47, 5.95, 2, 21.52, 35.95, 23.66, 494.63, 0.49
Feb 21 09:06:46 ,BME680-2, 1609911, 185005.55, 11.71, 2, 21.52, 35.95, 24.06, 496.25, 0.49
Feb 21 09:06:49 ,BME680-2, 1612912, 184786.25, 18.21, 2, 21.53, 35.92, 24.52, 498.09, 0.50
Feb 21 09:06:52 ,BME680-2, 1615912, 186452.52, 2.48, 2, 21.53, 35.93, 23.41, 493.65, 0.49
Feb 21 09:06:55 ,BME680-2, 1618911, 186244.42, 0.00, 2, 21.54, 35.93, 22.82, 491.27, 0.48
Feb 21 09:06:58 ,BME680-2, 1621912, 185622.91, 0.00, 2, 21.54, 35.90, 22.92, 491.69, 0.48
...
Feb 21 09:09:25 ,BME680-2, 1768913, 184994.64, 0.00, 2, 21.70, 35.73, 22.03, 488.10, 0.48
Feb 21 09:09:28 ,BME680-2, 1771913, 186244.42, 0.00, 2, 21.70, 35.71, 21.36, 485.43, 0.47
Feb 21 09:09:31 ,BME680-2, 1774912, 186036.78, 0.00, 2, 21.70, 35.71, 21.07, 484.28, 0.47
... View more