обмен данными меджу флешь esp и веб страничкой

This commit is contained in:
Dmitry Borisenko
2021-12-25 01:52:25 +01:00
parent 11120a873f
commit 954192e5f9
3 changed files with 8 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -12,6 +12,8 @@
#define STANDARD_WEB_SERVER
#define STANDARD_WEB_SOCKETS
//#define REST_FILE_OPERATIONS
#ifdef esp8266_4mb
#define USE_LITTLEFS true
#endif

View File

@@ -214,6 +214,11 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
if (myStreamJsonArray) myStreamJsonArray->sendFile("/config.json", num);
}
if (payloadStr.startsWith("/changed")) {
payloadStr.replace("/changed", "");
writeFile(F("config.json"), payloadStr);
}
// send message to client
// standWebSocket.sendTXT(num, "message here");