mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
event onWifi
This commit is contained in:
@@ -178,7 +178,7 @@ void IoTItem::checkIntFromNet() {
|
||||
if (_intFromNet >= 0) {
|
||||
// если время жизни истекло, то удаляем элемент чуть позже на следующем такте loop
|
||||
// если это было уведомление не об ошибке или начале работы, то сообщаем, что сетевое событие давно не приходило
|
||||
if (_intFromNet == 0 && _id.indexOf("onError") == -1 && _id.indexOf("onStart") == -1 && _id.indexOf("onInit") == -1) {
|
||||
if (_intFromNet == 0 && _id.indexOf("onError") == -1 && _id.indexOf("onStart") == -1 && _id.indexOf("onInit") == -1 && _id.indexOf("onWifi") == -1) {
|
||||
SerialPrint("E", _id, "The new data did not come from the network. The level of trust is low.", _id);
|
||||
}
|
||||
_intFromNet--;
|
||||
|
||||
@@ -46,6 +46,7 @@ void WiFiEvent(arduino_event_t *event)
|
||||
SerialPrint("i", "WIFI", "http://" + WiFi.localIP().toString());
|
||||
jsonWriteStr(settingsFlashJson, "ip", WiFi.localIP().toString());
|
||||
#endif
|
||||
createItemFromNet("onWifi", "1", 1);
|
||||
// запускаем MQTT
|
||||
mqttInit();
|
||||
SerialPrint("i", F("WIFI"), F("Network Init"));
|
||||
@@ -380,7 +381,7 @@ void routerConnect()
|
||||
SerialPrint("i", "WIFI", "http://" + WiFi.localIP().toString());
|
||||
jsonWriteStr(settingsFlashJson, "ip", WiFi.localIP().toString());
|
||||
#endif
|
||||
|
||||
createItemFromNet("onWifi", "1", 1);
|
||||
mqttInit();
|
||||
}
|
||||
SerialPrint("i", F("WIFI"), F("Network Init"));
|
||||
|
||||
Reference in New Issue
Block a user