From 63606dd4bb14d1b8275d8cee01f1bb5821df20c1 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 18 Apr 2026 08:09:03 -0500 Subject: [PATCH] [esp8266] Pin tool-esptoolpy to 5.x to match ESP32 platform The platform-espressif8266 4.2.1 platform manifest pins tool-esptoolpy to ~1.30000.0, while the pioarduino ESP32 platform uses 5.2.0. Because PlatformIO stores tool-esptoolpy in a single shared package directory, switching between esp8266 and esp32 builds forces PlatformIO to uninstall and reinstall the package every time. Override the pin on the ESP8266 side to the same pioarduino 5.2.0 build so both platforms resolve to the same installed package. ESPHome already invokes its own Python esptool 5.2.0 for uploads, and modern esptool still accepts the legacy underscore CLI flags used by the ESP8266 platform's builder scripts. --- esphome/components/esp8266/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/esphome/components/esp8266/__init__.py b/esphome/components/esp8266/__init__.py index bef7e36470..6a72bb429e 100644 --- a/esphome/components/esp8266/__init__.py +++ b/esphome/components/esp8266/__init__.py @@ -264,7 +264,14 @@ async def to_code(config): cg.add_platformio_option("platform", conf[CONF_PLATFORM_VERSION]) cg.add_platformio_option( "platform_packages", - [f"platformio/framework-arduinoespressif8266@{conf[CONF_SOURCE]}"], + [ + f"platformio/framework-arduinoespressif8266@{conf[CONF_SOURCE]}", + # Override the ancient tool-esptoolpy ~1.30000.0 pinned by + # platform-espressif8266 4.2.1 with the same 5.x build the + # pioarduino ESP32 platform uses, so both platforms share the + # same installed package and stop reinstalling on every switch. + "pioarduino/tool-esptoolpy@https://github.com/pioarduino/registry/releases/download/0.0.1/esptoolpy-v5.2.0.zip", + ], ) # Default for platformio is LWIP2_LOW_MEMORY with: