ввел в работу mqtt

This commit is contained in:
Dmitry Borisenko
2022-01-15 19:11:01 +01:00
parent a9c07e8865
commit 7f5b78b695
3 changed files with 18 additions and 1 deletions

View File

@@ -7,5 +7,15 @@
"timezone": 1, "timezone": 1,
"ntp": "pool.ntp.org", "ntp": "pool.ntp.org",
"weblogin": "admin", "weblogin": "admin",
"webpass": "admin" "webpass": "admin",
"mqttServer": "m2.wqtt.ru",
"mqttPort": 8021,
"mqttPrefix": "/ver4test",
"mqttUser": "rise",
"mqttPass": "hostel3333",
"mqttServer2": "",
"mqttPort2": 0,
"mqttPrefix2": "",
"mqttUser2": "",
"mqttPass2": ""
} }

View File

@@ -8,3 +8,4 @@
#include "classes/SendJson.h" #include "classes/SendJson.h"
#include "classes/NotAsync.h" #include "classes/NotAsync.h"
#include "ESPConfiguration.h" #include "ESPConfiguration.h"
#include "MqttClient.h"

View File

@@ -34,6 +34,9 @@ void setup() {
standWebSocketsInit(); standWebSocketsInit();
#endif #endif
//инициализация mqtt
mqttInit();
//создаем объект класса выгружающего json массив из файла //создаем объект класса выгружающего json массив из файла
mySendJson = new SendJson; mySendJson = new SendJson;
@@ -70,6 +73,9 @@ void loop() {
standWebSocket.loop(); standWebSocket.loop();
#endif #endif
//обновление mqtt
mqttLoop();
for (unsigned int i = 0; i < iotSensors.size(); i++) { for (unsigned int i = 0; i < iotSensors.size(); i++) {
iotSensors[i]->loop(); iotSensors[i]->loop();
} }