mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
Merge pull request #1519 from MichaelDvP/dev_1
compile with tasmota arduino 2.14 and 3.0
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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 = () => {
|
||||
</Button>
|
||||
</ListItem>
|
||||
<Divider variant="inset" component="li" />
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<Avatar>
|
||||
<DevicesIcon />
|
||||
</Avatar>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary={LL.PLATFORM()} secondary={data.esp_platform + ' / ' + data.sdk_version} />
|
||||
</ListItem>
|
||||
<Divider variant="inset" component="li" />
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<Avatar>
|
||||
@@ -221,10 +212,31 @@ const SystemStatusForm: FC = () => {
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<Avatar>
|
||||
<ShowChartIcon />
|
||||
<DevicesIcon />
|
||||
</Avatar>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary={LL.CPU_FREQ()} secondary={data.cpu_freq_mhz + ' MHz'} />
|
||||
<ListItemText primary="SDK" secondary={data.arduino_version + ' / ESP-IDF v' + data.sdk_version} />
|
||||
</ListItem>
|
||||
<Divider variant="inset" component="li" />
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<Avatar>
|
||||
<DeveloperBoardIcon />
|
||||
</Avatar>
|
||||
</ListItemAvatar>
|
||||
<ListItemText
|
||||
primary="CPU"
|
||||
secondary={
|
||||
data.cpu_type +
|
||||
' (rev.' +
|
||||
data.cpu_rev +
|
||||
', ' +
|
||||
(data.cpu_cores == 1 ? 'single-core)' : 'dual-core)') +
|
||||
' @ ' +
|
||||
data.cpu_freq_mhz +
|
||||
' Mhz'
|
||||
}
|
||||
/>
|
||||
</ListItem>
|
||||
<Divider variant="inset" component="li" />
|
||||
<ListItem>
|
||||
@@ -277,7 +289,9 @@ const SystemStatusForm: FC = () => {
|
||||
</ListItemAvatar>
|
||||
<ListItemText
|
||||
primary={LL.APPSIZE()}
|
||||
secondary={formatNumber(data.app_used) + ' KB / ' + formatNumber(data.app_free) + ' KB'}
|
||||
secondary={
|
||||
data.partition + ': ' + formatNumber(data.app_used) + ' KB / ' + formatNumber(data.app_free) + ' KB'
|
||||
}
|
||||
/>
|
||||
</ListItem>
|
||||
<Divider variant="inset" component="li" />
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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é',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,6 +11,11 @@ the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
|
||||
#if EMC_MULTIPLE_CALLBACKS
|
||||
#include <list>
|
||||
#include <utility>
|
||||
#endif
|
||||
|
||||
#include "MqttClient.h"
|
||||
|
||||
template <typename T>
|
||||
@@ -73,36 +78,128 @@ class MqttClientSetup : public MqttClient {
|
||||
return static_cast<T&>(*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<T&>(*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<T&>(*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<T&>(*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<T&>(*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<T&>(*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<T&>(*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<T&>(*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<T&>(*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<T&>(*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<T&>(*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<T&>(*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<T&>(*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<std::pair<espMqttClientTypes::OnConnectCallback, uint32_t>> _onConnectCallbacks;
|
||||
std::list<std::pair<espMqttClientTypes::OnDisconnectCallback, uint32_t>> _onDisconnectCallbacks;
|
||||
std::list<std::pair<espMqttClientTypes::OnSubscribeCallback, uint32_t>> _onSubscribeCallbacks;
|
||||
std::list<std::pair<espMqttClientTypes::OnUnsubscribeCallback, uint32_t>> _onUnsubscribeCallbacks;
|
||||
std::list<std::pair<espMqttClientTypes::OnMessageCallback, uint32_t>> _onMessageCallbacks;
|
||||
std::list<std::pair<espMqttClientTypes::OnPublishCallback, uint32_t>> _onPublishCallbacks;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -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 <WiFiClientSecure.h> // includes IPAddress
|
||||
#else
|
||||
#include <WiFiClient.h>
|
||||
#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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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"'
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.6.5-dev.5"
|
||||
#define EMSESP_APP_VERSION "3.6.5-dev.6"
|
||||
|
||||
Reference in New Issue
Block a user