From 1dfab33e4c01b032dbcd83a6713b1ef0ba7604dc Mon Sep 17 00:00:00 2001 From: Dmitry Borisenko <49808844+DmitryBorisenko33@users.noreply.github.com> Date: Wed, 23 Feb 2022 17:54:18 +0100 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/Global.h | 2 ++ src/DeviceList.cpp | 2 +- src/Global.cpp | 2 ++ src/WsServer.cpp | 5 +++-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/Global.h b/include/Global.h index 211c8148..b919cdec 100644 --- a/include/Global.h +++ b/include/Global.h @@ -108,6 +108,8 @@ extern unsigned long flashWriteNumber; extern unsigned long wifiUptime; +extern bool udpReceivingData; + extern String mqttRootDevice; extern String chipId; extern String prex; diff --git a/src/DeviceList.cpp b/src/DeviceList.cpp index b8a25c21..2fd5c732 100644 --- a/src/DeviceList.cpp +++ b/src/DeviceList.cpp @@ -54,7 +54,7 @@ void asyncUdpInit() { //будем отправлять каждые 30 секунд презентацию данного устройства ts.add( - UDP, 30000, [&](void*) { + UDP, 60000, [&](void*) { if (isNetworkActive()) { SerialPrint("i", F("UDP"), F("Broadcast device presentation")); asyncUdp.broadcastTo(getThisDevice().c_str(), 4210); diff --git a/src/Global.cpp b/src/Global.cpp index b99d3bf9..333d8c99 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -59,6 +59,8 @@ unsigned long flashWriteNumber = 0; unsigned long wifiUptime = 0; +bool udpReceivingData = false; + String chipId = ""; String prex = ""; String all_widgets = ""; diff --git a/src/WsServer.cpp b/src/WsServer.cpp index daea63d8..0b4dd2ad 100644 --- a/src/WsServer.cpp +++ b/src/WsServer.cpp @@ -68,8 +68,8 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length) //**сохранение**// if (headerStr == "/gifnoc|") { writeFileUint8tByFrames("config.json", payload, length, headerLenth, 256); - //clearConfigure(); - configure("/config.json"); + // clearConfigure(); + // configure("/config.json"); } //**сохранение**// if (headerStr == "/tuoyal|") { @@ -134,6 +134,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length) if (headerStr == "/update|") { upgrade_firmware(3); } + } break; case WStype_BIN: {