some changes

This commit is contained in:
Dmitry Borisenko
2020-04-07 18:06:12 +02:00
parent ba30af5182
commit 285a898ba9
6 changed files with 13 additions and 22 deletions

2
FS.ino
View File

@@ -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"));

View File

@@ -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"

BIN
data/sync.ffs_db Normal file

Binary file not shown.

View File

@@ -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) {

6
set.h
View File

@@ -34,11 +34,9 @@ String last_version;
#ifdef ESP8266
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
//#include <ESPAsyncTCP.h>
#ifdef MDNS_enable
#include <ESP8266mDNS.h>
#endif
//#include <ESP8266SSDP.h>
#include <ESP8266httpUpdate.h>
#include <ESP8266HTTPUpdateServer.h>
ESP8266HTTPUpdateServer httpUpdater;
@@ -53,11 +51,8 @@ ESP8266HTTPUpdateServer httpUpdater;
#endif
#include <AsyncTCP.h>
#include <analogWrite.h>
//#include <ESP32SSDP.h>
#include <HTTPUpdate.h>
#include <HTTPClient.h>
//HTTPClient http;
//#include <rom/rtc.h>
#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.h>
WiFiUDP Udp;

View File

@@ -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());