From 5f1209671fee773958d315fd9af2447f99232510 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20K=C3=A4ppler?= <michael_kaeppler@web.de>
Date: Fri, 4 Jun 2021 20:40:34 +0200
Subject: [PATCH] co2_sensor: Do not reset sensor after startup

A soft reset of the SCD30 sensor, i.e.
calling `SCD30.reset()` was added in commit
fe023428 to force an instant update of
the measurement interval after bootup.

It seems, however, that the calibration
value is not stored if the sensor is
reset before carrying out at least one
measurement after calibration.
This breaks calibration with the current code,
because the ESP (and then the SCD30) is reset
directly after calibration.
---
 ampel-firmware/co2_sensor.cpp | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/ampel-firmware/co2_sensor.cpp b/ampel-firmware/co2_sensor.cpp
index e68b2ea..1c8fdc8 100644
--- a/ampel-firmware/co2_sensor.cpp
+++ b/ampel-firmware/co2_sensor.cpp
@@ -78,12 +78,6 @@ namespace sensor {
       ESP.restart();
     }
 
-    // Changes of the SCD30's measurement timestep do not come into effect
-    // before the next measurement takes place. That means that after a hard reset
-    // of the ESP the SCD30 sometimes needs a long time until switching back to 2 s
-    // for acclimatization. Resetting it after startup seems to fix this behaviour.
-    scd30.reset();
-
     Serial.print(F("Setting temperature offset to -"));
     Serial.print(abs(config::temperature_offset));
     Serial.println(F(" K."));
-- 
GitLab