From 606f4163d4f4e31dbcfc26eee9f9c388be274ce2 Mon Sep 17 00:00:00 2001 From: Jonny Date: Tue, 22 Jul 2025 05:49:56 +0100 Subject: [PATCH] Ignore erroneous 53.3c CPU temperature value that ESP32 often returns --- Software/Software.ino | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Software/Software.ino b/Software/Software.ino index dcbc4502..0fee32e9 100644 --- a/Software/Software.ino +++ b/Software/Software.ino @@ -361,7 +361,14 @@ void check_interconnect_available() { void update_calculated_values() { /* Update CPU temperature*/ - datalayer.system.info.CPU_temperature = temperatureRead(); + union { + float temp; + uint32_t hex; + } temp = {.temp = temperatureRead()}; + if (temp.hex != 0x42555555) { + // Ignoring erroneous temperature value that ESP32 sometimes returns + datalayer.system.info.CPU_temperature = temp.temp; + } /* Calculate allowed charge/discharge currents*/ if (datalayer.battery.status.voltage_dV > 10) {