*web Кастом Модификаторы в веб

*Адаптация под 8266 и Bk7231n
This commit is contained in:
Mit4el
2025-07-24 22:28:57 +03:00
parent 444bd6c201
commit 4195c383ee
8 changed files with 39 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -170,6 +170,14 @@
"path": "src/modules/virtual/Loging",
"active": true
},
{
"path": "src/modules/virtual/Loging2",
"active": false
},
{
"path": "src/modules/virtual/Loging3",
"active": false
},
{
"path": "src/modules/virtual/LogingDaily",
"active": true
@@ -428,7 +436,7 @@
},
{
"path": "src/modules/exec/Buzzer",
"active": true
"active": false
},
{
"path": "src/modules/exec/EctoControlAdapter",
@@ -506,6 +514,10 @@
"path": "src/modules/exec/SysExt",
"active": false
},
{
"path": "src/modules/exec/Tca9555",
"active": false
},
{
"path": "src/modules/exec/Telegram",
"active": false

View File

@@ -198,12 +198,19 @@ void handleCors() {
{
typeOTAfile = FILESYSTEM;
}
int updatePartition = (typeOTAfile == FIRMWARE)? U_FLASH : U_SPIFFS;
#ifdef ESP8266
size_t size = upload.totalSize;
int updatePartition = (typeOTAfile == FIRMWARE)? U_FLASH : U_FS; //U_FS
//#endif
#else //ESP32
size_t size = UPDATE_SIZE_UNKNOWN;
int updatePartition = (typeOTAfile == FIRMWARE)? U_FLASH : U_SPIFFS; //U_FS
#endif
if (upload.status == UPLOAD_FILE_START) {
//Serial.print("Начало загрузки: ");
//Serial.println(upload.filename);
SerialPrint("i", F("OTA"), "Начало загрузки файла: " + upload.filename);
if (!Update.begin(UPDATE_SIZE_UNKNOWN, updatePartition)) {
if (!Update.begin(size, updatePartition)) { // UPDATE_SIZE_UNKNOWN 0xFFFFFFFF
Update.end();
SerialPrint("E", F("OTA"), "Ошибка: Недостаточно памяти");
HTTP.send(500, "text/plain", "Ошибка: Недостаточно памяти");

View File

@@ -254,10 +254,18 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
// Устанавливаем время
if (settimeofday(&tv, NULL) == 0) {
//Serial.printf("Время установлено: %ld\n", unixTime);
SerialPrint("i", F("Time"), "Время установлено из браузера: " + String(unixTime));
#ifdef LIBRETINY
SerialPrint("i", F("Time"), "Время установлено из браузера: ");
#else
SerialPrint("i", F("Time"), "Время установлено из браузера: " + String(unixTime));
#endif
} else {
#ifdef LIBRETINY
//Serial.printf("Ошибка установки времени: %ld\n", unixTime);
SerialPrint("i", F("=>WS"), "Ошибка установки времени: ");
#else
SerialPrint("i", F("=>WS"), "Ошибка установки времени: " + String(unixTime));
#endif
}
// timeval tv2{0, 0};
// timezone tz = timezone{0, 0};

View File

@@ -160,7 +160,11 @@ public:
SerialPrint("E", F("LogingHourly"), "'" + id + "' db file writing error, return");
return;
}
#ifdef LIBRETINY
SerialPrint("i", F("LogingHourly"), "'" + id + "' file created http://" + ipToString(WiFi.localIP()) + path);
#else
SerialPrint("i", F("LogingHourly"), "'" + id + "' file created http://" + WiFi.localIP().toString() + path);
#endif
}
void addNewDataToExistingFile(String &path, String &logData)
@@ -171,7 +175,11 @@ public:
SerialPrint("i", F("LogingHourly"), "'" + id + "' file writing error, return");
return;
};
#ifdef LIBRETINY
SerialPrint("i", F("LogingHourly"), "'" + id + "' LogingHourly in file http://" + ipToString(WiFi.localIP()) + path);
#else
SerialPrint("i", F("LogingHourly"), "'" + id + "' LogingHourly in file http://" + WiFi.localIP().toString() + path);
#endif
}
const String getTimeLocal_hh()
{