diff --git a/esphome/components/esphome/ota/__init__.py b/esphome/components/esphome/ota/__init__.py index cbab552fc2..816cb7b6c8 100644 --- a/esphome/components/esphome/ota/__init__.py +++ b/esphome/components/esphome/ota/__init__.py @@ -308,9 +308,10 @@ async def to_code(config: ConfigType) -> None: if config.get(CONF_ALLOW_PARTITION_ACCESS): cg.add_define("USE_OTA_PARTITIONS") - # ESP8266 inflates gzip in its bootloader; every other platform inflates - # a deflate stream on the fly while it receives the image - if not CORE.is_esp8266: + # ESP8266 and RP2040 inflate a gzip image at reboot from their bootloader + # or OTA stub; every other platform inflates a deflate stream on the fly + # while it receives the image + if not (CORE.is_esp8266 or CORE.is_rp2): cg.add_define("USE_OTA_DEFLATE") # One key per device: an api encryption block supplies it (static or diff --git a/esphome/components/ota/ota_backend_arduino_rp2.h b/esphome/components/ota/ota_backend_arduino_rp2.h index f7c0037bd2..75f12f44b0 100644 --- a/esphome/components/ota/ota_backend_arduino_rp2.h +++ b/esphome/components/ota/ota_backend_arduino_rp2.h @@ -15,7 +15,9 @@ class ArduinoRP2OTABackend final { OTAResponseTypes write(uint8_t *data, size_t len); OTAResponseTypes end(); void abort(); - bool supports_compression() { return false; } + // A gzip image is staged on LittleFS as is; the core's OTA stub inflates it + // into the app region at reboot, the same way the ESP8266 bootloader does + bool supports_compression() { return true; } private: bool md5_set_{false};