From 4f0a87a0a5ae3b4e738662eaf7c994fe68cb5f59 Mon Sep 17 00:00:00 2001 From: Shawn A Date: Wed, 12 Sep 2018 13:19:53 -0500 Subject: [PATCH] adds esp32 core temp, not enabled the core temp sensors are not calibrated in production atm, they are large offsets form chip to chip and are useful for relative temp swings only. Until the IDF comes up with a new temp sense, this is commented out. --- WiFiManager.cpp | 9 +++++++++ strings_en.h | 1 + 2 files changed, 10 insertions(+) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index e92c1ee..2cb5dd4 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -1408,6 +1408,7 @@ void WiFiManager::handleInfo() { F("cpufreq"), F("freeheap"), F("lastreset"), + // F("temp"), F("wifihead"), F("apip"), F("apmac"), @@ -1617,6 +1618,14 @@ String WiFiManager::getInfoData(String id){ p.replace(FPSTR(T_1),WiFi.getAutoConnect() ? FPSTR(S_enable) : FPSTR(S_disable)); } #endif + #ifdef ESP32 + else if(id==F("temp")){ + // temperature is not calibrated, varying large offsets are present, use for relative temp changes only + p = FPSTR(HTTP_INFO_temp); + p.replace(FPSTR(T_1),(String)temperatureRead()); + p.replace(FPSTR(T_2),(String)((temperatureRead()+32)*1.8)); + } + #endif return p; } diff --git a/strings_en.h b/strings_en.h index edbc84e..21f3f2b 100644 --- a/strings_en.h +++ b/strings_en.h @@ -166,6 +166,7 @@ const char HTTP_INFO_host[] PROGMEM = "
Hostname
{1}
"; const char HTTP_INFO_stamac[] PROGMEM = "
Station MAC
{1}
"; const char HTTP_INFO_conx[] PROGMEM = "
Connected
{1}
"; const char HTTP_INFO_autoconx[] PROGMEM = "
Autoconnect
{1}
"; +const char HTTP_INFO_temp[] PROGMEM = "
Temperature
{1} C° / {2} F°
"; // Strings const char S_y[] PROGMEM = "Yes";