Working on getting diagnostics working
This commit is contained in:
@@ -128,6 +128,7 @@ Firmware Version: <div id="firmware_version">Loading...</div>
|
||||
void WebService::broadcastState()
|
||||
{
|
||||
DiagnosticSample diagnostics = diagnosticsState.getCurrent();
|
||||
Serial.println(diagnostics.freeHeap);
|
||||
String json = "{";
|
||||
|
||||
// Opening system tag:
|
||||
@@ -148,6 +149,7 @@ void WebService::broadcastState()
|
||||
|
||||
json += "\"free_heap\":\"";
|
||||
json += diagnostics.freeHeap;
|
||||
//json += ESP.getFreeHeap();
|
||||
json += "\",";
|
||||
|
||||
json += "\"minimum_free_heap\":\"";
|
||||
@@ -165,7 +167,7 @@ void WebService::broadcastState()
|
||||
json += "}";
|
||||
|
||||
|
||||
Serial.println(json);
|
||||
//Serial.println(json);
|
||||
webSocket.broadcastTXT(json);
|
||||
}
|
||||
|
||||
@@ -179,6 +181,16 @@ void WebService::begin() {
|
||||
);
|
||||
});
|
||||
|
||||
#ifdef DEBUGGING
|
||||
// Prints out paths that are requested but not found.
|
||||
server.onNotFound([this]() {
|
||||
Serial.print("HTTP not found: ");
|
||||
Serial.println(server.uri());
|
||||
|
||||
server.send(404, "text/plain", "Not found");
|
||||
});
|
||||
#endif
|
||||
|
||||
server.begin();
|
||||
|
||||
webSocket.begin();
|
||||
|
||||
Reference in New Issue
Block a user