Updating a Beken or Lightning chip over Wi-Fi with ESPHome is about to get noticeably shorter. Change #21642 by J. Nick Koston (bdraco), merged into ESPHome's development branch on 26 October 2026, makes the CLI send only the parts of a LibreTiny firmware file the device actually writes. That roughly cuts the upload by 60% for BK72xx and LN882H chips. It is set to ship in ESPHome 2026.11.
Where the waste came from
A LibreTiny UF2 file carries one image per update scheme. On BK72xx, one of those is the full app image used only by the UART flasher, about 1.7 MB of UF2 blocks. The device's own UF2 writer ignores it during an OTA update, but ESPHome still sent the whole file over the air.
Now the CLI reads the partition tags in each image and drops the ones no on-device scheme writes. It keeps both slots on devices with dual OTA, since it cannot know which slot is running, and it renumbers the remaining blocks so the device's size check still passes. If the file is not a well formed UF2, or there is nothing to drop, it goes out unchanged.
The numbers
Sizes from the change description:
- BK7238: 2,109,952 down to 828,928 bytes;
- CB3S (BK7231N): 1,740,288 down to 674,816 bytes;
- LN882H: 1,684,992 down to 644,608 bytes;
- Realtek BW15: only 1,062,912 down to 987,648 bytes, because Realtek chips keep both OTA slots.
On a BK7238 over what the author calls a slow, noisy bench link, the same build took 42.8-74.8 s to upload in full and 21.3-35.2 s trimmed.
What changes for users
Nothing to configure. The trim applies to native OTA and web_server OTA uploads, including esphome upload --file and installs from ESPHome Device Builder. No firmware change is needed on the device. The firmware.uf2 file used for serial flashing and downloads stays complete, because the trimming happens at upload time.
The author flags one risk for maintainers: if a future LibreTiny release changed the meaning of the partition tags, the trim could keep the wrong image. A device that receives no image for its scheme reports success and keeps its old firmware (he tried it on a BK7238), so LibreTiny upgrades in ESPHome should include an OTA upload test.
A second speedup on the way
A related change, #21641, is still under review. It speeds up inflating compressed OTA uploads on the device by about five times. On a BK7231N that means about 0.74 µs per byte instead of 3.8 µs, so a 2.25 MB UF2 costs 1.7 s of CPU time instead of 8.7 s. The trade-off is about 740 bytes of flash and 1.1 KB of heap.