Nextion, VerifyOTA? RollBackConfig

This commit is contained in:
Mit4el
2024-09-20 12:05:34 +03:00
parent 3919e5a0ab
commit d6a24b1837
13 changed files with 386 additions and 232 deletions

View File

@@ -125,8 +125,6 @@ namespace _Broker
}
}
bool _debug;
class BrokerMQTT : public IoTItem
{
private:
@@ -134,7 +132,7 @@ namespace _Broker
int _port = 0;
String _user;
String _pass;
//bool _debug;
bool _debug;
bool _brige;
String _server;
String _srvUser;

View File

@@ -11,6 +11,7 @@
#ifdef ESP8266
#define FB_DYNAMIC
#endif
#include <FastBot.h>
#include <map>
@@ -94,8 +95,8 @@ public:
_myBot->tick();
if (fl_rollback)
{
_myBot->tickManual(); // Чтобы отметить сообщение прочитанным
#ifdef ESP32
_myBot->tickManual(); // Чтобы отметить сообщение прочитанным
if (Update.rollBack())
{
SerialPrint("I", F("Update"), F("Откат OTA успешно выполнен"));
@@ -107,6 +108,9 @@ public:
SerialPrint("E", F("Update"), F("Откат OTA не выполнен!"));
_myBot->sendMessage("Откат OTA не выполнен!", _chatID);
}
#else
SerialPrint("I", F("Update"), F("Откат OTA только в ESP32"));
_myBot->sendMessage("Откат OTA поддерживается только в ESP32", _chatID);
#endif
}
// была попытка OTA обновления. Обновляемся после ответа серверу!