From fb6640b91fde752096ce0bcb4cbe571cab75d49b Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 18 Mar 2025 15:12:30 +0100 Subject: [PATCH] Fix ESP32 receive incomplete serial data over 128 bytes (#23156) --- CHANGELOG.md | 3 ++- RELEASENOTES.md | 2 ++ lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5c8ccca3..094612a7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file. - Support Vango Technologies V924x ultralow power, single-phase, power measurement (#23127) - Support for HLK-LD2402 24GHz smart wave motion sensor (#23133) - Matter prepare for ICD cluster (#23158) -- Berry `re.dump()` +- Berry `re.dump()` (#23162) ### Breaking Changed - Berry remove `Leds.create_matrix` from the standard library waiting for reimplementation (#23114) @@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file. - Berry prevent `import` from hiding a solidified class (#23112) - ESP32-C3 WiFi sleep (#23096) - ESP32 intermittent exception on WiFi AP cannot be reached (#23115) +- ESP32 receive incomplete serial data over 128 bytes (#23156) ### Removed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7663e1b35..74c4313de 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -124,6 +124,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - Berry `introspect.solidified()` to know if a Berry object is solidified or in RAM [#23063](https://github.com/arendst/Tasmota/issues/23063) - Berry `global.undef()` to undefine a global variable [#23073](https://github.com/arendst/Tasmota/issues/23073) - Berry load `.tapp` files in `/.extensions/` then in `/` [#23113](https://github.com/arendst/Tasmota/issues/23113) +- Berry `re.dump()` (#23162)[#23162](https://github.com/arendst/Tasmota/issues/23162) - Matter prepare for ICD cluster [#23158](https://github.com/arendst/Tasmota/issues/23158) - LVGL experimental mirroring of display on Web UI [#23041](https://github.com/arendst/Tasmota/issues/23041) @@ -144,6 +145,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ### Fixed - Too many zeros in RCSwitch received data regression from v14.4.1.4 [#23050](https://github.com/arendst/Tasmota/issues/23050) +- ESP32 receive incomplete serial data over 128 bytes [#23156](https://github.com/arendst/Tasmota/issues/23156) - ESP32 intermittent exception on WiFi AP cannot be reached [#23115](https://github.com/arendst/Tasmota/issues/23115) - ESP32-C3 WiFi sleep [#23096](https://github.com/arendst/Tasmota/issues/23096) - Berry prevent `import` from hiding a solidified class [#23112](https://github.com/arendst/Tasmota/issues/23112) diff --git a/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp b/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp index 242aa5a99..0a25a1723 100644 --- a/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp +++ b/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp @@ -168,6 +168,12 @@ void TasmotaSerial::Esp32Begin(void) { if (m_speed <= 9600) { // At 9600, 10 chars are ~10ms uart_set_rx_full_threshold(m_uart, 10); + } else { + // At 19200, 120 chars are ~60ms + // At 76800, 120 chars are ~15ms + uart_set_rx_full_threshold(m_uart, 120); + } +/* } else if (m_speed < 115200) { // At 19200, 120 chars are ~60ms // At 76800, 120 chars are ~15ms @@ -180,6 +186,7 @@ void TasmotaSerial::Esp32Begin(void) { // At even higher speeds set 75% of the buffer uart_set_rx_full_threshold(m_uart, serial_buffer_size * 3 / 4); } +*/ // For bitrate below 115200, set the Rx time out to 6 chars instead of the default 10 if (m_speed < 115200) { // At 76800 the timeout is ~1ms