From 89751c4d860b788b856cec9638073c3637577ab7 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 8 Oct 2021 15:33:13 +0200 Subject: [PATCH] Fix ESP32 temperature jump on some devices Fix ESP32 temperature jump on some devices like Sonoff DualR3 --- tasmota/support_esp.ino | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasmota/support_esp.ino b/tasmota/support_esp.ino index 748d71c64..4a6c2c53b 100644 --- a/tasmota/support_esp.ino +++ b/tasmota/support_esp.ino @@ -478,7 +478,10 @@ void *special_calloc(size_t num, size_t size) { float CpuTemperature(void) { #ifdef CONFIG_IDF_TARGET_ESP32 - return (float)temperatureRead(); // In Celsius +// return (float)temperatureRead(); // In Celsius + float t = (float)temperatureRead(); // In Celsius + if (t > 81) { t = t - 27.2; } // Fix temp jump observed on some ESP32 like DualR3 + return t; #else // Currently (20210801) repeated calls to temperatureRead() on ESP32C3 and ESP32S2 result in IDF error messages static float t = NAN;