From 15ad89f66db8f93e6924a0ba6b0f28c3220e21bb Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 26 Dec 2025 22:33:38 -1000 Subject: [PATCH 1/4] Update esphome/components/ota/ota_backend_esp8266.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- esphome/components/ota/ota_backend_esp8266.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/ota/ota_backend_esp8266.cpp b/esphome/components/ota/ota_backend_esp8266.cpp index fe829ab0629..f41e7a2b2db 100644 --- a/esphome/components/ota/ota_backend_esp8266.cpp +++ b/esphome/components/ota/ota_backend_esp8266.cpp @@ -223,7 +223,7 @@ bool ESP8266OTABackend::write_buffer_() { } bool ESP8266OTABackend::write_buffer_final_() { - // Same as write_buffer_() but without MD5 update (for final padded write) + // Similar to write_buffer_(), but without flash mode patching or MD5 update (for final padded write) if (this->buffer_len_ == 0) { return true; } From c91f56171b3728f0b5d76e1f04771494d8d6032f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 26 Dec 2025 22:34:22 -1000 Subject: [PATCH 2/4] Update esphome/components/ota/ota_backend_esp8266.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- esphome/components/ota/ota_backend_esp8266.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/ota/ota_backend_esp8266.cpp b/esphome/components/ota/ota_backend_esp8266.cpp index f41e7a2b2db..51a3f99da86 100644 --- a/esphome/components/ota/ota_backend_esp8266.cpp +++ b/esphome/components/ota/ota_backend_esp8266.cpp @@ -334,9 +334,9 @@ bool ESP8266OTABackend::verify_end_() { return false; } -// Check if new firmware's flash size fits (only when auto-detection is disabled) -// With FLASH_MAP_SUPPORT (modern cores), flash size is auto-detected from chip #if !FLASH_MAP_SUPPORT + // Check if new firmware's flash size fits (only when auto-detection is disabled) + // With FLASH_MAP_SUPPORT (modern cores), flash size is auto-detected from chip // NOLINTNEXTLINE(readability-static-accessed-through-instance) uint32_t bin_flash_size = ESP.magicFlashChipSize((bytes[3] & 0xf0) >> 4); // NOLINTNEXTLINE(readability-static-accessed-through-instance) From d0ba608ffa3e6494b73476f0cc71946bee5dfc90 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 26 Dec 2025 22:35:27 -1000 Subject: [PATCH 3/4] add comment --- esphome/components/ota/ota_backend_esp8266.h | 1 + 1 file changed, 1 insertion(+) diff --git a/esphome/components/ota/ota_backend_esp8266.h b/esphome/components/ota/ota_backend_esp8266.h index d3668d4d109..8580e5b52b2 100644 --- a/esphome/components/ota/ota_backend_esp8266.h +++ b/esphome/components/ota/ota_backend_esp8266.h @@ -19,6 +19,7 @@ class ESP8266OTABackend : public OTABackend { OTAResponseTypes write(uint8_t *data, size_t len) override; OTAResponseTypes end() override; void abort() override; + // Compression supported in all ESP8266 Arduino versions ESPHome supports (>= 2.7.0) bool supports_compression() override { return true; } protected: From 5b9c7d1322a37718a773f7e247bf58a7fde1cdab Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 26 Dec 2025 22:36:12 -1000 Subject: [PATCH 4/4] Update esphome/components/ota/ota_backend_esp8266.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- esphome/components/ota/ota_backend_esp8266.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/ota/ota_backend_esp8266.h b/esphome/components/ota/ota_backend_esp8266.h index 8580e5b52b2..a9d6dd2ccc5 100644 --- a/esphome/components/ota/ota_backend_esp8266.h +++ b/esphome/components/ota/ota_backend_esp8266.h @@ -50,7 +50,7 @@ class ESP8266OTABackend : public OTABackend { size_t image_size_{0}; md5::MD5Digest md5_{}; - uint8_t expected_md5_[16]; // MD5 = 16 bytes + uint8_t expected_md5_[16]; // Fixed-size buffer for 128-bit (16-byte) MD5 digest bool md5_set_{false}; };