diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index db44a66fc..97513fc8f 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -11,6 +11,7 @@ - heatpump max power [#1475](https://github.com/emsesp/EMS-ESP32/issues/1475) - checkbox for MQTT-TLS enable [#1474](https://github.com/emsesp/EMS-ESP32/issues/1474) - added SK (Slovencina) language. Thanks @misa1515 +- CPU info [#1497](https://github.com/emsesp/EMS-ESP32/pull/1497) ## Fixed diff --git a/interface/src/framework/system/SystemStatusForm.tsx b/interface/src/framework/system/SystemStatusForm.tsx index a6c24c993..3da021afe 100644 --- a/interface/src/framework/system/SystemStatusForm.tsx +++ b/interface/src/framework/system/SystemStatusForm.tsx @@ -1,6 +1,7 @@ import AppsIcon from '@mui/icons-material/Apps'; import BuildIcon from '@mui/icons-material/Build'; import CancelIcon from '@mui/icons-material/Cancel'; +import DeveloperBoardIcon from '@mui/icons-material/DeveloperBoard'; import DevicesIcon from '@mui/icons-material/Devices'; import FolderIcon from '@mui/icons-material/Folder'; import MemoryIcon from '@mui/icons-material/Memory'; @@ -9,7 +10,6 @@ import RefreshIcon from '@mui/icons-material/Refresh'; import SdCardAlertIcon from '@mui/icons-material/SdCardAlert'; import SdStorageIcon from '@mui/icons-material/SdStorage'; import SettingsBackupRestoreIcon from '@mui/icons-material/SettingsBackupRestore'; -import ShowChartIcon from '@mui/icons-material/ShowChart'; import TimerIcon from '@mui/icons-material/Timer'; import { Avatar, @@ -200,15 +200,6 @@ const SystemStatusForm: FC = () => { - - - - - - - - - @@ -221,10 +212,31 @@ const SystemStatusForm: FC = () => { - + - + + + + + + + + + + @@ -277,7 +289,9 @@ const SystemStatusForm: FC = () => { diff --git a/interface/src/i18n/de/index.ts b/interface/src/i18n/de/index.ts index 7574a09f7..1805c638f 100644 --- a/interface/src/i18n/de/index.ts +++ b/interface/src/i18n/de/index.ts @@ -196,11 +196,10 @@ const de: Translation = { EMS_ESP_VER: 'EMS-ESP Version', PLATFORM: 'Platform (Platform / SDK)', UPTIME: 'System Betriebszeit', - CPU_FREQ: 'CPU Frequenz', HEAP: 'freier RAM Speicher (Gesamt / max. Block)', PSRAM: 'PSRAM (Größe / Frei)', FLASH: 'Flash Speicher (Größe / Geschwindigkeit)', - APPSIZE: 'Programm (Genutzt / Frei)', + APPSIZE: 'Programm (Partition: Genutzt / Frei)', FILESYSTEM: 'Dateisystem (Genutzt / Frei)', BUFFER_SIZE: 'max. Puffergröße', COMPACT: 'Kompakte Darstellung', diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index c91c4d56d..c8cd47f91 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -196,11 +196,10 @@ const en: Translation = { EMS_ESP_VER: 'EMS-ESP Version', PLATFORM: 'Device (Platform / SDK)', UPTIME: 'System Uptime', - CPU_FREQ: 'CPU Frequency', HEAP: 'Heap (Free / Max Alloc)', PSRAM: 'PSRAM (Size / Free)', FLASH: 'Flash Chip (Size / Speed)', - APPSIZE: 'Application (Used / Free)', + APPSIZE: 'Application (Partition: Used / Free)', FILESYSTEM: 'File System (Used / Free)', BUFFER_SIZE: 'Max Buffer Size', COMPACT: 'Compact', diff --git a/interface/src/i18n/fr/index.ts b/interface/src/i18n/fr/index.ts index a0b9972b9..9557d6c05 100644 --- a/interface/src/i18n/fr/index.ts +++ b/interface/src/i18n/fr/index.ts @@ -196,11 +196,10 @@ const fr: Translation = { EMS_ESP_VER: 'Version EMS-ESP', PLATFORM: 'Appareil (Plateforme / SDK)', UPTIME: 'Durée de fonctionnement du système', - CPU_FREQ: 'Fréquence du CPU', HEAP: 'Heap (Libre / Max Allouée)', PSRAM: 'PSRAM (Taille / Libre)', FLASH: 'Flash Chip (Taille / Vitesse)', - APPSIZE: 'Application (Utilisée / Libre)', + APPSIZE: 'Application (Partition: Utilisée / Libre)', FILESYSTEM: 'File System (Utilisée / Libre)', BUFFER_SIZE: 'Max taille du buffer', COMPACT: 'Compact', diff --git a/interface/src/i18n/it/index.ts b/interface/src/i18n/it/index.ts index fc5d14294..71c0becf7 100644 --- a/interface/src/i18n/it/index.ts +++ b/interface/src/i18n/it/index.ts @@ -198,11 +198,10 @@ const it: Translation = { EMS_ESP_VER: 'Versione EMS-ESP', PLATFORM: 'Dispositivo (Piattaforma / SDK)', UPTIME: 'Tempo di attività del sistema', - CPU_FREQ: 'Frequenza CPU ', HEAP: 'Heap (Free / Max Alloc)', PSRAM: 'PSRAM (Size / Free)', FLASH: 'Flash Chip (Size / Speed)', - APPSIZE: 'Applicazione (Usata / Libera)', + APPSIZE: 'Applicazione (Partizione: Usata / Libera)', FILESYSTEM: 'Memoria Sistema (Usata / Libera)', BUFFER_SIZE: 'Max Buffer Size', COMPACT: 'Compact', diff --git a/interface/src/i18n/nl/index.ts b/interface/src/i18n/nl/index.ts index d54750d80..cb2d11b2c 100644 --- a/interface/src/i18n/nl/index.ts +++ b/interface/src/i18n/nl/index.ts @@ -196,11 +196,10 @@ const nl: Translation = { EMS_ESP_VER: 'EMS-ESP Versie', PLATFORM: 'Apparaat (Platform / SDK)', UPTIME: 'Systeem Uptime', - CPU_FREQ: 'CPU Frequency', HEAP: 'Heap (Free / Max Alloc)', PSRAM: 'PSRAM (Size / Free)', FLASH: 'Flash Chip (Size / Speed)', - APPSIZE: 'Application (Used / Free)', + APPSIZE: 'Application (Partition: Used / Free)', FILESYSTEM: 'File System (Used / Free)', BUFFER_SIZE: 'Max Buffer Size', COMPACT: 'Compact', diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts index c3f6e7e2c..523aa5f55 100644 --- a/interface/src/i18n/no/index.ts +++ b/interface/src/i18n/no/index.ts @@ -196,11 +196,10 @@ const no: Translation = { EMS_ESP_VER: 'EMS-ESP Version', PLATFORM: 'Enhet (Platform / SDK)', UPTIME: 'System Oppetid', - CPU_FREQ: 'CPU Frekvens', HEAP: 'Heap (Ledig / Max Allokert)', PSRAM: 'PSRAM (Størrelse / Ledig)', FLASH: 'Flash Chip (Størrelse / Hastighet)', - APPSIZE: 'Applikasjon (Brukt / Ledig)', + APPSIZE: 'Applikasjon (Partition: Brukt / Ledig)', FILESYSTEM: 'File System (Brukt / Ledig)', BUFFER_SIZE: 'Max Buffer Størrelse', COMPACT: 'Komprimere', diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts index 0cc5a5630..6ebf6499a 100644 --- a/interface/src/i18n/pl/index.ts +++ b/interface/src/i18n/pl/index.ts @@ -196,11 +196,10 @@ const pl: BaseTranslation = { EMS_ESP_VER: 'Wersja EMS-ESP', PLATFORM: 'Urządzenie (platforma / SDK)', UPTIME: 'Czas działania systemu', - CPU_FREQ: 'Taktowanie CPU', HEAP: 'HEAP (wolne / maksymalny przydział)', PSRAM: 'PSRAM (rozmiar / wolne)', FLASH: 'FLASH (rozmiar / taktowanie)', - APPSIZE: 'Aplikacja (wykorzystane / wolne)', + APPSIZE: 'Aplikacja (Partition: wykorzystane / wolne)', FILESYSTEM: 'System plików (wykorzystane / wolne)', BUFFER_SIZE: 'Maksymalna pojemność bufora (ilość wpisów)', COMPACT: 'Kompaktowy', diff --git a/interface/src/i18n/sk/index.ts b/interface/src/i18n/sk/index.ts index 3c8eaf8f7..16af65a66 100644 --- a/interface/src/i18n/sk/index.ts +++ b/interface/src/i18n/sk/index.ts @@ -196,11 +196,10 @@ const sk: Translation = { EMS_ESP_VER: 'EMS-ESP verzia', PLATFORM: 'Zariadenie (Platforma / SDK)', UPTIME: 'Beh systému', - CPU_FREQ: 'CPU frekvencia', HEAP: 'Zásobník (voľné / max pridelenie)', PSRAM: 'PSRAM (Veľkosť / Voľné)', FLASH: 'Flash chip (Veľkosť / Rýchlosť)', - APPSIZE: 'Applikácia (Použité / Voľné)', + APPSIZE: 'Applikácia (Priečka: Použité / Voľné)', FILESYSTEM: 'Súborový systém (Použité / Voľné)', BUFFER_SIZE: 'Maximálna veľkosť vyrovnávacej pamäte', COMPACT: 'Kompaktné', diff --git a/interface/src/i18n/sv/index.ts b/interface/src/i18n/sv/index.ts index 3dea8a225..4aedff8e5 100644 --- a/interface/src/i18n/sv/index.ts +++ b/interface/src/i18n/sv/index.ts @@ -196,11 +196,10 @@ const sv: Translation = { EMS_ESP_VER: 'EMS-ESP Version', PLATFORM: 'Enhet (Plattform / SDK)', UPTIME: 'Systemets Upptid', - CPU_FREQ: 'CPU-frekvens', HEAP: 'Heap (Ledigt / Max allokerat)', PSRAM: 'PSRAM (Storlek / Ledigt)', FLASH: 'Flashminne (Storlek / Hastighet)', - APPSIZE: 'Applikationer (Använt / Ledigt)', + APPSIZE: 'Applikationer (Partition: Använt / Ledigt)', FILESYSTEM: 'Filsystem (Använt / Ledigt)', BUFFER_SIZE: 'Max Bufferstorlek', COMPACT: 'Komprimera', diff --git a/interface/src/i18n/tr/index.ts b/interface/src/i18n/tr/index.ts index a5d7e4505..4500d547e 100644 --- a/interface/src/i18n/tr/index.ts +++ b/interface/src/i18n/tr/index.ts @@ -196,11 +196,10 @@ const tr: Translation = { EMS_ESP_VER: 'EMS-ESP Sürümü', PLATFORM: 'Cihaz (Platform / SDK)', UPTIME: 'Sistem Çalışma Süresi', - CPU_FREQ: 'İşlemci frekansı', HEAP: 'Yığın (Boş / Maksimum Tahsis)', PSRAM: 'PSRAM (Boyut / Boş)', FLASH: 'Flash Çipi (Boyut / Hız)', - APPSIZE: 'Uygulama (Kullanılmış / Boş)', + APPSIZE: 'Uygulama (Bölme: Kullanılmış / Boş)', FILESYSTEM: 'Dosya Sistemi (Kullanılmış / Boş)', BUFFER_SIZE: 'En fazla bellek boyutu', COMPACT: 'Sıkışık', diff --git a/interface/src/types/system.ts b/interface/src/types/system.ts index 783c3e496..e78f0b1cf 100644 --- a/interface/src/types/system.ts +++ b/interface/src/types/system.ts @@ -2,9 +2,14 @@ export interface SystemStatus { emsesp_version: string; esp_platform: string; max_alloc_heap: number; + cpu_type: string; + cpu_rev: number; + cpu_cores: number; cpu_freq_mhz: number; free_heap: number; + arduino_version: string; sdk_version: string; + partition: string; flash_chip_size: number; flash_chip_speed: number; app_used: number; diff --git a/lib/espMqttClient/src/Config.h b/lib/espMqttClient/src/Config.h index 940c2dea8..d6d1a0e63 100644 --- a/lib/espMqttClient/src/Config.h +++ b/lib/espMqttClient/src/Config.h @@ -8,6 +8,10 @@ the LICENSE file. #pragma once +#ifndef TASMOTA_SDK +#define EMC_CLIENT_SECURE +#endif + #ifndef EMC_TX_TIMEOUT #define EMC_TX_TIMEOUT 2000 #endif @@ -53,6 +57,10 @@ the LICENSE file. #define EMC_TASK_STACK_SIZE 5120 #endif +#ifndef EMC_MULTIPLE_CALLBACKS +#define EMC_MULTIPLE_CALLBACKS 0 +#endif + #ifndef EMC_USE_WATCHDOG #define EMC_USE_WATCHDOG 0 #endif diff --git a/lib/espMqttClient/src/MqttClientSetup.h b/lib/espMqttClient/src/MqttClientSetup.h index 73458d477..67f46a079 100644 --- a/lib/espMqttClient/src/MqttClientSetup.h +++ b/lib/espMqttClient/src/MqttClientSetup.h @@ -11,6 +11,11 @@ the LICENSE file. #pragma once +#if EMC_MULTIPLE_CALLBACKS +#include +#include +#endif + #include "MqttClient.h" template @@ -73,36 +78,128 @@ class MqttClientSetup : public MqttClient { return static_cast(*this); } - T& onConnect(espMqttClientTypes::OnConnectCallback callback) { + T& onConnect(espMqttClientTypes::OnConnectCallback callback, uint32_t id = 0) { + #if EMC_MULTIPLE_CALLBACKS + _onConnectCallbacks.emplace_back(callback, id); + #else + (void) id; _onConnectCallback = callback; + #endif return static_cast(*this); } - T& onDisconnect(espMqttClientTypes::OnDisconnectCallback callback) { + T& onDisconnect(espMqttClientTypes::OnDisconnectCallback callback, uint32_t id = 0) { + #if EMC_MULTIPLE_CALLBACKS + _onDisconnectCallbacks.emplace_back(callback, id); + #else + (void) id; _onDisconnectCallback = callback; + #endif return static_cast(*this); } - T& onSubscribe(espMqttClientTypes::OnSubscribeCallback callback) { + T& onSubscribe(espMqttClientTypes::OnSubscribeCallback callback, uint32_t id = 0) { + #if EMC_MULTIPLE_CALLBACKS + _onSubscribeCallbacks.emplace_back(callback, id); + #else + (void) id; _onSubscribeCallback = callback; + #endif return static_cast(*this); } - T& onUnsubscribe(espMqttClientTypes::OnUnsubscribeCallback callback) { + T& onUnsubscribe(espMqttClientTypes::OnUnsubscribeCallback callback, uint32_t id = 0) { + #if EMC_MULTIPLE_CALLBACKS + _onUnsubscribeCallbacks.emplace_back(callback, id); + #else + (void) id; _onUnsubscribeCallback = callback; + #endif return static_cast(*this); } - T& onMessage(espMqttClientTypes::OnMessageCallback callback) { + T& onMessage(espMqttClientTypes::OnMessageCallback callback, uint32_t id = 0) { + #if EMC_MULTIPLE_CALLBACKS + _onMessageCallbacks.emplace_back(callback, id); + #else + (void) id; _onMessageCallback = callback; + #endif return static_cast(*this); } - T& onPublish(espMqttClientTypes::OnPublishCallback callback) { + T& onPublish(espMqttClientTypes::OnPublishCallback callback, uint32_t id = 0) { + #if EMC_MULTIPLE_CALLBACKS + _onPublishCallbacks.emplace_back(callback, id); + #else + (void) id; _onPublishCallback = callback; + #endif return static_cast(*this); } + #if EMC_MULTIPLE_CALLBACKS + T& removeOnConnect(uint32_t id) { + for (auto it = _onConnectCallbacks.begin(); it != _onConnectCallbacks.end(); ++it) { + if (it->second == id) { + _onConnectCallbacks.erase(it); + break; + } + } + return static_cast(*this); + } + + T& removeOnDisconnect(uint32_t id) { + for (auto it = _onDisconnectCallbacks.begin(); it != _onDisconnectCallbacks.end(); ++it) { + if (it->second == id) { + _onDisconnectCallbacks.erase(it); + break; + } + } + return static_cast(*this); + } + + T& removeOnSubscribe(uint32_t id) { + for (auto it = _onSubscribeCallbacks.begin(); it != _onSubscribeCallbacks.end(); ++it) { + if (it->second == id) { + _onSubscribeCallbacks.erase(it); + break; + } + } + return static_cast(*this); + } + + T& removeOnUnsubscribe(uint32_t id) { + for (auto it = _onUnsubscribeCallbacks.begin(); it != _onUnsubscribeCallbacks.end(); ++it) { + if (it->second == id) { + _onUnsubscribeCallbacks.erase(it); + break; + } + } + return static_cast(*this); + } + + T& removeOnMessage(uint32_t id) { + for (auto it = _onMessageCallbacks.begin(); it != _onMessageCallbacks.end(); ++it) { + if (it->second == id) { + _onMessageCallbacks.erase(it); + break; + } + } + return static_cast(*this); + } + + T& removeOnPublish(uint32_t id) { + for (auto it = _onPublishCallbacks.begin(); it != _onPublishCallbacks.end(); ++it) { + if (it->second == id) { + _onPublishCallbacks.erase(it); + break; + } + } + return static_cast(*this); + } + #endif + /* T& onError(espMqttClientTypes::OnErrorCallback callback) { _onErrorCallback = callback; @@ -112,5 +209,37 @@ class MqttClientSetup : public MqttClient { protected: explicit MqttClientSetup(espMqttClientTypes::UseInternalTask useInternalTask, uint8_t priority = 1, uint8_t core = 1) - : MqttClient(useInternalTask, priority, core) {} + : MqttClient(useInternalTask, priority, core) { + #if EMC_MULTIPLE_CALLBACKS + _onConnectCallback = [this](bool sessionPresent) { + for (auto callback : _onConnectCallbacks) if (callback.first) callback.first(sessionPresent); + }; + _onDisconnectCallback = [this](espMqttClientTypes::DisconnectReason reason) { + for (auto callback : _onDisconnectCallbacks) if (callback.first) callback.first(reason); + }; + _onSubscribeCallback = [this](uint16_t packetId, const espMqttClientTypes::SubscribeReturncode* returncodes, size_t len) { + for (auto callback : _onSubscribeCallbacks) if (callback.first) callback.first(packetId, returncodes, len); + }; + _onUnsubscribeCallback = [this](int16_t packetId) { + for (auto callback : _onUnsubscribeCallbacks) if (callback.first) callback.first(packetId); + }; + _onMessageCallback = [this](const espMqttClientTypes::MessageProperties& properties, const char* topic, const uint8_t* payload, size_t len, size_t index, size_t total) { + for (auto callback : _onMessageCallbacks) if (callback.first) callback.first(properties, topic, payload, len, index, total); + }; + _onPublishCallback = [this](uint16_t packetId) { + for (auto callback : _onPublishCallbacks) if (callback.first) callback.first(packetId); + }; + #else + // empty + #endif + } + + #if EMC_MULTIPLE_CALLBACKS + std::list> _onConnectCallbacks; + std::list> _onDisconnectCallbacks; + std::list> _onSubscribeCallbacks; + std::list> _onUnsubscribeCallbacks; + std::list> _onMessageCallbacks; + std::list> _onPublishCallbacks; + #endif }; diff --git a/lib/espMqttClient/src/Transport/ClientSecureSync.h b/lib/espMqttClient/src/Transport/ClientSecureSync.h index b81681e36..c29b03d2f 100644 --- a/lib/espMqttClient/src/Transport/ClientSecureSync.h +++ b/lib/espMqttClient/src/Transport/ClientSecureSync.h @@ -10,7 +10,12 @@ the LICENSE file. #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) +#include "../Config.h" +#if defined(EMC_CLIENT_SECURE) #include // includes IPAddress +#else +#include +#endif #include "Transport.h" @@ -26,7 +31,11 @@ class ClientSecureSync : public Transport { void stop() override; bool connected() override; bool disconnected() override; +#if defined(EMC_CLIENT_SECURE) WiFiClientSecure client; +#else + WiFiClient client; +#endif }; } // namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/espMqttClient.cpp b/lib/espMqttClient/src/espMqttClient.cpp index 833ece10b..bd9b6935a 100644 --- a/lib/espMqttClient/src/espMqttClient.cpp +++ b/lib/espMqttClient/src/espMqttClient.cpp @@ -78,27 +78,37 @@ espMqttClientSecure::espMqttClientSecure(uint8_t priority, uint8_t core) } espMqttClientSecure& espMqttClientSecure::setInsecure() { +#if defined(EMC_CLIENT_SECURE) _client.client.setInsecure(); +#endif return *this; } espMqttClientSecure& espMqttClientSecure::setCACert(const char* rootCA) { +#if defined(EMC_CLIENT_SECURE) _client.client.setCACert(rootCA); +#endif return *this; } espMqttClientSecure& espMqttClientSecure::setCertificate(const char* clientCa) { +#if defined(EMC_CLIENT_SECURE) _client.client.setCertificate(clientCa); +#endif return *this; } espMqttClientSecure& espMqttClientSecure::setPrivateKey(const char* privateKey) { +#if defined(EMC_CLIENT_SECURE) _client.client.setPrivateKey(privateKey); +#endif return *this; } espMqttClientSecure& espMqttClientSecure::setPreSharedKey(const char* pskIdent, const char* psKey) { +#if defined(EMC_CLIENT_SECURE) _client.client.setPreSharedKey(pskIdent, psKey); +#endif return *this; } diff --git a/lib/framework/MqttSettingsService.cpp b/lib/framework/MqttSettingsService.cpp index eb10ef718..4465963a4 100644 --- a/lib/framework/MqttSettingsService.cpp +++ b/lib/framework/MqttSettingsService.cpp @@ -218,8 +218,10 @@ bool MqttSettingsService::configureMqtt() { void MqttSettings::read(MqttSettings & settings, JsonObject & root) { #if CONFIG_IDF_TARGET_ESP32S3 +#ifndef TASMOTA_SDK root["enableTLS"] = settings.enableTLS; root["rootCA"] = settings.rootCA; +#endif #endif root["enabled"] = settings.enabled; root["host"] = settings.host; @@ -255,8 +257,10 @@ StateUpdateResult MqttSettings::update(JsonObject & root, MqttSettings & setting bool changed = false; #if CONFIG_IDF_TARGET_ESP32S3 +#ifndef TASMOTA_SDK newSettings.enableTLS = root["enableTLS"] | false; newSettings.rootCA = root["rootCA"] | ""; +#endif #endif newSettings.enabled = root["enabled"] | FACTORY_MQTT_ENABLED; newSettings.host = root["host"] | FACTORY_MQTT_HOST; diff --git a/lib/framework/SystemStatus.cpp b/lib/framework/SystemStatus.cpp index 10c7a7856..c03b23312 100644 --- a/lib/framework/SystemStatus.cpp +++ b/lib/framework/SystemStatus.cpp @@ -19,10 +19,15 @@ void SystemStatus::systemStatus(AsyncWebServerRequest * request) { root["emsesp_version"] = EMSESP_APP_VERSION; root["esp_platform"] = EMSESP_PLATFORM; + root["cpu_type"] = ESP.getChipModel(); + root["cpu_rev"] = ESP.getChipRevision(); + root["cpu_cores"] = ESP.getChipCores(); root["cpu_freq_mhz"] = ESP.getCpuFreqMHz(); root["max_alloc_heap"] = emsesp::EMSESP::system_.getMaxAllocMem(); root["free_heap"] = emsesp::EMSESP::system_.getHeapMem(); + root["arduino_version"] = ARDUINO_VERSION; root["sdk_version"] = ESP.getSdkVersion(); + root["partition"] = esp_ota_get_running_partition()->label; root["flash_chip_size"] = ESP.getFlashChipSize() / 1024; root["flash_chip_speed"] = ESP.getFlashChipSpeed(); root["app_used"] = emsesp::EMSESP::system_.appUsed(); @@ -39,7 +44,7 @@ void SystemStatus::systemStatus(AsyncWebServerRequest * request) { const esp_partition_t * partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, NULL); if (partition != NULL) { // factory partition found root["has_loader"] = true; - } else { // check for not empty, smaller OTA partition + } else { // check for not empty, smaller OTA partition partition = esp_ota_get_next_update_partition(NULL); if (partition) { uint64_t buffer; diff --git a/platformio.ini b/platformio.ini index 69521fe02..e708d80b7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -51,11 +51,17 @@ extra_scripts = [espressi32_base_tasmota] ; use Tasmota's libary which removes some libs (like mbedtsl) and increases available heap ; platform = https://github.com/tasmota/platform-espressif32.git ; latest development +; latest release with WiFi_secure.h platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32-2023.10.03.zip ; latest stable -; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.02/platform-espressif32.zip +; latest arduino 2.xx release: +; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.01/platform-espressif32.zip +; latest arduino 3.0/IDF 5.1.(alpha 3): +; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.12.10/platform-espressif32.zip framework = arduino board_build.filesystem = littlefs -build_flags = ${common.build_flags} +build_flags = + ${common.build_flags} + -DTASMOTA_SDK build_unflags = ${common.unbuild_flags} extra_scripts = pre:scripts/build_interface.py @@ -83,8 +89,6 @@ extra_scripts = scripts/rename_fw.py board = esp32dev board_build.partitions = esp32_partition_4M.csv board_build.extra_flags = -DBOARD_HAS_PSRAM -build_unflags = ${common.unbuild_flags} -build_flags = ${common.build_flags} [env:ci_s3] extends = espressi32_base @@ -95,7 +99,7 @@ board_upload.flash_size = 16MB board_build.partitions = esp32_partition_16M.csv build_unflags = ${common.unbuild_flags} build_flags = - ${common.build_flags} + ${espressi32_base.build_flags} -O2 '-DEMSESP_DEFAULT_BOARD_PROFILE="S32S3"' @@ -105,7 +109,7 @@ board = esp32dev board_upload.flash_size = 4MB board_build.partitions = esp32_partition_4M.csv build_flags = - ${common.build_flags} + ${espressi32_base_tasmota.build_flags} -Os [env:esp32_4Mplus] @@ -113,7 +117,6 @@ extends = espressi32_base_tasmota board = esp32dev board_upload.flash_size = 4MB board_build.partitions = esp32_asym_partition_4M.csv -build_flags = ${common.build_flags} [env:esp32_16M] extends = espressi32_base_tasmota @@ -121,7 +124,6 @@ board = esp32dev board_build.extra_flags = -DBOARD_HAS_PSRAM board_upload.flash_size = 16MB board_build.partitions = esp32_partition_16M.csv -build_flags = ${common.build_flags} [env:lolin_c3_mini] extends = espressi32_base_tasmota @@ -129,7 +131,7 @@ board = lolin_c3_mini board_upload.flash_size = 4MB board_build.partitions = esp32_partition_4M.csv build_flags = - ${common.build_flags} + ${espressi32_base_tasmota.build_flags} '-DEMSESP_DEFAULT_BOARD_PROFILE="C3MINI"' ; lolin C3 mini v1 needs special wifi init. @@ -140,7 +142,7 @@ board = lolin_c3_mini board_upload.flash_size = 4MB board_build.partitions = esp32_partition_4M.csv build_flags = - ${common.build_flags} + ${espressi32_base_tasmota.build_flags} -DBOARD_C3_MINI_V1 '-DEMSESP_DEFAULT_BOARD_PROFILE="C3MINI"' @@ -150,7 +152,7 @@ board = lolin_s2_mini board_upload.flash_size = 4MB board_build.partitions = esp32_partition_4M.csv build_flags = - ${common.build_flags} + ${espressi32_base_tasmota.build_flags} '-DEMSESP_DEFAULT_BOARD_PROFILE="S2MINI"' [env:lolin_s3] @@ -162,7 +164,7 @@ board_build.partitions = esp32_partition_16M.csv board_upload.use_1200bps_touch = false board_upload.wait_for_upload_port = false build_flags = - ${common.build_flags} + ${espressi32_base.build_flags} -O2 '-DEMSESP_DEFAULT_BOARD_PROFILE="S32S3"' diff --git a/src/default_settings.h b/src/default_settings.h index 92ae49a8e..e87815dbb 100644 --- a/src/default_settings.h +++ b/src/default_settings.h @@ -252,4 +252,16 @@ enum { #error Target CONFIG_IDF_TARGET is not supported #endif +#ifndef ARDUINO_VERSION +#ifndef STRINGIZE +#define STRINGIZE(s) #s +#endif +#if TASMOTA_SDK +#define ARDUINO_VERSION_STR(major, minor, patch) "Tasmota Arduino v" STRINGIZE(major) "." STRINGIZE(minor) "." STRINGIZE(patch) +#else +#define ARDUINO_VERSION_STR(major, minor, patch) "ESP32 Arduino v" STRINGIZE(major) "." STRINGIZE(minor) "." STRINGIZE(patch) +#endif +#define ARDUINO_VERSION ARDUINO_VERSION_STR(ESP_ARDUINO_VERSION_MAJOR, ESP_ARDUINO_VERSION_MINOR, ESP_ARDUINO_VERSION_PATCH) +#endif + #endif diff --git a/src/locale_translations.h b/src/locale_translations.h index 2c7ba7bff..8fed3e043 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -1,4 +1,4 @@ -/* +/* * EMS-ESP - https://github.com/emsesp/EMS-ESP * Copyright 2020-2023 Paul Derbyshire * @@ -755,7 +755,7 @@ MAKE_TRANSLATION(energyToday, "energytoday", "total energy today", "Energie heut // solar ww MAKE_TRANSLATION(wwTemp1, "wwtemp1", "temperature 1(TS17)", "Temperatur 1", "Temperatuur 1", "Temperatur 1", "temperatura 1", "temperatur 1", "température 1", "sıcaklık 1", "Temperatura 1", "teplota 1") MAKE_TRANSLATION(wwTemp3, "wwtemp3", "temperature 3 (TS21)", "Temperatur 3", "Temperatuur 3", "Temperatur 3", "temperatura 3", "Temperatur 3", "température 3", "sıcaklık 3", "Temperatura 3", "teplota 3") -MAKE_TRANSLATION(wwTemp4, "wwtemp4", "cold water", "Temperatur 4", "Temperatuur 4", "Temperatur 4", "temperatura 4", "Temperatur 4", "température 4", "sıcaklık 4", "Temperatura 4", "teplota 4") +MAKE_TRANSLATION(wwTemp4, "wwtemp4", "cold water", "Temperatur 4", "Temperatuur 4", "Temperatur 4", "temperatura 4", "Temperatur 4", "température 4", "sıcaklık 4", "Temperatura 4", "studená voda") MAKE_TRANSLATION(wwTemp5, "wwtemp5", "temperature 5", "Temperatur 5", "Temperatuur 5", "Temperatur 5", "temperatura 5", "Temperatur 5", "température 5", "sıcaklık 5", "Temperatura 5", "teplota 5") MAKE_TRANSLATION(wwTemp6, "wwtemp6", "temperature 6", "Temperatur 6", "Temperatuur 6", "Temperatur 6", "temperatura 6", "temperatur 6", "température 6", "sıcaklık 6", "Temperatura 6", "teplota 6") MAKE_TRANSLATION(wwTemp7, "wwtemp7", "temperature 7", "Temperatur 7", "Temperatuur 7", "Temperatur 7", "temperatura 7", "Temperatur 7", "température 7", "sıcaklık 7", "Temperatura 7", "teplota 7") diff --git a/src/system.cpp b/src/system.cpp index c2f486c5b..187b4e32b 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -1206,13 +1206,16 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp // System node = output.createNestedObject("System Info"); node["version"] = EMSESP_APP_VERSION; - node["platform"] = EMSESP_PLATFORM; node["uptime"] = uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3); node["uptime (seconds)"] = uuid::get_uptime_sec(); #ifndef EMSESP_STANDALONE + node["platform"] = ARDUINO_VERSION; + node["sdk"] = ESP.getSdkVersion(); node["free mem"] = getHeapMem(); node["max alloc"] = getMaxAllocMem(); + node["used app"] = EMSESP::system_.appUsed(); // kilobytes node["free app"] = EMSESP::system_.appFree(); // kilobytes + node["partition"] = esp_ota_get_running_partition()->label; #endif node["reset reason"] = EMSESP::system_.reset_reason(0) + " / " + EMSESP::system_.reset_reason(1); diff --git a/src/version.h b/src/version.h index 39c83445d..9c1552b79 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.6.5-dev.5" +#define EMSESP_APP_VERSION "3.6.5-dev.6"