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: {