update modules

This commit is contained in:
proddy
2024-05-26 16:06:18 +02:00
parent 8ffed9fab7
commit 20063d48ed
8 changed files with 65 additions and 26 deletions

View File

@@ -16,33 +16,43 @@
; my_build_flags = -DEMSESP_DEBUG -DEMSESP_TEST -DEMSESP_PINGTEST ; my_build_flags = -DEMSESP_DEBUG -DEMSESP_TEST -DEMSESP_PINGTEST
[platformio] [platformio]
; default_envs = esp32_4M default_envs = esp32_4M
; default_envs = esp32_16M ; default_envs = esp32_16M
default_envs = lolin_s3 ; default_envs = lolin_s3
; default_envs = standalone ; default_envs = native
; default_envs = debug ; default_envs = debug
; default_envs = custom ; default_envs = custom
[env] [env]
; upload settings ; upload settings
upload_protocol = custom ; for USB
upload_protocol = esptool
upload_port = /dev/ttyUSB*
; for OTA
; upload_protocol = custom
custom_emsesp_ip = 10.10.10.173 custom_emsesp_ip = 10.10.10.173
; custom_emsesp_ip = ems-esp.local ; custom_emsesp_ip = ems-esp.local
custom_username = admin custom_username = admin
custom_password = admin custom_password = admin
upload_port = /dev/ttyUSB* ; uncomment this next line if using the github repo
lib_deps = file://../../modules/EMS-ESP-Modules
[env:native]
extra_scripts =
; pre:scripts/refresh_module_library_native.py
; post:scripts/run_native.py
[env:esp32_4M] [env:esp32_4M]
extra_scripts = extra_scripts =
pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time ; pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time
scripts/rename_fw.py scripts/rename_fw.py
; scripts/upload.py scripts/upload.py
[env:lolin_s3] [env:lolin_s3]
extra_scripts = extra_scripts =
pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time
scripts/rename_fw.py scripts/rename_fw.py
; scripts/upload.py scripts/upload.py
[env:custom] [env:custom]
; use for basic ESP boards with 4MB flash ; use for basic ESP boards with 4MB flash
@@ -60,7 +70,7 @@ board_upload.use_1200bps_touch = false
board_upload.wait_for_upload_port = true board_upload.wait_for_upload_port = true
upload_port = /dev/ttyUSB0 upload_port = /dev/ttyUSB0
extra_scripts = extra_scripts =
; pre:scripts/build_interface.py pre:scripts/build_interface.py
scripts/rename_fw.py scripts/rename_fw.py
build_unflags = ${common.unbuild_flags} build_unflags = ${common.unbuild_flags}
build_flags = build_flags =

View File

@@ -12,7 +12,7 @@ extra_configs =
pio_local.ini pio_local.ini
[common] [common]
core_build_flags = -std=gnu++2a core_build_flags = -std=gnu++2a -Isrc
core_unbuild_flags = -std=gnu++11 core_unbuild_flags = -std=gnu++11
; my_build_flags is set in pio_local.ini ; my_build_flags is set in pio_local.ini
@@ -64,10 +64,11 @@ extra_scripts =
[env] [env]
monitor_speed = 115200 monitor_speed = 115200
monitor_filters = direct, esp32_exception_decoder monitor_filters = direct
upload_speed = 921600 upload_speed = 921600
build_type = release build_type = release
lib_ldf_mode = chain+ lib_ldf_mode = chain+
lib_deps = https://github.com/emsesp/EMS-ESP-Modules.git
check_tool = cppcheck, clangtidy check_tool = cppcheck, clangtidy
check_severity = high, medium check_severity = high, medium
check_flags = check_flags =
@@ -205,15 +206,13 @@ build_flags =
-D CONFIG_UART_ISR_IN_IRAM -D CONFIG_UART_ISR_IN_IRAM
-D CONFIG_ASYNC_TCP_STACK_SIZE=5120 -D CONFIG_ASYNC_TCP_STACK_SIZE=5120
; to build and run: pio run -e standalone -t exec ; to build and run: pio run -e native -t exec
[env:standalone] [env:native]
platform = native platform = native
build_flags = build_flags =
-DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0 -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0
-DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_TEST -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_TEST
-DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.7.0-dev.0\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\" -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.7.0-dev.0\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
-lpthread
-D__linux__
-std=gnu++14 -Og -ggdb -std=gnu++14 -Og -ggdb
build_src_flags = build_src_flags =
-Wall -Wextra -Werror -Wall -Wextra -Werror

