diff --git a/data/www/dashboard.html b/data/www/dashboard.html
index af9e28a..ff5bcdb 100644
--- a/data/www/dashboard.html
+++ b/data/www/dashboard.html
@@ -31,21 +31,13 @@
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
- return response.json(); // Expect JSON response
+ return response.text(); // Changed from json() to text()
})
.then(data => {
console.log('Data received:', data);
if (!data) throw new Error('Empty response');
- let html = '';
- Object.entries(data).forEach(([key, value]) => {
- html += `
-
RAM Information
";
+String getMemoryInfoHTML() {
+ String html = "
Memory Information
";
+ html += "
Internal RAM
";
html += "
Heap Size: " + formatBytes(ESP.getHeapSize()) + "
";
html += "
Free Heap: " + formatBytes(ESP.getFreeHeap()) + "
";
html += "
Min Free Heap: " + formatBytes(ESP.getMinFreeHeap()) + "
";
html += "
Max Alloc Heap: " + formatBytes(ESP.getMaxAllocHeap()) + "
";
+
html += "
PSRAM
";
html += "
PSRAM Size: " + formatBytes(ESP.getPsramSize()) + "
";
html += "
Free PSRAM: " + formatBytes(ESP.getFreePsram()) + "
";
@@ -137,6 +137,7 @@ String getRAMInfoHTML() {
html += "
";
return html;
}
+
void printESPInfo() {
Serial.println("ESP32-S3 info");
Serial.println("Internal RAM");
diff --git a/src/esp_info.h b/src/esp_info.h
index 3d41fc0..fc42123 100644
--- a/src/esp_info.h
+++ b/src/esp_info.h
@@ -10,15 +10,14 @@ void prettyPrintBytes(size_t bytes);
String formatBytes(size_t bytes);
// Individual info getters
-String getCPUInfo();
-String getTemperatureInfo();
-String getRAMInfo();
-String getPSRAMInfo();
-String getFlashInfo();
+String getCPUInfo(); // CPU related info only
+String getTemperatureInfo(); // Temperature info
+String getMemoryInfo(); // RAM and PSRAM info
+String getFlashInfo(); // Flash memory info
// HTML generators
-String getESPInfoHTML();
-String getRAMInfoHTML();
+String getESPInfoHTML(); // Combines CPU, Temperature, and Flash info
+String getMemoryInfoHTML(); // Memory specific info (replaces getRAMInfoHTML)
// Debug print
void printESPInfo();
diff --git a/src/web_server.cpp b/src/web_server.cpp
index 8a33246..a459b55 100644
--- a/src/web_server.cpp
+++ b/src/web_server.cpp
@@ -29,7 +29,7 @@ void setupWebServer() {
// ESP Info endpoint
server.on("/api/espinfo", HTTP_GET, [](AsyncWebServerRequest *request) {
- String htmlContent = getESPInfoHTML() + getRAMInfoHTML();
+ String htmlContent = getESPInfoHTML() + getMemoryInfoHTML(); // Updated function name
AsyncWebServerResponse *response = request->beginResponse(200, "text/html", htmlContent);
request->send(response);
});