Add CPU temperature monitoring in Webserver

This commit is contained in:
Daniel Öster 2025-04-12 19:06:41 +03:00
parent a326a417c0
commit 50fbaf252d
3 changed files with 6 additions and 1 deletions

View file

@ -336,6 +336,9 @@ void check_interconnect_available() {
#endif // DOUBLE_BATTERY #endif // DOUBLE_BATTERY
void update_calculated_values() { void update_calculated_values() {
/* Update CPU temperature*/
datalayer.system.info.CPU_temperature = temperatureRead();
/* Calculate allowed charge/discharge currents*/ /* Calculate allowed charge/discharge currents*/
if (datalayer.battery.status.voltage_dV > 10) { if (datalayer.battery.status.voltage_dV > 10) {
// Only update value when we have voltage available to avoid div0. TODO: This should be based on nominal voltage // Only update value when we have voltage available to avoid div0. TODO: This should be based on nominal voltage

View file

@ -215,6 +215,8 @@ typedef struct {
} DATALAYER_SHUNT_TYPE; } DATALAYER_SHUNT_TYPE;
typedef struct { typedef struct {
/** ESP32 main CPU temperature, for displaying on webserver and for safeties */
float CPU_temperature = 0;
/** array with type of battery used, for displaying on webserver */ /** array with type of battery used, for displaying on webserver */
char battery_protocol[64] = {0}; char battery_protocol[64] = {0};
/** array with type of inverter protocol used, for displaying on webserver */ /** array with type of inverter protocol used, for displaying on webserver */

View file

@ -928,7 +928,7 @@ String processor(const String& var) {
#ifdef HW_STARK #ifdef HW_STARK
content += " Hardware: Stark CMR Module"; content += " Hardware: Stark CMR Module";
#endif // HW_STARK #endif // HW_STARK
content += "</h4>"; content += " @ " + String(datalayer.system.info.CPU_temperature, 1) + " &deg;C</h4>";
content += "<h4>Uptime: " + uptime_formatter::getUptime() + "</h4>"; content += "<h4>Uptime: " + uptime_formatter::getUptime() + "</h4>";
#ifdef FUNCTION_TIME_MEASUREMENT #ifdef FUNCTION_TIME_MEASUREMENT
// Load information // Load information