исправление ошики с округлением логирования

This commit is contained in:
Dmitry Borisenko
2022-09-19 01:41:15 +02:00
parent 3eb2d40596
commit f7e459cab4
9 changed files with 21 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>IoT Manager 4.3.0</title>
<title>IoT Manager 4.3.1</title>
<link rel="icon" type="image/png" href="/favicon.ico" />
<link rel="stylesheet" href="/build/bundle.css" />

View File

@@ -45,3 +45,4 @@ extern const String getUniqueId(const char* name);
extern uint32_t ESP_getChipId(void);
extern uint32_t ESP_getFlashChipId(void);
extern const String getMacAddress();
extern const String getWebVersion();

View File

@@ -48,6 +48,14 @@ const String getUniqueId(const char* name) {
return String(name) + getMacAddress();
}
const String getWebVersion() {
String text = readFile("/index.html", 2000);
text = selectFromMarkerToMarker(text, "title", 1);
text = selectFromMarkerToMarker(text, " ", 2);
text.replace("</", "");
return text;
}
uint32_t ESP_getChipId(void) {
#ifdef ESP32
uint32_t id = 0;

View File

@@ -16,10 +16,15 @@ void setup() {
Serial.println(F("--------------started----------------"));
//создание экземпляров классов
myNotAsyncActions = new NotAsync(do_LAST);
// myNotAsyncActions = new NotAsync(do_LAST);
//инициализация файловой системы
fileSystemInit();
Serial.println(F("------------------------"));
Serial.println("FIRMWARE NAME " + String(FIRMWARE_NAME));
Serial.println("FIRMWARE VERSION " + String(FIRMWARE_VERSION));
Serial.println("WEB VERSION " + getWebVersion());
Serial.println(F("------------------------"));
//получение chip id
setChipId();

View File

@@ -3,7 +3,7 @@
void periodicTasksInit() {
//задачи редкого выполнения
ts.add(
PTASK, 1000 * 30, [&](void*) {
PTASK, 1000 * 60, [&](void*) {
// fs
getFSInfo();
// heap
@@ -22,6 +22,7 @@ void periodicTasksInit() {
// build ver
jsonWriteStr_(errorsHeapJson, F("bver"), String(FIRMWARE_VERSION));
jsonWriteStr_(errorsHeapJson, F("bn"), String(FIRMWARE_NAME));
jsonWriteStr_(errorsHeapJson, F("wver"), getWebVersion());
// reset reason
jsonWriteStr_(errorsHeapJson, F("rst"), ESP_getResetReason());
periodicWsSend();

View File

@@ -48,7 +48,8 @@ bool upgradeFS() {
#endif
#ifdef ESP32
httpUpdate.rebootOnUpdate(false);
HTTPUpdateResult retFS = httpUpdate.updateSpiffs(wifiClient, getBinPath("spiffs.bin"));
//обновляем little fs с помощью метода обновления spiffs
HTTPUpdateResult retFS = httpUpdate.updateSpiffs(wifiClient, getBinPath("littlefs.bin"));
#endif
//если FS обновилась успешно

View File

@@ -67,7 +67,7 @@ class Loging : public IoTItem {
String logData;
jsonWriteInt(logData, "x", unixTime);
jsonWriteInt(logData, "y1", value.toFloat());
jsonWriteFloat(logData, "y1", value.toFloat());
//прочитаем путь к файлу последнего сохранения
String filePath = readDataDB(id);