Merge branch 'emsesp:dev' into dev

This commit is contained in:
Proddy
2026-10-13 07:51:57 +02:00
committed by GitHub
4 changed files with 25 additions and 3 deletions
+1
View File
@@ -32,6 +32,7 @@ This release is based on the latest Espressif/Arduino core version 3. It brings
## Fixed
- restart from the WebUI (Restart button, firmware/settings upload) only happened while the browser tab stayed open. If the tab was closed the restart was silently dropped after 5 minutes, leaving a new firmware uninstalled. EMS-ESP now restarts on its own if the WebUI hasn't picked up the pending restart within 10 seconds
- shunting yard show json
- `system/sendmail` called from a Command or the Scheduler computed its value twice, which stripped the quotes from literal text and then failed on characters like `!`. Also shunting yard treated a `?` inside a quoted string as a ternary, so text like `"too hot?"` returned nothing
- memory leak when using different timezones for ems-esp and thermostat[#3184](https://github.com/emsesp/EMS-ESP32/issues/3184)
+5 -3
View File
@@ -2154,9 +2154,11 @@ void EMSESP::loop() {
}
}
// reset status after a timeout
if (EMSESP::system_.systemStatus() != SYSTEM_STATUS::SYSTEM_STATUS_NORMAL) {
static uint32_t starttime = 0;
// reset status after a timeout. A pending restart is never reset, it's handled in System::loop()
static uint32_t starttime = 0;
if (EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_NORMAL || EMSESP::system_.systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_PENDING_RESTART) {
starttime = 0;
} else {
if (starttime == 0) {
starttime = uuid::get_uptime_ms();
} else if (uuid::get_uptime_ms() - starttime > SYSTEM_STATUS_RESET_TIMEOUT) {
+14
View File
@@ -1028,6 +1028,20 @@ void System::uart_init() {
// checks system health and handles LED flashing wizardry
// returns true if the LED flash is active
bool System::loop() {
// a restart requested from the WebUI is first set to pending, so the WebUI's SystemMonitor can pick it up
// and show the restart screen before the connection drops. Don't depend on the browser tab staying open though:
// if nothing has polled the status after a short grace period, go ahead and restart anyway
if (systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_PENDING_RESTART) {
if (pending_restart_start_ == 0) {
pending_restart_start_ = uuid::get_uptime_ms();
} else if (uuid::get_uptime_ms() - pending_restart_start_ > PENDING_RESTART_TIMEOUT) {
LOG_INFO("No WebUI response to pending restart, restarting now");
systemStatus(SYSTEM_STATUS::SYSTEM_STATUS_RESTART_REQUESTED);
}
} else {
pending_restart_start_ = 0;
}
// check if we're supposed to do a reset/restart
if (systemStatus() == SYSTEM_STATUS::SYSTEM_STATUS_RESTART_REQUESTED) {
system_restart();
+5
View File
@@ -391,6 +391,11 @@ class System {
volatile uint8_t systemStatus_; // uses SYSTEM_STATUS enum - written from the AsyncTCP task (e.g. cancel) and read from the main loop during OTA
uint32_t pending_restart_start_ = 0; // uptime (ms) when a pending restart was first seen in the main loop
// restart anyway if a pending restart hasn't been picked up by the WebUI within this time (in ms)
// the SystemMonitor polls every second, so this only kicks in when the browser tab was closed or lost connection
static constexpr uint32_t PENDING_RESTART_TIMEOUT = 10000;
void set_partition_install_date();
volatile bool recovery_installed_pending_ = false; // set by the main loop, handled on the AsyncTCP task