Skip to content

feat(esp8266): OTA via the core's ArduinoOTA, in its own component TU (#4946) - #4956

Merged
zackees merged 7 commits into
masterfrom
feat/4946-esp8266-ota
Oct 28, 2026
Merged

zackees merged 7 commits into
masterfrom
feat/4946-esp8266-ota

Conversation

@zackees

@zackees zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member

Stacked on #4955. Fixes #4946. Part of #4949.

Problem

src/platforms/ota.cpp.hpp had no ESP8266 branch — OTA was effectively
ESP32-only. ESP8266 supports OTA in the Arduino core (ArduinoOTA/Update).

Change

  • ota.cpp.hpp — extend FL_OTA_HAS_PLATFORM_IMPL to ESP8266, gated by
    FL_HAS_INCLUDE(<ArduinoOTA.h>) (never guess a header's presence).
  • platforms/esp/8266/ota/ota_impl.cpp.hpp (new) — Esp8266OTA : IOTA
    over the core's verified ArduinoOTA: Wi-Fi STA setup + optional AP fallback,
    setHostname/setPassword, onStart/Progress/End/Error wired to the
    fl::function callbacks, poll() → ArduinoOTA.handle(), isConnected().
    No web-OTA HTTP server on ESP8266, so getFailedServices() reports
    HTTP_FAILED (Arduino-IDE OTA on port 3232 works).
  • platforms/esp/8266/ota/_build.cpp.hpp + fl/build/platforms.esp.8266.ota+.cpp
    (new) — backend isolation in its own component TU, mirroring
    platforms.esp.32.ota+.cpp (ESP32: WiFi stack linked into Blink via esp_wifi_init in the platforms+ unity object (~3 KB flash, ~1.6 KB RAM) #4726): IOTA::create() is the strong reference
    that pulls the TU, so ArduinoOTA/WiFi link only when fl::net::OTA is used.
  • examples/OTA/OTA.ino — @filter widened to ((platform is esp32) or (platform is esp8266)) (the sketch is platform-agnostic); README updated.

Test plan / evidence

  • bash compile esp8266 --examples OTA → compiles and links (14/14 TUs,
    flash 276,231 B — the OTA stack is pulled in because the sketch uses it).
  • bash compile esp8266 --examples Blink → flash 264,671 B, equal to the
    master baseline — the ArduinoOTA/WiFi stack is elided when unused, which
    is the point of the separate TU.
  • ci/lint.py --strict clean on the new files (StdintType/PlatformTrampoline).
  • On-device OTA push is the remaining acceptance step (needs a board + network).

The memory bot posted two tables (deltas plus a separate absolute-size
breakdown). Fold them into one: each cell is the PR's bytes followed by the
delta from the merge base, red for larger and green for smaller or unchanged.

Target selection now follows the changed files through the new
ci/changed_targets.py: platform-only changes measure that platform (ESP8266
included), common code measures the cheap AVR target, and stub/WASM-only
changes measure nothing. Labels stay additive. The ESP32-S3 bloat gate uses
the same classifier so a non-ESP-platform or stub/WASM change skips its build
instead of spending runner minutes on an image it cannot move.
The measure job copies memory_report.py over the merge-base checkout, which
predates ci/changed_targets.py, so the new top-level import broke every
measurement. Import the classifier lazily inside plan() instead.

Also stop the comment job from passing an unexpanded out/base-*.json glob to
pathlib when a measurement failed; it now posts a short failure note.
Agents that read AGENTS.md now get the same instructions as Claude.
A relative symlink (not a copy) so the two can never drift.
…#4946)

src/platforms/ota.cpp.hpp had no ESP8266 branch -- OTA was ESP32-only. Add an
ESP8266 backend that links the core's verified ArduinoOTA library.

- ota.cpp.hpp: extend FL_OTA_HAS_PLATFORM_IMPL to ESP8266, gated by
  FL_HAS_INCLUDE(<ArduinoOTA.h>) (never guess the header).
- platforms/esp/8266/ota/ota_impl.cpp.hpp (new): Esp8266OTA implementing the
  IOTA interface over ArduinoOTA -- Wi-Fi STA/AP-fallback setup, hostname,
  password, onStart/Progress/End/Error callbacks, poll() -> ArduinoOTA.handle(),
  isConnected(). No web-OTA HTTP server on ESP8266, so getFailedServices()
  reports HTTP_FAILED.
- platforms/esp/8266/ota/_build.cpp.hpp + fl/build/platforms.esp.8266.ota+.cpp
  (new): the backend lives in its own component TU (mirrors ESP32, #4726) so
  ArduinoOTA/WiFi reach the linker only when a sketch uses fl::net::OTA.
- examples/OTA/OTA.ino: widen the @filter to esp8266 (the sketch is
  platform-agnostic); README updated.

Verified: bash compile esp8266 --examples OTA compiles AND links (14/14 TUs,
flash 276,231 B, the OTA stack pulled in); Blink stays at 264,671 B (equal to
master) -- the OTA/WiFi stack is elided when unused.

Refs #4946, #4949.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Oct 27, 2026
@zackees
zackees changed the base branch from feat/4940-driver-enable-define-lint to master October 28, 2026 00:24
@zackees
zackees merged commit e38f8ed into master Oct 28, 2026
3 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Oct 28, 2026
@zackees
zackees deleted the feat/4946-esp8266-ota branch November 5, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ESP8266: OTA update support (no path today)

1 participant