обновленный веб

This commit is contained in:
Dmitry Borisenko
2022-02-07 23:49:29 +01:00
parent d9ab7ed1b7
commit 9b5a87bbcf
5 changed files with 9967 additions and 8 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,14 @@ void addThisDeviceToList() {
jsonWriteStr_(devListJson, "ip", jsonReadStr(settingsFlashJson, "ip")); jsonWriteStr_(devListJson, "ip", jsonReadStr(settingsFlashJson, "ip"));
jsonWriteStr_(devListJson, "id", jsonReadStr(settingsFlashJson, "id")); jsonWriteStr_(devListJson, "id", jsonReadStr(settingsFlashJson, "id"));
jsonWriteStr_(devListJson, "name", jsonReadStr(settingsFlashJson, "name")); jsonWriteStr_(devListJson, "name", jsonReadStr(settingsFlashJson, "name"));
jsonWriteBool_(devListJson, "status", true);
devListJson = devListJson + ",";
String test;
jsonWriteStr_(test, "ip", "192.168.88.88");
jsonWriteStr_(test, "id", "123456789");
jsonWriteStr_(test, "name", "test");
devListJson = devListJson + test;
devListJson = "[" + devListJson + "]"; devListJson = "[" + devListJson + "]";
Serial.println(devListJson); Serial.println(devListJson);
} }

View File

@@ -48,7 +48,7 @@ void setup() {
configure("/config.json"); configure("/config.json");
//создали задачу которая будет выполняться каждые 30 секунд //задачи редкого выполнения
ts.add( ts.add(
MYTEST, 1000 * 30, [&](void*) { MYTEST, 1000 * 30, [&](void*) {
SerialPrint(F("i"), F("HEAP"), prettyBytes(ESP.getFreeHeap())); SerialPrint(F("i"), F("HEAP"), prettyBytes(ESP.getFreeHeap()));

View File

@@ -62,8 +62,8 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
} }
// list =================================================================== // list ===================================================================
if (headerStr == "/list") { if (headerStr == "/list") {
// standWebSocket.sendTXT(num, devListJson); standWebSocket.sendTXT(num, devListJson);
// sendFileToWs("/settings.json", num, 1024); sendFileToWs("/settings.json", num, 1024);
} }
} break; } break;