Compare commits

...

22 Commits

Author SHA1 Message Date
J. Nick Koston
c12b116176 fix 2026-01-09 13:41:14 -10:00
J. Nick Koston
a1044664ab fix 2026-01-09 13:39:38 -10:00
J. Nick Koston
4365e7a963 fix 2026-01-09 13:36:11 -10:00
J. Nick Koston
b0dfceb6d2 tweaks 2026-01-09 13:24:35 -10:00
J. Nick Koston
883d2c506f tweaks 2026-01-09 13:21:23 -10:00
J. Nick Koston
8bb201262f tweaks 2026-01-09 13:18:38 -10:00
J. Nick Koston
e54060e296 tweaks 2026-01-09 13:17:38 -10:00
J. Nick Koston
d3c3454778 tweaks 2026-01-09 13:16:52 -10:00
J. Nick Koston
32e0f2624d tweaks 2026-01-09 13:15:29 -10:00
J. Nick Koston
80d3adf703 tweaks 2026-01-09 13:15:13 -10:00
J. Nick Koston
b7f95f5fc0 tweaks 2026-01-09 13:08:41 -10:00
J. Nick Koston
6640205150 tweaks 2026-01-09 13:07:18 -10:00
J. Nick Koston
8de9be679c tweaks 2026-01-09 13:02:26 -10:00
J. Nick Koston
72983bd83d tweak 2026-01-09 11:53:51 -10:00
J. Nick Koston
fc2324c002 wip 2026-01-09 11:49:07 -10:00
J. Nick Koston
e227fc4f1a wip 2026-01-09 11:24:36 -10:00
J. Nick Koston
59bd60b4e2 wip 2026-01-09 11:21:20 -10:00
J. Nick Koston
6b02f9f1ec wip 2026-01-09 11:16:51 -10:00
J. Nick Koston
45cab9b5b8 wip 2026-01-09 11:16:20 -10:00
J. Nick Koston
12c8c5cd7f Merge remote-tracking branch 'upstream/dev' into web_server_cap_portal_co_exist 2026-01-09 10:17:51 -10:00
J. Nick Koston
be059b3368 update header 2026-01-09 10:10:25 -10:00
J. Nick Koston
10ed44165d [captive_portal] Allow web_server access while captive portal is active 2026-01-08 15:42:05 -10:00
24 changed files with 604 additions and 285 deletions

View File

@@ -101,19 +101,23 @@ async def to_code(config):
if config[CONF_COMPRESSION] == "gzip":
cg.add_define("USE_CAPTIVE_PORTAL_GZIP")
if CORE.using_arduino:
if CORE.is_esp8266:
cg.add_library("DNSServer", None)
if CORE.is_libretiny:
cg.add_library("DNSServer", None)
# All platforms now use our custom DNS server implementations
# Only compile the ESP-IDF DNS server when using ESP-IDF framework
# Compile platform-specific DNS server implementations
# ESP32 Arduino uses IDF components, so both use dns_server_esp32_idf.cpp
FILTER_SOURCE_FILES = filter_source_files_from_platform(
{
"dns_server_esp32_idf.cpp": {
PlatformFramework.ESP32_ARDUINO,
PlatformFramework.ESP32_IDF,
},
"dns_server_arduino.cpp": {
PlatformFramework.ESP8266_ARDUINO,
PlatformFramework.RP2040_ARDUINO,
PlatformFramework.BK72XX_ARDUINO,
PlatformFramework.RTL87XX_ARDUINO,
PlatformFramework.LN882X_ARDUINO,
},
}
)

View File