View File

@@ -0,0 +1,11 @@
import os
Import("env")
def refresh_module():
print("Fetching latest module for Native target...")
os.system("pio pkg install -f -s -e native -l file://../../modules/EMS-ESP-Modules")
if not (env.IsCleanTarget()):
refresh_module()

11
scripts/run_native.py Normal file
View File

@@ -0,0 +1,11 @@
import os
Import("env")
def run_native():
print("Running native...")
os.system("pio run -e native")
if not (env.IsCleanTarget()):
run_native()

View File

@@ -636,15 +636,15 @@ void EMSESPShell::stopped() {
// show welcome banner // show welcome banner
void EMSESPShell::display_banner() { void EMSESPShell::display_banner() {
println(); println();
printfln("┌──────────────────────────────────────────"); printfln("┌───────────────────────────────────────┐");
printfln("│ %sEMS-ESP version %-12s%s ", COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_BOLD_OFF); printfln(" %sEMS-ESP version %-20s%s │", COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_BOLD_OFF);
printfln("│ │"); printfln("│ │");
printfln("│ %shelp%s to show available commands │", COLOR_UNDERLINE, COLOR_RESET); printfln("│ %shelp%s to show available commands │", COLOR_UNDERLINE, COLOR_RESET);
printfln("│ %ssu%s to access admin commands │", COLOR_UNDERLINE, COLOR_RESET); printfln("│ %ssu%s to access admin commands │", COLOR_UNDERLINE, COLOR_RESET);
printfln("│ │"); printfln("│ │");
printfln("│ %s%shttps://github.com/emsesp/EMS-ESP32%s │", COLOR_BRIGHT_GREEN, COLOR_UNDERLINE, COLOR_RESET); printfln("│ %s%shttps://github.com/emsesp/EMS-ESP32%s │", COLOR_BRIGHT_GREEN, COLOR_UNDERLINE, COLOR_RESET);
printfln("│ │"); printfln("│ │");
printfln("└──────────────────────────────────────────"); printfln("└───────────────────────────────────────┘");
println(); println();
// set console name // set console name

View File

@@ -75,6 +75,7 @@ TemperatureSensor EMSESP::temperaturesensor_; // Temperature sensors
AnalogSensor EMSESP::analogsensor_; // Analog sensors AnalogSensor EMSESP::analogsensor_; // Analog sensors
Shower EMSESP::shower_; // Shower logic Shower EMSESP::shower_; // Shower logic
Preferences EMSESP::nvs_; // NV Storage Preferences EMSESP::nvs_; // NV Storage
ModuleLibrary EMSESP::module_; // Module Library
// static/common variables // static/common variables
uint16_t EMSESP::watch_id_ = WATCH_ID_NONE; // for when log is TRACE. 0 means no trace set uint16_t EMSESP::watch_id_ = WATCH_ID_NONE; // for when log is TRACE. 0 means no trace set
@@ -1645,6 +1646,8 @@ void EMSESP::start() {
#endif #endif
webServer.begin(); // start the web server webServer.begin(); // start the web server
module_.setup(this); // setup the external library modules
} }
// main loop calling all services // main loop calling all services

View File

@@ -65,6 +65,10 @@
#include "command.h" #include "command.h"
#include "version.h" #include "version.h"
// Load external modules
class Module {}; // forward declaration
#include <ModuleLibrary.h>
#define WATCH_ID_NONE 0 // no watch id set #define WATCH_ID_NONE 0 // no watch id set
// helpers for callback functions // helpers for callback functions
@@ -218,6 +222,7 @@ class EMSESP {
static RxService rxservice_; static RxService rxservice_;
static TxService txservice_; static TxService txservice_;
static Preferences nvs_; static Preferences nvs_;
static ModuleLibrary module_;
// web controllers // web controllers
static ESP8266React esp8266React; static ESP8266React esp8266React;

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.7.0-dev.11" #define EMSESP_APP_VERSION "3.7.0-dev.11m"