diff --git a/src/Main.cpp b/src/Main.cpp index 3ffb623f..6961e6a1 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -89,7 +89,7 @@ void setup() { iotScen.loadScenario("/scenario.txt"); // создаем событие завершения конфигурирования для возможности выполнения блока кода при загрузке - createItemFromNet("onStart", "1", 1); + createItemFromNet("onStart", "1", -4); stInit(); @@ -105,6 +105,8 @@ void setup() { // проверяем все элементы на тухлость for (std::list::iterator it = IoTItems.begin(); it != IoTItems.end(); ++it) { (*it)->checkIntFromNet(); + + Serial.printf("[ITEM] size: %d, id: %s, int: %d, intnet: %d\n", sizeof(**it), (*it)->getID(), (*it)->getInterval(), (*it)->getIntFromNet()); } }, nullptr, true); @@ -162,10 +164,10 @@ void loop() { handleOrder(); handleEvent(); -#ifdef LOOP_DEBUG - loopPeriod = millis() - st; - if (loopPeriod > 2) Serial.println(loopPeriod); -#endif +// #ifdef LOOP_DEBUG +// loopPeriod = millis() - st; +// if (loopPeriod > 2) Serial.println(loopPeriod); +// #endif } //отправка json diff --git a/src/WsServer.cpp b/src/WsServer.cpp index ca80bde8..a3901634 100644 --- a/src/WsServer.cpp +++ b/src/WsServer.cpp @@ -113,7 +113,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length) configure("/config.json"); iotScen.loadScenario("/scenario.txt"); // создаем событие завершения конфигурирования для возможности выполнения блока кода при загрузке - createItemFromNet("onStart", "1", 1); + createItemFromNet("onStart", "1", -4); } //----------------------------------------------------------------------// diff --git a/src/utils/SerialPrint.cpp b/src/utils/SerialPrint.cpp index 60cc41e1..e633df9c 100644 --- a/src/utils/SerialPrint.cpp +++ b/src/utils/SerialPrint.cpp @@ -23,9 +23,9 @@ void SerialPrint(const String& errorLevel, const String& module, const String& m cleanString(tosend); // создаем событие об ошибке для возможной реакции в сценарии if (itemId != "") { - createItemFromNet(itemId + "_onError", tosend, 2); + createItemFromNet(itemId + "_onError", tosend, -4); } else { - createItemFromNet("onError", tosend, 2); + createItemFromNet("onError", tosend, -4); } }