From 285a898ba93dd244189e064f59e344e7a9f4a2ce Mon Sep 17 00:00:00 2001 From: Dmitry Borisenko <49808844+DmitryBorisenko33@users.noreply.github.com> Date: Tue, 7 Apr 2020 18:06:12 +0200 Subject: [PATCH] some changes --- FS.ino | 2 +- data/index.json | 13 +++++-------- data/sync.ffs_db | Bin 0 -> 192 bytes mqtt.ino | 12 ++++++------ set.h | 6 ------ udp.ino | 2 +- 6 files changed, 13 insertions(+), 22 deletions(-) create mode 100644 data/sync.ffs_db diff --git a/FS.ino b/FS.ino index 993c7dc8..de7080b9 100644 --- a/FS.ino +++ b/FS.ino @@ -9,7 +9,7 @@ void File_system_init() { configSetup.replace(" ", ""); configSetup.replace("\r\n", ""); Serial.println(configSetup); - jsonWriteStr(configJson, "SSDP", jsonRead(configSetup, "SSDP")); + jsonWriteStr(configJson, "name", jsonRead(configSetup, "name")); jsonWriteStr(configJson, "lang", jsonRead(configSetup, "lang")); diff --git a/data/index.json b/data/index.json index 4ac58fd4..573b5155 100644 --- a/data/index.json +++ b/data/index.json @@ -47,10 +47,7 @@ "type": "link", "title": "Список других устройств в сети", "action": "/?dev", - "class": "btn btn-block btn-warning" - }, - { - "type": "hr" + "class": "btn btn-block btn-success" }, { "type": "link", @@ -70,21 +67,21 @@ "action": "/?pushingbox", "class": "btn btn-block btn-success" }, - { - "type": "hr" - }, { "type": "h3", "name": "my-block", "style": "position:fixed;top:50%;left:50%;width:400px;margin-left:-200px;text-align:center;", "class": "hidden" }, + { + "type": "hr" + }, { "type": "button", "title": "Обновить прошивку", "action": "/check", "response": "[[my-block]]", - "class": "btn btn-block btn-success" + "class": "btn btn-block btn-danger" }, { "type": "hr" diff --git a/data/sync.ffs_db b/data/sync.ffs_db new file mode 100644 index 0000000000000000000000000000000000000000..9d3f2036de8f25cc44808fa16ddd49882b12b638 GIT binary patch literal 192 zcmZ=ON={ZQa}cXELEKn;H9ng3LhN1jHZ^ z3B<`@76U^?+~c%_1P^bW(>~|UUuG7vamY)H^U7+CbMssmS0!pZVSY>ukC30%*)yIO znTr|@`8d>tZB%eFQQo-1MW0*cD7(=H6aAek!Wl{tEDWm2(zgwP24}zxPfluRuoBZ? Y_L%FIWbD`~xp2#LQzzM;*bAn~0PuM?YXATM literal 0 HcmV?d00001 diff --git a/mqtt.ino b/mqtt.ino index 68a408e6..0d902d11 100644 --- a/mqtt.ino +++ b/mqtt.ino @@ -224,11 +224,11 @@ void sendAllWigets() { //=====================================================ОТПРАВЛЯЕМ ДАННЫЕ В ВИДЖЕТЫ ПРИ ОБНОВЛЕНИИ СТРАНИЦЫ======================================================== void sendAllData() { //берет строку json и ключи превращает в топики а значения колючей в них посылает - String current_config = configJson; //{"SSDP":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1"} + String current_config = configJson; //{"name":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1"} getMemoryLoad("[i] after send all date"); current_config.replace("{", ""); - current_config.replace("}", ""); //"SSDP":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1" - current_config += ","; //"SSDP":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1", + current_config.replace("}", ""); //"name":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1" + current_config += ","; //"name":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1", while (current_config.length() != 0) { @@ -318,10 +318,10 @@ String stateMQTT() { //----------------------------------------------------------------------------------------------------------------------------------------------- //jsonWriteStr(tmp, "status", "1"); - String current_config = configJson; //{"SSDP":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1"} + String current_config = configJson; //{"name":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1"} current_config.replace("{", ""); - current_config.replace("}", ""); //"SSDP":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1" - current_config += ","; //"SSDP":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1", + current_config.replace("}", ""); //"name":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1" + current_config += ","; //"name":"MODULES","lang":"","ip":"192.168.43.60","DS":"34.00","rel1":"1","rel2":"1", while (current_config.length() != 0) { diff --git a/set.h b/set.h index 76630a71..aa2fb388 100644 --- a/set.h +++ b/set.h @@ -34,11 +34,9 @@ String last_version; #ifdef ESP8266 #include #include -//#include #ifdef MDNS_enable #include #endif -//#include #include #include ESP8266HTTPUpdateServer httpUpdater; @@ -53,11 +51,8 @@ ESP8266HTTPUpdateServer httpUpdater; #endif #include #include -//#include #include #include -//HTTPClient http; -//#include #endif //==общие библиотеки и объекты==// @@ -83,7 +78,6 @@ TickerScheduler ts(30); enum {ROUTER_SEARCHING, WIFI_MQTT_CONNECTION_CHECK, LEVEL, ANALOG_, DALLAS, DHTT, DHTH, DHTC, DHTP, DHTD, STEPPER1, STEPPER2, ANALOG_LOG, LEVEL_LOG, DALLAS_LOG, dhtT_LOG, dhtH_LOG, CMD, TIMER_COUNTDOWN, TIMERS, TIME, TIME_SYNC, STATISTICS, UDP, UDP_DB, TEST}; //--------------------------------------------------------------- //ssl//#include "dependencies/WiFiClientSecure/WiFiClientSecure.h" //using older WiFiClientSecure -//#include "Ticker_for_TickerScheduler/Ticker/Ticker.h" //--------------------------------------------------------------- #include WiFiUDP Udp; diff --git a/udp.ino b/udp.ino index a85052f1..e3597bfb 100644 --- a/udp.ino +++ b/udp.ino @@ -32,7 +32,7 @@ void UDP_init() { ts.add(UDP, 30000, [&](void*) { if (WiFi.status() == WL_CONNECTED) { if (!udp_busy) { - String line_to_send = chipID + ";" + jsonRead(configSetup, "SSDP"); + String line_to_send = chipID + ";" + jsonRead(configSetup, "name"); #ifdef ESP8266 Udp.beginPacketMulticast(udp_multicastIP, udp_port, WiFi.localIP()); Udp.write(line_to_send.c_str());