1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 00:31:58 +00:00

[web_server] Add RP2040 platform support (#13576)

This commit is contained in:
J. Nick Koston
2026-01-27 17:18:31 -10:00
committed by GitHub
parent f87aa384d0
commit f73c539ea7
7 changed files with 16 additions and 5 deletions

View File

@@ -1 +1 @@
a172e2f65981e98354cc6b5ecf69bdb055dd13602226042ab2c7acd037a2bf41 08c21fa4c044fd80c8f3296371f30c4f5ff3418f1bc1efe63c5bad938301f122

View File

@@ -38,8 +38,10 @@ async def to_code(config):
# https://github.com/ESP32Async/ESPAsyncTCP # https://github.com/ESP32Async/ESPAsyncTCP
cg.add_library("ESP32Async/ESPAsyncTCP", "2.0.0") cg.add_library("ESP32Async/ESPAsyncTCP", "2.0.0")
elif CORE.is_rp2040: elif CORE.is_rp2040:
# https://github.com/khoih-prog/AsyncTCP_RP2040W # https://github.com/ayushsharma82/RPAsyncTCP
cg.add_library("khoih-prog/AsyncTCP_RP2040W", "1.2.0") # RPAsyncTCP is a drop-in replacement for AsyncTCP_RP2040W with better
# ESPAsyncWebServer compatibility
cg.add_library("ayushsharma82/RPAsyncTCP", "1.3.2")
# Other platforms (host, etc) use socket-based implementation # Other platforms (host, etc) use socket-based implementation

View File

@@ -8,8 +8,8 @@
// Use ESPAsyncTCP library for ESP8266 (always Arduino) // Use ESPAsyncTCP library for ESP8266 (always Arduino)
#include <ESPAsyncTCP.h> #include <ESPAsyncTCP.h>
#elif defined(USE_RP2040) #elif defined(USE_RP2040)
// Use AsyncTCP_RP2040W library for RP2040 // Use RPAsyncTCP library for RP2040
#include <AsyncTCP_RP2040W.h> #include <RPAsyncTCP.h>
#else #else
// Use socket-based implementation for other platforms // Use socket-based implementation for other platforms
#include "async_tcp_socket.h" #include "async_tcp_socket.h"

View File

@@ -31,6 +31,7 @@ from esphome.const import (
PLATFORM_ESP32, PLATFORM_ESP32,
PLATFORM_ESP8266, PLATFORM_ESP8266,
PLATFORM_LN882X, PLATFORM_LN882X,
PLATFORM_RP2040,
PLATFORM_RTL87XX, PLATFORM_RTL87XX,
) )
from esphome.core import CORE, CoroPriority, coroutine_with_priority from esphome.core import CORE, CoroPriority, coroutine_with_priority
@@ -213,6 +214,7 @@ CONFIG_SCHEMA = cv.All(
PLATFORM_ESP8266, PLATFORM_ESP8266,
PLATFORM_BK72XX, PLATFORM_BK72XX,
PLATFORM_LN882X, PLATFORM_LN882X,
PLATFORM_RP2040,
PLATFORM_RTL87XX, PLATFORM_RTL87XX,
] ]
), ),

View File

@@ -47,5 +47,10 @@ async def to_code(config):
cg.add_library("ESP8266WiFi", None) cg.add_library("ESP8266WiFi", None)
if CORE.is_libretiny: if CORE.is_libretiny:
CORE.add_platformio_option("lib_ignore", ["ESPAsyncTCP", "RPAsyncTCP"]) CORE.add_platformio_option("lib_ignore", ["ESPAsyncTCP", "RPAsyncTCP"])
if CORE.is_rp2040:
# Ignore bundled AsyncTCP libraries - we use RPAsyncTCP from async_tcp component
CORE.add_platformio_option(
"lib_ignore", ["ESPAsyncTCP", "AsyncTCP", "AsyncTCP_RP2040W"]
)
# https://github.com/ESP32Async/ESPAsyncWebServer/blob/main/library.json # https://github.com/ESP32Async/ESPAsyncWebServer/blob/main/library.json
cg.add_library("ESP32Async/ESPAsyncWebServer", "3.9.5") cg.add_library("ESP32Async/ESPAsyncWebServer", "3.9.5")

View File

@@ -200,6 +200,7 @@ platform_packages =
framework = arduino framework = arduino
lib_deps = lib_deps =
${common:arduino.lib_deps} ${common:arduino.lib_deps}
ayushsharma82/RPAsyncTCP@1.3.2 ; async_tcp
bblanchon/ArduinoJson@7.4.2 ; json bblanchon/ArduinoJson@7.4.2 ; json
ESP32Async/ESPAsyncWebServer@3.9.5 ; web_server_base ESP32Async/ESPAsyncWebServer@3.9.5 ; web_server_base
build_flags = build_flags =

View File

@@ -0,0 +1 @@
<<: !include common_v2.yaml