From 76e7872eec8c60618d574be41921faa1998b06d7 Mon Sep 17 00:00:00 2001 From: Thomas Ballmann Date: Sat, 14 Mar 2020 11:15:36 +0100 Subject: [PATCH] add wifi rssi & improve json ram usage --- src/app.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.cpp b/src/app.cpp index feadf61..3f553d9 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -59,8 +59,9 @@ void setupApp() // TODO response server.on("/stats", HTTP_GET, [](AsyncWebServerRequest *request) { AsyncResponseStream *response = request->beginResponseStream("application/json"); - DynamicJsonDocument doc(1024); // TODO + DynamicJsonDocument doc(668); // https://arduinojson.org/v6/assistant/ + doc["wifi"]["rssi"] = WiFi.RSSI(); doc["wifi"]["ssid"] = WiFi.SSID(); doc["wifi"]["connected"] = WiFi.isConnected(); doc["wifi"]["ip"] = WiFi.localIP().toString();