@@ -7,145 +7,162 @@ namespace esphome::captive_portal {
#ifdef USE_CAPTIVE_PORTAL_GZIP
const uint8_t INDEX_GZ[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x95, 0x56, 0xeb, 0x6f, 0xd4, 0x38, 0x10, 0xff, 0xce,
0x5f, 0xe1, 0x33, 0x8f, 0x26, 0xd0, 0x3c, 0xb7, 0xdb, 0x96, 0x6c, 0x12, 0x04, 0xdc, 0x21, 0x90, 0x28, 0x20, 0xb5,
0x70, 0x1f, 0x10, 0x52, 0xbd, 0xc9, 0x64, 0x63, 0x9a, 0x38, 0x39, 0xdb, 0xfb, 0x62, 0xb5, 0xf7, 0xb7, 0xdf, 0x38,
0xc9, 0x6e, 0xb7, 0x15, 0x9c, 0xee, 0x5a, 0x35, 0x1d, 0xdb, 0xf3, 0xf8, 0xcd, 0x78, 0x1e, 0x8e, 0x7f, 0xcb, 0x9b,
0x4c, 0xaf, 0x5b, 0x20, 0xa5, 0xae, 0xab, 0x34, 0x36, 0x5f, 0x52, 0x31, 0x31, 0x4b, 0x40, 0xe0, 0x0a, 0x58, 0x9e,
0xc6, 0x35, 0x68, 0x46, 0xb2, 0x92, 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b, 0xeb, 0x4a, 0xf3, 0x96, 0x49, 0x6d, 0xc5, 0x7a, 0x06, 0xd1, 0x4f, 0x3e, 0xd8, 0x7b, 0x1c, 0x49, 0xa1,
0x73, 0xa3, 0x63, 0x4c, 0xc9, 0xc9, 0xaa, 0x93, 0xb6, 0x07, 0x76, 0x05, 0xdd, 0x6b, 0x07, 0xdd, 0xd3, 0x07, 0xf6,
0x1f, 0x8f, 0xbf, 0x01, 0x7d, 0x9a, 0x47, 0xb5, 0x88, 0x0c, 0x00, 0x00};
#else // Brotli (default, smaller)
const uint8_t INDEX_BR[] PROGMEM = {
0x1b, 0xf8, 0x0a, 0x00, 0x64, 0x5a, 0xd3, 0xfa, 0xe7, 0xf3, 0x62, 0xd8, 0x06, 0x1b, 0xe9, 0x6a, 0x8a, 0x81, 0x2b,
0xb5, 0x49, 0x14, 0x37, 0xdc, 0x9e, 0x1a, 0xcb, 0x56, 0x87, 0xfb, 0xff, 0xf7, 0x73, 0x75, 0x12, 0x0a, 0xd6, 0x48,
0x84, 0xc6, 0x21, 0xa4, 0x6d, 0xb5, 0x71, 0xef, 0x13, 0xbe, 0x4e, 0x54, 0xf1, 0x64, 0x8f, 0x3f, 0xcc, 0x9a, 0x78,
0xa5, 0x89, 0x25, 0xb3, 0xda, 0x2c, 0xa2, 0x32, 0x9c, 0x57, 0x07, 0x56, 0xbc, 0x34, 0x13, 0xff, 0x5c, 0x0a, 0xa1,
0x67, 0x82, 0xb8, 0x6b, 0x4c, 0x76, 0x31, 0x6c, 0xe3, 0x40, 0x46, 0xea, 0xb0, 0xd4, 0xf4, 0x3b, 0x02, 0x65, 0x18,
0xa4, 0xaf, 0xac, 0x6d, 0x55, 0xd6, 0xbe, 0x59, 0x66, 0x7a, 0x7c, 0x60, 0xb2, 0x83, 0x33, 0x23, 0xc9, 0x79, 0x82,
0x47, 0xb4, 0x28, 0xf4, 0x24, 0xb5, 0x23, 0x5a, 0x44, 0xe1, 0xc3, 0x27, 0x04, 0xe8, 0x0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wards compatibility alias
#define INDEX_GZ INDEX_BR

View File

@@ -43,7 +43,11 @@ void CaptivePortal::handle_config(AsyncWebServerRequest *request) {
scan.get_with_auth());
#endif
}
#ifdef USE_WEBSERVER
stream->print(ESPHOME_F("],\"web_server\":true}"));
#else
stream->print(ESPHOME_F("]}"));
#endif
request->send(stream);
}
void CaptivePortal::handle_wifisave(AsyncWebServerRequest *request) {
@@ -76,15 +80,9 @@ void CaptivePortal::start() {
network::IPAddress ip = wifi::global_wifi_component->wifi_soft_ap_ip();
#if defined(USE_ESP32)
// Create DNS server instance for ESP-IDF
// Create DNS server instance with domain allowlisting support
this->dns_server_ = make_unique<DNSServer>();
this->dns_server_->start(ip);
#elif defined(USE_ARDUINO)
this->dns_server_ = make_unique<DNSServer>();
this->dns_server_->setErrorReplyCode(DNSReplyCode::NoError);
this->dns_server_->start(53, ESPHOME_F("*"), ip);
#endif
this->initialized_ = true;
this->active_ = true;
@@ -127,6 +125,10 @@ float CaptivePortal::get_setup_priority() const {
}
void CaptivePortal::dump_config() { ESP_LOGCONFIG(TAG, "Captive Portal:"); }
bool CaptivePortal::canHandle(AsyncWebServerRequest *request) const {
return this->active_ && request->method() == HTTP_GET;
}
CaptivePortal *global_captive_portal = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
} // namespace captive_portal

View File

@@ -4,8 +4,8 @@
#include <memory>
#if defined(USE_ESP32)
#include "dns_server_esp32_idf.h"
#elif defined(USE_ARDUINO)
#include <DNSServer.h>
#elif defined(USE_ESP8266) || defined(USE_RP2040) || defined(USE_LIBRETINY)
#include "dns_server_arduino.h"
#endif
#include "esphome/core/component.h"
#include "esphome/core/helpers.h"
@@ -22,15 +22,9 @@ class CaptivePortal : public AsyncWebHandler, public Component {
void setup() override;
void dump_config() override;
void loop() override {
#if defined(USE_ESP32)
if (this->dns_server_ != nullptr) {
this->dns_server_->process_next_request();
}
#elif defined(USE_ARDUINO)
if (this->dns_server_ != nullptr) {
this->dns_server_->processNextRequest();
}
#endif
}
float get_setup_priority() const override;
void start();
@@ -45,12 +39,7 @@ class CaptivePortal : public AsyncWebHandler, public Component {
}
}
bool canHandle(AsyncWebServerRequest *request) const override {
// Handle all GET requests when captive portal is active
// This allows us to respond with the portal page for any URL,
// triggering OS captive portal detection
return this->active_ && request->method() == HTTP_GET;
}
bool canHandle(AsyncWebServerRequest *request) const override;
void handle_config(AsyncWebServerRequest *request);

View File

@@ -0,0 +1,130 @@
#include "dns_server_arduino.h"
#if defined(USE_ESP8266) || defined(USE_RP2040) || defined(USE_LIBRETINY)
#include "dns_server_common.h"
#include "esphome/core/log.h"
#include <lwip/def.h>
namespace esphome::captive_portal {
static const char *const TAG = "captive_portal.dns";
void DNSServer::start(const network::IPAddress &ip) {
this->server_ip_ = ip;
ESP_LOGV(TAG, "Starting DNS server");
this->udp_ = make_unique<WiFiUDP>();
if (!this->udp_->begin(DNS_PORT)) {
ESP_LOGE(TAG, "Failed to start UDP on port %d", DNS_PORT);
this->udp_ = nullptr;
return;
}
ESP_LOGV(TAG, "Bound to port %d", DNS_PORT);
}
void DNSServer::stop() {
if (this->udp_ != nullptr) {
this->udp_->stop();
this->udp_ = nullptr;
}
ESP_LOGV(TAG, "Stopped");
}
void DNSServer::process_next_request() {
if (this->udp_ == nullptr) {
return;
}
int packet_size = this->udp_->parsePacket();
if (packet_size == 0) {
return;
}
if (packet_size > static_cast<int>(sizeof(this->buffer_))) {
// Packet too large, skip it
while (this->udp_->available()) {
this->udp_->read();
}
return;
}
int len = this->udp_->read(this->buffer_, sizeof(this->buffer_));
if (len < static_cast<int>(sizeof(DNSHeader) + 1)) {
ESP_LOGV(TAG, "Request too short: %d", len);
return;
}
// Parse DNS header
DNSHeader *header = (DNSHeader *) this->buffer_;
uint16_t flags = ntohs(header->flags);
uint16_t qd_count = ntohs(header->qd_count);
// Check if it's a standard query
if ((flags & DNS_QR_FLAG) || (flags & DNS_OPCODE_MASK) || qd_count != 1) {
ESP_LOGV(TAG, "Not a standard query: flags=0x%04X, qd_count=%d", flags, qd_count);
return;
}
// Parse domain name
uint8_t *ptr = this->buffer_ + sizeof(DNSHeader);
uint8_t *end = this->buffer_ + len;
char domain[128];
ptr = parse_dns_domain(ptr, end, domain, sizeof(domain));
if (ptr == nullptr) {
return; // Invalid domain name
}
// Check allowlist and send REFUSED if needed
if (is_allowlisted_domain(domain)) {
ESP_LOGV(TAG, "Allowlisted domain, sending REFUSED: %s", domain);
build_dns_refused_header(header);
this->udp_->beginPacket(this->udp_->remoteIP(), this->udp_->remotePort());
this->udp_->write(this->buffer_, len);
this->udp_->endPacket();
return;
}
ESP_LOGV(TAG, "Redirecting DNS query for: %s", domain);
// Check we have room for the question
if (ptr + sizeof(DNSQuestion) > end) {
return;
}
// Parse DNS question
DNSQuestion *question = (DNSQuestion *) ptr;
uint16_t qtype = ntohs(question->type);
uint16_t qclass = ntohs(question->dns_class);
if (qtype != DNS_QTYPE_A || qclass != DNS_QCLASS_IN) {
ESP_LOGV(TAG, "Not an A query: type=0x%04X, class=0x%04X", qtype, qclass);
return;
}
// Build DNS response
build_dns_response_header(header);
// Add answer section after the question
size_t question_end_offset = (ptr + sizeof(DNSQuestion)) - this->buffer_;
if (build_dns_answer(this->buffer_, sizeof(this->buffer_), question_end_offset,
static_cast<uint32_t>(this->server_ip_)) == nullptr) {
ESP_LOGW(TAG, "Response too large");
return;
}
size_t response_len = question_end_offset + sizeof(DNSAnswer);
// Send response
this->udp_->beginPacket(this->udp_->remoteIP(), this->udp_->remotePort());
this->udp_->write(this->buffer_, response_len);
if (!this->udp_->endPacket()) {
ESP_LOGV(TAG, "Send failed");
} else {
ESP_LOGV(TAG, "Sent %d bytes", response_len);
}
}
} // namespace esphome::captive_portal
#endif // USE_ESP8266 || USE_RP2040 || USE_LIBRETINY

View File

@@ -0,0 +1,26 @@
#pragma once
#if defined(USE_ESP8266) || defined(USE_RP2040) || defined(USE_LIBRETINY)
#include <memory>
#include "dns_server_common.h"
#include "esphome/core/helpers.h"
#include "esphome/components/network/ip_address.h"
#include <WiFiUdp.h>
namespace esphome::captive_portal {
class DNSServer {
public:
void start(const network::IPAddress &ip);
void stop();
void process_next_request();
protected:
std::unique_ptr<WiFiUDP> udp_{nullptr};
network::IPAddress server_ip_;
uint8_t buffer_[DNS_BUFFER_SIZE];
};
} // namespace esphome::captive_portal
#endif // USE_ESP8266 || USE_RP2040 || USE_LIBRETINY

View File

@@ -0,0 +1,133 @@
#pragma once
#include <cstdint>
#include <cstring>
#include <lwip/def.h>
#include "esphome/core/defines.h"
#include "esphome/core/progmem.h"
namespace esphome::captive_portal {
// DNS constants
static constexpr uint16_t DNS_PORT = 53;
static constexpr uint16_t DNS_QR_FLAG = 1 << 15;
static constexpr uint16_t DNS_OPCODE_MASK = 0x7800;
static constexpr uint16_t DNS_QTYPE_A = 0x0001;
static constexpr uint16_t DNS_QCLASS_IN = 0x0001;
static constexpr uint16_t DNS_ANSWER_TTL = 300;
static constexpr size_t DNS_BUFFER_SIZE = 192;
// DNS Header structure
struct DNSHeader {
uint16_t id;
uint16_t flags;
uint16_t qd_count;
uint16_t an_count;
uint16_t ns_count;
uint16_t ar_count;
} __attribute__((packed));
// DNS Question structure
struct DNSQuestion {
uint16_t type;
uint16_t dns_class;
} __attribute__((packed));
// DNS Answer structure
struct DNSAnswer {
uint16_t ptr_offset;
uint16_t type;
uint16_t dns_class;
uint32_t ttl;
uint16_t addr_len;
uint32_t ip_addr;
} __attribute__((packed));
/// Check if domain is allowlisted (web_server CDN domains)
/// Returns true if the domain should NOT be redirected
inline bool is_allowlisted_domain([[maybe_unused]] const char *domain) {
#ifdef USE_WEBSERVER
#ifdef WEBSERVER_CDN_DOMAIN_0
if (ESPHOME_strcasecmp_P(domain, ESPHOME_F(WEBSERVER_CDN_DOMAIN_0)) == 0)
return true;
#endif
#ifdef WEBSERVER_CDN_DOMAIN_1
if (ESPHOME_strcasecmp_P(domain, ESPHOME_F(WEBSERVER_CDN_DOMAIN_1)) == 0)
return true;
#endif
#endif
return false;
}
/// Parse DNS domain name from packet into string buffer
/// Returns pointer past the domain name (after null terminator), or nullptr on error
inline uint8_t *parse_dns_domain(uint8_t *ptr, const uint8_t *end, char *domain, size_t domain_size) {
size_t domain_len = 0;
while (ptr < end && *ptr != 0) {
uint8_t label_len = *ptr;
if (label_len > 63) { // Check for invalid label length
return nullptr;
}
// Check if we have room for this label plus the length byte
if (ptr + label_len + 1 > end) {
return nullptr; // Would overflow
}
// Add dot separator if not first label
if (domain_len > 0 && domain_len < domain_size - 1) {
domain[domain_len++] = '.';
}
// Copy label to domain string
for (uint8_t i = 0; i < label_len && domain_len < domain_size - 1; i++) {
domain[domain_len++] = ptr[1 + i];
}
ptr += label_len + 1;
}
domain[domain_len] = '\0';
// Check if we reached a proper null terminator
if (ptr >= end || *ptr != 0) {
return nullptr; // Name not terminated or truncated
}
return ptr + 1; // Skip the null terminator
}
/// Build DNS response header for A record query
/// Modifies header in place, returns true if successful
inline void build_dns_response_header(DNSHeader *header) {
header->flags = htons(DNS_QR_FLAG | 0x8000); // Response + Authoritative
header->an_count = htons(1); // One answer
}
/// Build DNS REFUSED response header
/// Used when domain is allowlisted to trigger fallback to other DNS
inline void build_dns_refused_header(DNSHeader *header) {
header->flags = htons(DNS_QR_FLAG | 0x8005); // Response + REFUSED
header->an_count = 0;
header->ns_count = 0;
header->ar_count = 0;
}
/// Build DNS answer section
/// Returns the answer pointer, or nullptr if buffer too small
inline DNSAnswer *build_dns_answer(uint8_t *buffer, size_t buffer_size, size_t question_end_offset, uint32_t ip_addr) {
size_t answer_offset = question_end_offset;
// Check if we have room for the answer
if (answer_offset + sizeof(DNSAnswer) > buffer_size) {
return nullptr;
}
DNSAnswer *answer = reinterpret_cast<DNSAnswer *>(buffer + answer_offset);
// Pointer to name in question (offset from start of packet)
answer->ptr_offset = htons(0xC000 | sizeof(DNSHeader));
answer->type = htons(DNS_QTYPE_A);
answer->dns_class = htons(DNS_QCLASS_IN);
answer->ttl = htonl(DNS_ANSWER_TTL);
answer->addr_len = htons(4);
answer->ip_addr = ip_addr;
return answer;
}
} // namespace esphome::captive_portal

View File

@@ -1,8 +1,8 @@
#include "dns_server_esp32_idf.h"
#ifdef USE_ESP32
#include "dns_server_common.h"
#include "esphome/core/log.h"
#include "esphome/core/hal.h"
#include "esphome/components/socket/socket.h"
#include <lwip/sockets.h>
#include <lwip/inet.h>
@@ -11,40 +11,6 @@ namespace esphome::captive_portal {
static const char *const TAG = "captive_portal.dns";
// DNS constants
static constexpr uint16_t DNS_PORT = 53;
static constexpr uint16_t DNS_QR_FLAG = 1 << 15;
static constexpr uint16_t DNS_OPCODE_MASK = 0x7800;
static constexpr uint16_t DNS_QTYPE_A = 0x0001;
static constexpr uint16_t DNS_QCLASS_IN = 0x0001;
static constexpr uint16_t DNS_ANSWER_TTL = 300;
// DNS Header structure
struct DNSHeader {
uint16_t id;
uint16_t flags;
uint16_t qd_count;
uint16_t an_count;
uint16_t ns_count;
uint16_t ar_count;
} __attribute__((packed));
// DNS Question structure
struct DNSQuestion {
uint16_t type;
uint16_t dns_class;
} __attribute__((packed));
// DNS Answer structure
struct DNSAnswer {
uint16_t ptr_offset;
uint16_t type;
uint16_t dns_class;
uint32_t ttl;
uint16_t addr_len;
uint32_t ip_addr;
} __attribute__((packed));
void DNSServer::start(const network::IPAddress &ip) {
this->server_ip_ = ip;
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
@@ -126,27 +92,28 @@ void DNSServer::process_next_request() {
return; // Not a standard query
}
// Parse domain name (we don't actually care about it - redirect everything)
// Parse domain name
uint8_t *ptr = this->buffer_ + sizeof(DNSHeader);
uint8_t *end = this->buffer_ + len;
char domain[128];
while (ptr < end && *ptr != 0) {
uint8_t label_len = *ptr;
if (label_len > 63) { // Check for invalid label length
return;
}
// Check if we have room for this label plus the length byte
if (ptr + label_len + 1 > end) {
return; // Would overflow
}
ptr += label_len + 1;
ptr = parse_dns_domain(ptr, end, domain, sizeof(domain));
if (ptr == nullptr) {
return; // Invalid domain name
}
// Check if we reached a proper null terminator
if (ptr >= end || *ptr != 0) {
return; // Name not terminated or truncated
// Check allowlist and send REFUSED if needed
if (is_allowlisted_domain(domain)) {
ESP_LOGV(TAG, "Allowlisted domain, sending REFUSED: %s", domain);
build_dns_refused_header(header);
ssize_t sent = this->socket_->sendto(this->buffer_, len, 0, (struct sockaddr *) &client_addr, client_addr_len);
if (sent < 0) {
ESP_LOGV(TAG, "Send REFUSED failed: %d", errno);
}
return;
}
ptr++; // Skip the null terminator
ESP_LOGV(TAG, "Redirecting DNS query for: %s", domain);
// Check we have room for the question
if (ptr + sizeof(DNSQuestion) > end) {
@@ -164,34 +131,18 @@ void DNSServer::process_next_request() {
return; // Not an A query
}
// Build DNS response by modifying the request in-place
header->flags = htons(DNS_QR_FLAG | 0x8000); // Response + Authoritative
header->an_count = htons(1); // One answer
// Build DNS response
build_dns_response_header(header);
// Add answer section after the question
size_t question_len = (ptr + sizeof(DNSQuestion)) - this->buffer_ - sizeof(DNSHeader);
size_t answer_offset = sizeof(DNSHeader) + question_len;
// Check if we have room for the answer
if (answer_offset + sizeof(DNSAnswer) > sizeof(this->buffer_)) {
size_t question_end_offset = (ptr + sizeof(DNSQuestion)) - this->buffer_;
ip4_addr_t addr = this->server_ip_;
if (build_dns_answer(this->buffer_, sizeof(this->buffer_), question_end_offset, addr.addr) == nullptr) {
ESP_LOGW(TAG, "Response too large");
return;
}
DNSAnswer *answer = (DNSAnswer *) (this->buffer_ + answer_offset);
// Pointer to name in question (offset from start of packet)
answer->ptr_offset = htons(0xC000 | sizeof(DNSHeader));
answer->type = htons(DNS_QTYPE_A);
answer->dns_class = htons(DNS_QCLASS_IN);
answer->ttl = htonl(DNS_ANSWER_TTL);
answer->addr_len = htons(4);
// Get the raw IP address
ip4_addr_t addr = this->server_ip_;
answer->ip_addr = addr.addr;
size_t response_len = answer_offset + sizeof(DNSAnswer);
size_t response_len = question_end_offset + sizeof(DNSAnswer);
// Send response
ssize_t sent =

View File

@@ -2,6 +2,7 @@
#ifdef USE_ESP32
#include <memory>
#include "dns_server_common.h"
#include "esphome/core/helpers.h"
#include "esphome/components/network/ip_address.h"
#include "esphome/components/socket/socket.h"
@@ -15,8 +16,6 @@ class DNSServer {
void process_next_request();
protected:
static constexpr size_t DNS_BUFFER_SIZE = 192;
std::unique_ptr<socket::Socket> socket_{nullptr};
network::IPAddress server_ip_;
uint8_t buffer_[DNS_BUFFER_SIZE];

View File

@@ -17,7 +17,7 @@ from esphome.core import CORE, HexInt
from esphome.types import ConfigType
CODEOWNERS = ["@jesserockz"]
AUTO_LOAD = ["socket"]
AUTO_LOAD = ["network", "socket"]
byte_vector = cg.std_vector.template(cg.uint8)
peer_address_t = cg.std_ns.class_("array").template(cg.uint8, 6)

View File

@@ -149,12 +149,6 @@ bool ESPNowComponent::is_wifi_enabled() {
}
void ESPNowComponent::setup() {
#ifndef USE_WIFI
// Initialize LwIP stack for wake_loop_threadsafe() socket support
// When WiFi component is present, it handles esp_netif_init()
ESP_ERROR_CHECK(esp_netif_init());
#endif
if (this->enable_on_boot_) {
this->enable_();
} else {
@@ -174,8 +168,6 @@ void ESPNowComponent::enable() {
void ESPNowComponent::enable_() {
if (!this->is_wifi_enabled()) {
esp_event_loop_create_default();
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));

View File

@@ -102,11 +102,6 @@ void EthernetComponent::setup() {
ESPHL_ERROR_CHECK(err, "SPI bus initialize error");
#endif
err = esp_netif_init();
ESPHL_ERROR_CHECK(err, "ETH netif init error");
err = esp_event_loop_create_default();
ESPHL_ERROR_CHECK(err, "ETH event loop error");
esp_netif_config_t cfg = ESP_NETIF_DEFAULT_ETH();
this->eth_netif_ = esp_netif_new(&cfg);

View File

@@ -5,7 +5,7 @@ import esphome.codegen as cg
from esphome.components.esp32 import add_idf_sdkconfig_option
from esphome.components.psram import is_guaranteed as psram_is_guaranteed
import esphome.config_validation as cv
from esphome.const import CONF_ENABLE_IPV6, CONF_MIN_IPV6_ADDR_COUNT
from esphome.const import CONF_ENABLE_IPV6, CONF_ID, CONF_MIN_IPV6_ADDR_COUNT
from esphome.core import CORE, CoroPriority, coroutine_with_priority
CODEOWNERS = ["@esphome/core"]
@@ -20,6 +20,7 @@ CONF_ENABLE_HIGH_PERFORMANCE = "enable_high_performance"
network_ns = cg.esphome_ns.namespace("network")
IPAddress = network_ns.class_("IPAddress")
NetworkComponent = network_ns.class_("NetworkComponent", cg.Component)
def ip_address_literal(ip: str | int | None) -> cg.MockObj:
@@ -107,6 +108,7 @@ def has_high_performance_networking() -> bool:
CONFIG_SCHEMA = cv.Schema(
{
cv.GenerateID(): cv.declare_id(NetworkComponent),
cv.SplitDefault(
CONF_ENABLE_IPV6,
esp8266=False,
@@ -140,6 +142,12 @@ async def to_code(config):
if CORE.using_arduino and CORE.is_esp32:
cg.add_library("Networking", None)
# Register NetworkComponent to initialize network stack early (ESP32 only)
# This ensures esp_netif_init() is called before web_server binds
if CORE.is_esp32:
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
# Apply high performance networking settings
# Config can explicitly enable/disable, or default to component-driven behavior
enable_high_perf = config.get(CONF_ENABLE_HIGH_PERFORMANCE)

View File

@@ -0,0 +1,32 @@
#include "network_component.h"
#ifdef USE_ESP32
#include "esphome/core/log.h"
#include "esp_event.h"
#include "esp_netif.h"
namespace esphome::network {
static const char *const TAG = "network";
void NetworkComponent::setup() {
// Initialize network stack early - required before web_server can bind.
// This must run before WiFi/Ethernet setup so web_server can register
// its handlers before captive_portal.
esp_err_t err = esp_netif_init();
if (err != ESP_OK) {
ESP_LOGE(TAG, "esp_netif_init failed: %s", esp_err_to_name(err));
}
err = esp_event_loop_create_default();
if (err != ESP_OK && err != ESP_ERR_INVALID_STATE) {
// ESP_ERR_INVALID_STATE means it was already created
ESP_LOGE(TAG, "esp_event_loop_create_default failed: %s", esp_err_to_name(err));
}
}
float NetworkComponent::get_setup_priority() const {
// Run before web_server (WIFI + 0.5) and WiFi (WIFI)
return setup_priority::WIFI + 2.0f;
}
} // namespace esphome::network
#endif

View File

@@ -0,0 +1,16 @@
#pragma once
#ifdef USE_ESP32
#include "esphome/core/component.h"
namespace esphome::network {
/// Component that initializes the network stack early.
/// This allows web_server to bind before WiFi/Ethernet setup.
class NetworkComponent : public Component {
public:
void setup() override;
float get_setup_priority() const override;
};
} // namespace esphome::network
#endif

View File

@@ -35,8 +35,6 @@ void OpenThreadComponent::setup() {
.max_fds = 3,
};
ESP_ERROR_CHECK(nvs_flash_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_vfs_eventfd_register(&eventfd_config));
xTaskCreate(

View File

@@ -1,6 +1,7 @@
from __future__ import annotations
import gzip
from urllib.parse import urlparse
import esphome.codegen as cg
from esphome.components import web_server_base
@@ -42,6 +43,8 @@ CONF_SORTING_GROUP_ID = "sorting_group_id"
CONF_SORTING_GROUPS = "sorting_groups"
CONF_SORTING_WEIGHT = "sorting_weight"
# CDN host for web_server assets - used for default URLs and DNS allowlisting
CDN_HOST = "oi.esphome.io"
web_server_ns = cg.esphome_ns.namespace("web_server")
WebServer = web_server_ns.class_("WebServer", cg.Component, cg.Controller)
@@ -53,19 +56,19 @@ def default_url(config: ConfigType) -> ConfigType:
config = config.copy()
if config[CONF_VERSION] == 1:
if CONF_CSS_URL not in config:
config[CONF_CSS_URL] = "https://oi.esphome.io/v1/webserver-v1.min.css"
config[CONF_CSS_URL] = f"https://{CDN_HOST}/v1/webserver-v1.min.css"
if CONF_JS_URL not in config:
config[CONF_JS_URL] = "https://oi.esphome.io/v1/webserver-v1.min.js"
config[CONF_JS_URL] = f"https://{CDN_HOST}/v1/webserver-v1.min.js"
if config[CONF_VERSION] == 2:
if CONF_CSS_URL not in config:
config[CONF_CSS_URL] = ""
if CONF_JS_URL not in config:
config[CONF_JS_URL] = "https://oi.esphome.io/v2/www.js"
config[CONF_JS_URL] = f"https://{CDN_HOST}/v2/www.js"
if config[CONF_VERSION] == 3:
if CONF_CSS_URL not in config:
config[CONF_CSS_URL] = ""
if CONF_JS_URL not in config:
config[CONF_JS_URL] = "https://oi.esphome.io/v3/www.js"
config[CONF_JS_URL] = f"https://{CDN_HOST}/v3/www.js"
return config
@@ -335,6 +338,24 @@ async def to_code(config):
if config[CONF_COMPRESSION] == "gzip":
cg.add_define("USE_WEBSERVER_GZIP")
# Extract domains from CDN URLs for DNS allowlisting (used by captive_portal)
# This handles both default URLs (using CDN_HOST) and custom user URLs
cdn_domains: set[str] = set()
for url_key in (CONF_CSS_URL, CONF_JS_URL):
url = config.get(url_key, "")
if url:
try:
parsed = urlparse(url)
if parsed.netloc:
cdn_domains.add(parsed.netloc.lower())
except Exception: # pylint: disable=broad-except
pass
# Generate defines for each CDN domain (used by captive_portal DNS allowlist)
for i, domain in enumerate(sorted(cdn_domains)):
cg.add_define(f"WEBSERVER_CDN_DOMAIN_{i}", domain)
cg.add_define("WEBSERVER_CDN_DOMAIN_COUNT", len(cdn_domains))
if (sorting_group_config := config.get(CONF_SORTING_GROUPS)) is not None:
cg.add_define("USE_WEBSERVER_SORTING")
add_sorting_groups(var, sorting_group_config)

View File

@@ -24,6 +24,10 @@
#include "esphome/components/logger/logger.h"
#endif
#ifdef USE_CAPTIVE_PORTAL
#include "esphome/components/captive_portal/captive_portal.h"
#endif
#ifdef USE_CLIMATE
#include "esphome/components/climate/climate.h"
#endif
@@ -413,7 +417,10 @@ void WebServer::dump_config() {
" Address: %s:%u",
network::get_use_address(), this->base_->get_port());
}
float WebServer::get_setup_priority() const { return setup_priority::WIFI - 1.0f; }
float WebServer::get_setup_priority() const {
// Run before WiFi so handlers are registered before captive_portal
return setup_priority::WIFI + 0.5f;
}
#ifdef USE_WEBSERVER_LOCAL
void WebServer::handle_index_request(AsyncWebServerRequest *request) {
@@ -1959,9 +1966,20 @@ bool WebServer::canHandle(AsyncWebServerRequest *request) const {
const auto &url = request->url();
const auto method = request->method();
// Static URL checks
// Handle root URL
if (url == ESPHOME_F("/")) {
#ifdef USE_CAPTIVE_PORTAL
// When captive portal is active, only handle "/" if ?web_server param is present
// This lets captive_portal show its page at "/" while web_server handles /?web_server
if (captive_portal::global_captive_portal != nullptr && captive_portal::global_captive_portal->is_active()) {
return request->hasParam(ESPHOME_F("web_server"));
}
#endif
return true;
}
// Other static URL checks
static const char *const STATIC_URLS[] = {
"/",
#if !defined(USE_ESP32) && defined(USE_ARDUINO)
"/events",
#endif

View File

@@ -12,8 +12,6 @@ static const char *const TAG = "web_server_base";
WebServerBase *global_web_server_base = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
void WebServerBase::add_handler(AsyncWebHandler *handler) {
// remove all handlers
#ifdef USE_WEBSERVER_AUTH
if (!credentials_.username.empty()) {
handler = new internal::AuthMiddlewareHandler(handler, &credentials_);

View File

@@ -414,9 +414,6 @@ void WiFiComponent::setup() {
if (this->enable_on_boot_) {
this->start();
} else {
#ifdef USE_ESP32
esp_netif_init();
#endif
this->state_ = WIFI_COMPONENT_STATE_DISABLED;
}
}

View File

@@ -137,11 +137,6 @@ void WiFiComponent::wifi_pre_setup_() {
get_mac_address_raw(mac);
set_mac_address(mac);
}
esp_err_t err = esp_netif_init();
if (err != ERR_OK) {
ESP_LOGE(TAG, "esp_netif_init failed: %s", esp_err_to_name(err));
return;
}
s_wifi_event_group = xEventGroupCreate();
if (s_wifi_event_group == nullptr) {
ESP_LOGE(TAG, "xEventGroupCreate failed");
@@ -153,11 +148,7 @@ void WiFiComponent::wifi_pre_setup_() {
ESP_LOGE(TAG, "xQueueCreate failed");
return;
}
err = esp_event_loop_create_default();
if (err != ERR_OK) {
ESP_LOGE(TAG, "esp_event_loop_create_default failed: %s", esp_err_to_name(err));
return;
}
esp_err_t err;
esp_event_handler_instance_t instance_wifi_id, instance_ip_id;
err = esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler, nullptr, &instance_wifi_id);
if (err != ERR_OK) {

View File

@@ -10,9 +10,11 @@
#define ESPHOME_PGM_P PGM_P
#define ESPHOME_strncpy_P strncpy_P
#define ESPHOME_strncat_P strncat_P
#define ESPHOME_strcasecmp_P strcasecmp_P
#else
#define ESPHOME_F(string_literal) (string_literal)
#define ESPHOME_PGM_P const char *
#define ESPHOME_strncpy_P strncpy
#define ESPHOME_strncat_P strncat
#define ESPHOME_strcasecmp_P strcasecmp
#endif

View File

@@ -67,14 +67,14 @@ class CoroPriority(enum.IntEnum):
# Examples: esp32, esp8266, rp2040
PLATFORM = 1000
# Network infrastructure setup
# Examples: network (201)
NETWORK = 201
# Network transport layer
# Examples: async_tcp (200)
NETWORK_TRANSPORT = 200
# Network infrastructure setup - must run after CORE which adds 'using namespace esphome;'
# Examples: network (99)
NETWORK = 99
# Core system components
# Examples: esphome core, most entity base components (cover, update, datetime,
# valve, alarm_control_panel, lock, event, binary_sensor, button, climate, fan,

View File

@@ -8,9 +8,9 @@ from esphome.coroutine import CoroPriority, FakeEventLoop, coroutine_with_priori
def test_coro_priority_enum_values() -> None:
"""Test that CoroPriority enum values match expected priorities."""
assert CoroPriority.PLATFORM == 1000
assert CoroPriority.NETWORK == 201
assert CoroPriority.NETWORK_TRANSPORT == 200
assert CoroPriority.CORE == 100
assert CoroPriority.NETWORK == 99
assert CoroPriority.DIAGNOSTICS == 90
assert CoroPriority.STATUS == 80
assert CoroPriority.WEB_SERVER_BASE == 65
@@ -70,9 +70,9 @@ def test_float_and_enum_are_interchangeable() -> None:
("enum_value", "float_value"),
[
(CoroPriority.PLATFORM, 1000.0),
(CoroPriority.NETWORK, 201.0),
(CoroPriority.NETWORK_TRANSPORT, 200.0),
(CoroPriority.CORE, 100.0),
(CoroPriority.NETWORK, 99.0),
(CoroPriority.DIAGNOSTICS, 90.0),
(CoroPriority.STATUS, 80.0),
(CoroPriority.WEB_SERVER_BASE, 65.0),
@@ -169,10 +169,10 @@ def test_mixed_float_and_enum_priorities() -> None:
def test_enum_priority_comparison() -> None:
"""Test that enum priorities can be compared directly."""
assert CoroPriority.PLATFORM > CoroPriority.NETWORK
assert CoroPriority.NETWORK > CoroPriority.NETWORK_TRANSPORT
assert CoroPriority.PLATFORM > CoroPriority.NETWORK_TRANSPORT
assert CoroPriority.NETWORK_TRANSPORT > CoroPriority.CORE
assert CoroPriority.CORE > CoroPriority.DIAGNOSTICS
assert CoroPriority.CORE > CoroPriority.NETWORK
assert CoroPriority.NETWORK > CoroPriority.DIAGNOSTICS
assert CoroPriority.DIAGNOSTICS > CoroPriority.STATUS
assert CoroPriority.STATUS > CoroPriority.WEB_SERVER_BASE
assert CoroPriority.WEB_SERVER_BASE > CoroPriority.CAPTIVE_PORTAL