mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
platform asdev, revert mqtt client changes, uart-isr to flash to save ram
This commit is contained in:
@@ -8,10 +8,6 @@ the LICENSE file.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if CONFIG_IDF_TARGET_ESP32S3
|
|
||||||
// #define EMC_CLIENT_SECURE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef EMC_TX_TIMEOUT
|
#ifndef EMC_TX_TIMEOUT
|
||||||
#define EMC_TX_TIMEOUT 2000
|
#define EMC_TX_TIMEOUT 2000
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -11,11 +11,7 @@ the LICENSE file.
|
|||||||
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
||||||
|
|
||||||
#include "../Config.h"
|
#include "../Config.h"
|
||||||
#if defined(EMC_CLIENT_SECURE)
|
|
||||||
#include <WiFiClientSecure.h> // includes IPAddress
|
#include <WiFiClientSecure.h> // includes IPAddress
|
||||||
#else
|
|
||||||
#include <WiFiClient.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "Transport.h"
|
#include "Transport.h"
|
||||||
|
|
||||||
@@ -31,11 +27,7 @@ class ClientSecureSync : public Transport {
|
|||||||
void stop() override;
|
void stop() override;
|
||||||
bool connected() override;
|
bool connected() override;
|
||||||
bool disconnected() override;
|
bool disconnected() override;
|
||||||
#if defined(EMC_CLIENT_SECURE)
|
|
||||||
WiFiClientSecure client;
|
WiFiClientSecure client;
|
||||||
#else
|
|
||||||
WiFiClient client;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace espMqttClientInternals
|
} // namespace espMqttClientInternals
|
||||||
|
|||||||
@@ -78,37 +78,27 @@ espMqttClientSecure::espMqttClientSecure(uint8_t priority, uint8_t core)
|
|||||||
}
|
}
|
||||||
|
|
||||||
espMqttClientSecure& espMqttClientSecure::setInsecure() {
|
espMqttClientSecure& espMqttClientSecure::setInsecure() {
|
||||||
#if defined(EMC_CLIENT_SECURE)
|
|
||||||
_client.client.setInsecure();
|
_client.client.setInsecure();
|
||||||
#endif
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
espMqttClientSecure& espMqttClientSecure::setCACert(const char* rootCA) {
|
espMqttClientSecure& espMqttClientSecure::setCACert(const char* rootCA) {
|
||||||
#if defined(EMC_CLIENT_SECURE)
|
|
||||||
_client.client.setCACert(rootCA);
|
_client.client.setCACert(rootCA);
|
||||||
#endif
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
espMqttClientSecure& espMqttClientSecure::setCertificate(const char* clientCa) {
|
espMqttClientSecure& espMqttClientSecure::setCertificate(const char* clientCa) {
|
||||||
#if defined(EMC_CLIENT_SECURE)
|
|
||||||
_client.client.setCertificate(clientCa);
|
_client.client.setCertificate(clientCa);
|
||||||
#endif
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
espMqttClientSecure& espMqttClientSecure::setPrivateKey(const char* privateKey) {
|
espMqttClientSecure& espMqttClientSecure::setPrivateKey(const char* privateKey) {
|
||||||
#if defined(EMC_CLIENT_SECURE)
|
|
||||||
_client.client.setPrivateKey(privateKey);
|
_client.client.setPrivateKey(privateKey);
|
||||||
#endif
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
espMqttClientSecure& espMqttClientSecure::setPreSharedKey(const char* pskIdent, const char* psKey) {
|
espMqttClientSecure& espMqttClientSecure::setPreSharedKey(const char* pskIdent, const char* psKey) {
|
||||||
#if defined(EMC_CLIENT_SECURE)
|
|
||||||
_client.client.setPreSharedKey(pskIdent, psKey);
|
_client.client.setPreSharedKey(pskIdent, psKey);
|
||||||
#endif
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ build_flags =
|
|||||||
-D NO_GLOBAL_ARDUINOOTA
|
-D NO_GLOBAL_ARDUINOOTA
|
||||||
-D ARDUINOJSON_ENABLE_STD_STRING=1
|
-D ARDUINOJSON_ENABLE_STD_STRING=1
|
||||||
-D ARDUINOJSON_USE_DOUBLE=0
|
-D ARDUINOJSON_USE_DOUBLE=0
|
||||||
-D CONFIG_UART_ISR_IN_IRAM
|
;-D CONFIG_UART_ISR_IN_IRAM
|
||||||
|
|
||||||
unbuild_flags =
|
unbuild_flags =
|
||||||
${common.core_unbuild_flags}
|
${common.core_unbuild_flags}
|
||||||
@@ -41,7 +41,6 @@ unbuild_flags =
|
|||||||
[espressi32_base]
|
[espressi32_base]
|
||||||
platform = espressif32@6.4.0
|
platform = espressif32@6.4.0
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board_build.filesystem = littlefs
|
|
||||||
build_flags = ${common.build_flags}
|
build_flags = ${common.build_flags}
|
||||||
build_unflags = ${common.unbuild_flags}
|
build_unflags = ${common.unbuild_flags}
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
@@ -50,11 +49,10 @@ extra_scripts =
|
|||||||
|
|
||||||
[espressi32_base_tasmota]
|
[espressi32_base_tasmota]
|
||||||
; use Tasmota's libary which removes some libs (like mbedtsl) and increases available heap
|
; use Tasmota's libary which removes some libs (like mbedtsl) and increases available heap
|
||||||
; platform = https://github.com/tasmota/platform-espressif32.git ; latest development
|
; based on Core 2.0.12/ESP-IDF v4.4.5 https://github.com/espressif/arduino-esp32/releases/tag/2.0.12 use https://github.com/tasmota/platform-espressif32/archive/refs/tags/2023.09.00.zip
|
||||||
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32-2023.10.03.zip ; latest stable
|
; based on Core 2.0.13/ESP-IDF v4.4.5 https://github.com/espressif/arduino-esp32/releases/tag/2.0.13 use https://github.com/tasmota/platform-espressif32/releases/download/2023.09.01/platform-espressif32-2023.09.01.zip
|
||||||
; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.02/platform-espressif32.zip
|
platform = https://github.com/tasmota/platform-espressif32/archive/refs/tags/2023.09.00.zip
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board_build.filesystem = littlefs
|
|
||||||
build_flags = ${common.build_flags}
|
build_flags = ${common.build_flags}
|
||||||
build_unflags = ${common.unbuild_flags}
|
build_unflags = ${common.unbuild_flags}
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
@@ -67,6 +65,8 @@ monitor_raw = yes
|
|||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
build_type = release
|
build_type = release
|
||||||
lib_ldf_mode = chain+
|
lib_ldf_mode = chain+
|
||||||
|
; board_build.flash_mode = qio
|
||||||
|
|
||||||
check_tool = cppcheck, clangtidy
|
check_tool = cppcheck, clangtidy
|
||||||
check_severity = high, medium
|
check_severity = high, medium
|
||||||
check_flags =
|
check_flags =
|
||||||
@@ -76,25 +76,22 @@ check_flags =
|
|||||||
; build for GitHub Actions CI
|
; build for GitHub Actions CI
|
||||||
; the Web interface is built seperately
|
; the Web interface is built seperately
|
||||||
[env:ci]
|
[env:ci]
|
||||||
platform = https://github.com/tasmota/platform-espressif32.git
|
extends = espressi32_base_tasmota
|
||||||
framework = arduino
|
|
||||||
extra_scripts = scripts/rename_fw.py
|
extra_scripts = scripts/rename_fw.py
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
board_build.partitions = esp32_partition_4M.csv
|
board_build.partitions = esp32_partition_4M.csv
|
||||||
|
board_build.filesystem = littlefs
|
||||||
build_flags = ${common.build_flags}
|
build_flags = ${common.build_flags}
|
||||||
build_unflags = ${common.unbuild_flags}
|
build_unflags = ${common.unbuild_flags}
|
||||||
|
|
||||||
[env:ci_s3]
|
[env:ci_s3]
|
||||||
platform = https://github.com/tasmota/platform-espressif32.git
|
extends = espressi32_base
|
||||||
framework = arduino
|
|
||||||
extra_scripts = scripts/rename_fw.py
|
extra_scripts = scripts/rename_fw.py
|
||||||
board = lolin_s3
|
board = lolin_s3
|
||||||
board_build.f_cpu = 240000000L
|
board_build.f_cpu = 240000000L
|
||||||
board_upload.flash_size = 16MB
|
board_upload.flash_size = 16MB
|
||||||
board_build.partitions = esp32_partition_16M.csv
|
board_build.partitions = esp32_partition_16M.csv
|
||||||
build_flags =
|
build_flags = ${common.build_flags} -O2
|
||||||
${common.build_flags}
|
|
||||||
-O2
|
|
||||||
build_unflags = ${common.unbuild_flags}
|
build_unflags = ${common.unbuild_flags}
|
||||||
|
|
||||||
[env:esp32_4M]
|
[env:esp32_4M]
|
||||||
@@ -102,24 +99,28 @@ extends = espressi32_base_tasmota
|
|||||||
board = esp32dev
|
board = esp32dev
|
||||||
board_upload.flash_size = 4MB
|
board_upload.flash_size = 4MB
|
||||||
board_build.partitions = esp32_partition_4M.csv
|
board_build.partitions = esp32_partition_4M.csv
|
||||||
|
build_flags = ${common.build_flags} -Os
|
||||||
|
|
||||||
[env:esp32_4Mplus]
|
[env:esp32_4Mplus]
|
||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
board_upload.flash_size = 4MB
|
board_upload.flash_size = 4MB
|
||||||
board_build.partitions = esp32_asym_partition_4M.csv
|
board_build.partitions = esp32_asym_partition_4M.csv
|
||||||
|
build_flags = ${common.build_flags}
|
||||||
|
|
||||||
[env:esp32_16M]
|
[env:esp32_16M]
|
||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
board_upload.flash_size = 16MB
|
board_upload.flash_size = 16MB
|
||||||
board_build.partitions = esp32_partition_16M.csv
|
board_build.partitions = esp32_partition_16M.csv
|
||||||
|
build_flags = ${common.build_flags}
|
||||||
|
|
||||||
[env:lolin_c3_mini]
|
[env:lolin_c3_mini]
|
||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
board = lolin_c3_mini
|
board = lolin_c3_mini
|
||||||
board_upload.flash_size = 4MB
|
board_upload.flash_size = 4MB
|
||||||
board_build.partitions = esp32_partition_4M.csv
|
board_build.partitions = esp32_asym_partition_4M.csv
|
||||||
|
build_flags = ${common.build_flags}
|
||||||
|
|
||||||
; lolin C3 mini v1 needs special wifi init.
|
; lolin C3 mini v1 needs special wifi init.
|
||||||
; https://www.wemos.cc/en/latest/c3/c3_mini_1_0_0.html#about-wifi
|
; https://www.wemos.cc/en/latest/c3/c3_mini_1_0_0.html#about-wifi
|
||||||
@@ -127,16 +128,15 @@ board_build.partitions = esp32_partition_4M.csv
|
|||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
board = lolin_c3_mini
|
board = lolin_c3_mini
|
||||||
board_upload.flash_size = 4MB
|
board_upload.flash_size = 4MB
|
||||||
board_build.partitions = esp32_partition_4M.csv
|
board_build.partitions = esp32_asym_partition_4M.csv
|
||||||
build_flags =
|
build_flags = ${common.build_flags} -DBOARD_C3_MINI_V1
|
||||||
${common.build_flags}
|
|
||||||
-DBOARD_C3_MINI_V1
|
|
||||||
|
|
||||||
[env:lolin_s2_mini]
|
[env:lolin_s2_mini]
|
||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
board = lolin_s2_mini
|
board = lolin_s2_mini
|
||||||
board_upload.flash_size = 4MB
|
board_upload.flash_size = 4MB
|
||||||
board_build.partitions = esp32_partition_4M.csv
|
board_build.partitions = esp32_asym_partition_4M.csv
|
||||||
|
build_flags = ${common.build_flags}
|
||||||
|
|
||||||
[env:lolin_s3]
|
[env:lolin_s3]
|
||||||
extends = espressi32_base
|
extends = espressi32_base
|
||||||
@@ -146,9 +146,7 @@ board_upload.flash_size = 16MB
|
|||||||
board_build.partitions = esp32_partition_16M.csv
|
board_build.partitions = esp32_partition_16M.csv
|
||||||
board_upload.use_1200bps_touch = false
|
board_upload.use_1200bps_touch = false
|
||||||
board_upload.wait_for_upload_port = false
|
board_upload.wait_for_upload_port = false
|
||||||
build_flags =
|
build_flags = ${common.build_flags} -O2
|
||||||
${common.build_flags}
|
|
||||||
-O2
|
|
||||||
|
|
||||||
; to build and run: pio run -e standalone -t exec
|
; to build and run: pio run -e standalone -t exec
|
||||||
[env:standalone]
|
[env:standalone]
|
||||||
|
|||||||
Reference in New Issue
Block a user