Skip to content

Prototype ESP8266 support - #122

Draft
willmmiles wants to merge 1 commit into
mainfrom
esp8266-support
Draft

Prototype ESP8266 support#122
willmmiles wants to merge 1 commit into
mainfrom
esp8266-support

Conversation

@willmmiles

Copy link
Copy Markdown

Believe it or not, basic support for the venerable ESP8266 required only fairly shallow changes to this library:

  • Import the logging bits from AsyncWebServer
  • Abstract over LwIP's err_t
  • Add "direct" versions of the LwIP wrappers, without tcpip_api_call
    • This has some intrinsic value anyways - they'll be very slightly more efficient when CONFIG_LWIP_TCPIP_CORE_LOCKING is set. It wasn't worth the extra code complexity to maintain two versions without some other advantage, though.
  • (Ab)use the ESP8266 Arduino core Schedule primitive to simulate a task in the cooperative environment. Not the most efficient but functional.

I did some very basic testing with the WebSocketsTest example in AsyncWebServer; it had no trouble with an overnight run. (It did require enabling progmem forgiveness but I have not yet looked at why.)

Opened more for discussion than anything else. If there's any interest in pursuing this, I'd suggest giving some thought to breaking AsyncTCP.cpp down into smaller chunks - perhaps local headers - for easier management.

Further thoughts:

  • A "no async task" mode that runs callbacks right off the LwIP task, like ESPAsyncTCP used to do. This has potential value for high performance applications on ESP32 as well. It may or may not dovetail with allowing multiple async tasks.
  • There's probably a better tool than Schedule abuse: it requires an awful lot of heap traffic this way (specifically, an additional allocation per event). Possibly schedule_recurrent_function_us offers a cleaner generic "add something to a polling engine" API.

@dimecho

dimecho commented Sep 6, 2026

Copy link
Copy Markdown

Added BearSSL support for my project, can do a pull request if this goes through.

commit 2d0a41b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants