mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-05-19 10:32:56 +00:00
Added cpuTemperature
This commit is contained in:
parent
2fd3a76fa6
commit
ceb3ce47ee
2 changed files with 9 additions and 0 deletions
|
@ -1,5 +1,12 @@
|
|||
#include "status.h"
|
||||
|
||||
float getTemperature()
|
||||
{
|
||||
float tempC = -1.0f;
|
||||
temp_sensor_read_celsius(&tempC);
|
||||
return tempC;
|
||||
}
|
||||
|
||||
int8_t getWiFiStrength()
|
||||
{
|
||||
try
|
||||
|
@ -22,6 +29,7 @@ void onGetStatus(AsyncWebServerRequest *request)
|
|||
doc["chip"]["revision"] = ESP.getChipRevision();
|
||||
doc["chip"]["cpuFreqMHz"] = ESP.getCpuFreqMHz();
|
||||
doc["chip"]["cycleCount"] = ESP.getCycleCount();
|
||||
doc["chip"]["tempC"] = getTemperature();
|
||||
doc["sdkVersion"] = ESP.getSdkVersion();
|
||||
doc["sketch"]["size"] = ESP.getSketchSize();
|
||||
doc["sketch"]["md5"] = ESP.getSketchMD5();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <AsyncWebServer_ESP32_W5500.h>
|
||||
#include <ArduinoJson.h>
|
||||
#include <driver/temp_sensor.h>
|
||||
|
||||
void onGetStatus(AsyncWebServerRequest *request);
|
Loading…
Add table
Reference in a new issue