From 703edb7d5f1ab340cc578e031868125ab67a2297 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 ESP after calibration

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 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ampel-firmware/co2_sensor.cpp b/ampel-firmware/co2_sensor.cpp
index e68b2ea..5f293d1 100644
--- a/ampel-firmware/co2_sensor.cpp
+++ b/ampel-firmware/co2_sensor.cpp
@@ -163,7 +163,6 @@ namespace sensor {
     scd30.setForcedRecalibrationFactor(config::co2_calibration_level);
     Serial.println(F(" Done!"));
     Serial.println(F("Sensor calibrated."));
-    ESP.restart(); // softer than ESP.reset
   }
 
   void logToSerial() {
-- 
GitLab