Commit Graph
22984 Commits
Author SHA1 Message Date
J. Nick Koston 655968af66 Merge remote-tracking branch 'origin/api-stringref-user-services' into integration 2026-02-21 22:10:03 -06:00
J. Nick Koston c636984e3a deferred 2026-02-21 21:53:57 -06:00
J. Nick Koston e1e20422a6 deferred 2026-02-21 21:47:03 -06:00
J. Nick Koston 1183aae319 deferred 2026-02-21 21:38:03 -06:00
J. Nick Koston b6e8e92416 deferred 2026-02-21 21:34:07 -06:00
J. Nick Koston 1003247a41 deferred 2026-02-21 21:32:59 -06:00
J. Nick Koston 83ccdc36cd deferred 2026-02-21 21:26:31 -06:00
J. Nick Koston d21d897766 deferred 2026-02-21 21:12:31 -06:00
J. Nick Koston 38058d0308 deferred 2026-02-21 21:07:21 -06:00
J. Nick Koston 8bf757d989 deferred 2026-02-21 20:59:09 -06:00
J. Nick Koston 23a57b9224 revert format change 2026-02-21 20:53:08 -06:00
J. Nick Koston fa343aa1ba tweaks 2026-02-21 20:49:49 -06:00
J. Nick Koston b85878e1ee tweaks 2026-02-21 20:42:12 -06:00
J. Nick Koston a4d19cdf57 tweaks 2026-02-21 20:39:23 -06:00
J. Nick Koston ec1dbd39ae tests 2026-02-21 20:37:28 -06:00
J. Nick Koston 15a125ca00 overkill 2026-02-21 20:28:07 -06:00
J. Nick Koston 5e7a61ab20 Merge remote-tracking branch 'upstream/dev' into api-stringref-user-services 2026-02-21 20:21:58 -06:00
J. Nick Koston ab7e02d6bf tweak 2026-02-21 20:21:34 -06:00
J. Nick Koston d5c9c56fdf [platformio] Add exponential backoff and session reset to download retries (#14191) 2026-02-21 19:41:43 -06:00
J. Nick Koston a468261523 [scheduler] De-template and consolidate scheduler helper functions (#14164) 2026-02-21 19:41:26 -06:00
J. Nick Koston 57d5151c31 fix shadow 2026-02-21 19:24:48 -06:00
J. Nick Koston 367775dfd9 only during data 2026-02-21 19:24:05 -06:00
J. Nick Koston 66a2a0d62e only during data 2026-02-21 19:20:24 -06:00
J. Nick Koston 46c123ec61 Merge branch 'dev' into api-stringref-user-services 2026-02-21 19:01:36 -06:00
J. Nick Koston 3306fb2d21 Merge remote-tracking branch 'upstream/libretiny-lwip-tune' into integration 2026-02-21 17:50:04 -06:00
J. Nick KostonandClaude Opus 4.6 ca82c7c7c6 [socket] Show (min) indicator when platform minimums are applied
Helps users understand why socket counts may be higher than what
their components registered.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:49:45 -06:00
J. Nick Koston 096694cd6b Merge remote-tracking branch 'upstream/libretiny-lwip-tune' into integration 2026-02-21 17:48:51 -06:00
J. Nick KostonandClaude Opus 4.6 fadf7a2ba3 [socket] Lower minimum socket counts (TCP=8, UDP=6)
Previous minimums (10/8) were overly conservative. Most configs
register their actual needs via consume_sockets(), so the minimums
only need to cover unregistered components with modest headroom.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:48:35 -06:00
J. Nick Koston 2ece30ed76 Merge remote-tracking branch 'upstream/libretiny-lwip-tune' into integration 2026-02-21 17:47:20 -06:00
J. Nick KostonandClaude Opus 4.6 e3154e48bd [libretiny] Log socket component details during lwIP configuration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:47:06 -06:00
J. Nick Koston 2727f9c74f Merge remote-tracking branch 'upstream/libretiny-lwip-tune' into integration 2026-02-21 17:45:31 -06:00
J. Nick KostonandClaude Opus 4.6 341b22c7e4 [socket] Include component details in platform lwIP log messages
get_socket_counts() now returns component detail strings alongside
counts so platforms can include them in their log messages. ESP32
INFO log now shows which components consume each socket type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:45:13 -06:00
J. Nick Koston 1518875cd2 Merge remote-tracking branch 'origin/libretiny-lwip-tune' into integration 2026-02-21 17:41:18 -06:00
J. Nick KostonandClaude Opus 4.6 0c184ce791 [esp32] Include TCP_LISTEN in CONFIG_LWIP_MAX_SOCKETS count
CONFIG_LWIP_MAX_SOCKETS is a single VFS socket pool shared by all
socket types. Listening sockets consume file descriptors too, so
they must be included in the total.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:40:47 -06:00
J. Nick Koston f87a0b24a9 Merge remote-tracking branch 'origin/libretiny-lwip-tune' into integration 2026-02-21 17:34:47 -06:00
J. Nick Koston e74506b957 Merge branch 'scheduler_de_template' into integration 2026-02-21 17:34:37 -06:00
J. Nick Koston 9b1480840f Merge remote-tracking branch 'upstream/dev' into scheduler_de_template
# Conflicts:
#	esphome/core/scheduler.h
2026-02-21 17:31:57 -06:00
J. Nick Koston 462ac29563 [scheduler] Use relaxed memory ordering for atomic reads under lock (#14140) 2026-02-21 17:29:41 -06:00
J. Nick KostonandClaude Opus 4.6 8aa77c306f [socket] Fix docstring and comment accuracy
- Update MIN_TCP_SOCKETS comment: api(3) + web_server(5) = 8 typical
- Add TCP_LISTEN to consume_sockets docstring

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:19:20 -06:00
J. Nick KostonandCopilot 7a1448ed19 Update esphome/components/socket/__init__.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-21 17:18:21 -06:00
J. Nick KostonandClaude Opus 4.6 bfde66f7f4 [socket] Update comments for new TCP_LISTEN registration model
- OTA: note that active transfer uses a TCP PCB from general pool
- MIN_TCP_SOCKETS: update base count to api(3) after TCP_LISTEN split

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:10:29 -06:00
J. Nick KostonandClaude Opus 4.6 c90ab6f72f [socket] Remove legacy aliases, fix NETCONN count, add comments
- Remove SOCKET_TCP/SOCKET_UDP aliases, use SocketType.UDP everywhere
- Fix MEMP_NUM_NETCONN to include listening_tcp (listeners need netconns)
- Add comment on listening_tcp minimum (not all components register yet)
- Add comment on MAX_LISTENING_SOCKETS_TCP (BK-specific, RTL/LN use
  MEMP_NUM_TCP_PCB_LISTEN directly)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:07:46 -06:00
J. Nick KostonandClaude Opus 4.6 d630166280 [socket] Track TCP listening sockets separately via SocketType.TCP_LISTEN
Components now register their listening sockets explicitly instead of
relying on a hardcoded count. web_server_base registers the shared
HTTP listener (used by both web_server and captive_portal). The
libretiny lwIP config derives MEMP_NUM_TCP_PCB_LISTEN dynamically
from these registrations.

Also fixes captive_portal to correctly register its DNS socket as UDP
instead of TCP.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:00:40 -06:00
J. Nick KostonandClaude Opus 4.6 5b5bc28ba3 [libretiny] Enable MEM_LIBC_MALLOC + MEMP_MEM_MALLOC on all platforms
Move MEM_LIBC_MALLOC=1 and MEMP_MEM_MALLOC=1 from BK72XX-only to all
LibreTiny platforms. All three SDKs (BK/RTL/LN) wire malloc to
FreeRTOS pvPortMalloc (thread-safe), and WiFi receive paths run in
task context.

Tested on RTL87xx (BW15): 84,184 B → 103,744 B free heap (~19.6KB
freed). OTA and web server confirmed working.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:37:56 -06:00
J. Nick KostonandClaude Opus 4.6 30d694e62e [libretiny] Enable MEMP_MEM_MALLOC=1 on BK72XX for dynamic MEMP pools
Allocate all MEMP pools (TCP PCBs, UDP PCBs, netconns, TCP segments,
pbufs, etc.) from the heap on demand instead of pre-allocated static
arrays. Saves ~20KB RAM on BK7231N (87,312 B free vs 67,144 B before).

Safe because the BK WiFi driver's receive path runs in task context
(core_thread pops from g_wifi_core.io_queue), not ISR context.
ESP32 and ESP8266 both ship with MEMP_MEM_MALLOC=1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:19:18 -06:00
J. Nick KostonandClaude Opus 4.6 770e3092a5 [libretiny] Fix MEMP_NUM_NETCONN double-counting listening sockets
Listening sockets are already included in the TCP socket count from
component registrations (e.g. api registers 1 listening + 3 clients).
Remove the extra listening_tcp from MEMP_NUM_NETCONN to avoid
over-provisioning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:54:42 -06:00
J. Nick KostonandClaude Opus 4.6 e463dc331e [libretiny] Use system heap for BK72XX lwIP (MEM_LIBC_MALLOC=1)
Replace the dedicated lwIP heap (MEM_SIZE=16/32KB) with system malloc
on BK72XX, matching what LN882H and ESP8266 already do. The BK SDK's
malloc wraps FreeRTOS pvPortMalloc which is thread-safe.

This eliminates the dedicated pool bottleneck that caused OTA slowness
when MEM_SIZE was reduced to 5KB, and frees ~5.9KB heap on BK7231N
(61,264 B → 67,144 B).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:37:03 -06:00
J. Nick KostonandClaude Opus 4.6 6adbb34fbb [libretiny] Show BK72XX reduced/default plan values for MEM_SIZE
BK SDK has two plans: reduced (16KB) and default (32KB). Show both
in the docstring table for accuracy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:05:18 -06:00
J. Nick KostonandClaude Opus 4.6 18c89a1cce [libretiny] Set BK72XX PBUF_POOL_SIZE to 10 to match default plan
PBUF_POOL_SIZE=4 was the minimum to pass lwIP's sanity check but caused
pbuf exhaustion during concurrent connections (API + web_server + OTA),
resulting in dropped log messages.

Set to 10 to match the BK SDK default plan and ESP8266. RTL/LN already
default to 20 and need no override.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:58:11 -06:00
J. Nick KostonandClaude Opus 4.6 2b00a809c8 [libretiny] Fix BK72XX lwIP sanity check for reduced-plan boards
BK SDK boards with CFG_LWIP_MEM_POLICY=LWIP_REDUCE_THE_PLAN (e.g. CB3S/
BK7231N) set PBUF_POOL_SIZE=3, which is too small for TCP_WND=4*MSS:
3*(1580-54)=4578 < 5840. Set PBUF_POOL_SIZE=4 on BK72XX so the lwIP
compile-time sanity check passes: 4*1526=6104 > 5840.

RTL(20) and LN(20) already have large enough PBUF pools.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:42:30 -06:00