Commit Graph

13114 Commits

Author SHA1 Message Date
J. Nick Koston
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 Koston
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 Koston
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
J. Nick Koston
5d44a556a4 [socket] Increase MIN_UDP_SOCKETS from 6 to 8
Now that DHCP+DNS are tracked as wifi.lwip_internal UDP consumers,
the old minimum of 6 only left 4 free PCBs. Bumping to 8 restores
the same effective headroom as before (6 free after DHCP+DNS).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:15:52 -06:00
J. Nick Koston
f55387b323 [wifi] Guard lwIP-internal socket registration to LibreTiny only
DHCP/DNS raw UDP PCBs only need tracking on LibreTiny where we directly
set MEMP_NUM_UDP_PCB. On ESP32, CONFIG_LWIP_MAX_SOCKETS controls the
POSIX socket layer — DHCP/DNS use raw udp_new() bypassing it entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:11:19 -06:00
J. Nick Koston
38984b61c9 [wifi] Track lwIP-internal DHCP+DNS UDP PCBs via socket consumer API
Register the 2 UDP PCBs that lwIP allocates internally for DHCP and DNS
as a wifi.lwip_internal socket consumer, eliminating the magic +2 in
libretiny's MEMP_NUM_UDP_PCB calculation. Also corrects SDK default
values in the comparison table after line-by-line verification against
all three SDK source files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:33:50 -06:00
J. Nick Koston
4114620aee [libretiny] Fix RTL87xx BD_RAM overflow — use per-SDK lwIP defaults
The original table treated BK/RTL/LN SDK defaults as identical, but
they differ significantly:

- BK72XX: MEM_SIZE=32KB, TCP_SND_BUF=10×MSS — wildly oversized
- RTL87XX: MEM_SIZE=5KB, TCP_SND_BUF=5×MSS — already conservative
- LN882H: MEM_LIBC_MALLOC=1, TCP_SND_BUF=7×MSS — uses system heap

Setting MEM_SIZE=16KB on RTL87XX was an 11KB *increase* from its 5KB
SDK default, causing BD_RAM overflow on the mqtt test.

Fix: only set MEM_SIZE on BK72XX (where the 32KB→12KB reduction is
needed). RTL87XX keeps its SDK 5KB default, LN882H doesn't use it.
The comparison table is updated with accurate per-SDK columns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:23:42 -06:00
J. Nick Koston
482721d1ce [libretiny] Tune oversized lwIP defaults for ESPHome
The Beken/RTL SDKs ship lwIP defaults tuned for a general-purpose WiFi
SoC: TCP_SND_BUF=10*MSS (14.6KB), MEM_SIZE=32KB, 12 TCP + 22 UDP
sockets. These waste significant RAM on memory-constrained chips.
ESPAsyncWebServer allocates malloc(tcp_sndbuf()) per response chunk,
and at 14.6KB this causes OOM on BK7231N.

This tunes lwIP to match ESP32/ESP8266 ranges:
- TCP_SND_BUF/TCP_WND: 4*MSS (was 10*MSS)
- MEM_SIZE: 12KB BK72XX / 16KB RTL,LN (was 32KB)
- Socket counts: dynamic from component registrations
- All derived pool sizes adjusted accordingly

Also splits socket consumer tracking into TCP/UDP, adds
get_socket_counts() API, and updates ESP32 to use it.

Closes https://github.com/esphome/esphome/issues/14095
2026-02-21 11:50:29 -06:00
Sxt Fov
6ecb01dedc [cc1101] actions to change general and tuner settings (#14141)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-21 08:45:15 -05:00
Clyde Stubbs
518f08b909 [mipi_dsi] Disallow swap_xy (#14124) 2026-02-21 19:51:13 +11:00
Rodrigo Martín
2eac106f11 [mqtt] add missing precision in HA autodiscovery (#14010) 2026-02-20 23:20:27 -05:00
J. Nick Koston
f77da803c9 [api] Write protobuf encode output to pre-sized buffer directly (#14018) 2026-02-20 21:39:18 -06:00
J. Nick Koston
f8f98bf428 [logger] Reduce UART driver heap waste on ESP32 (#14168) 2026-02-21 03:16:49 +00:00
J. Nick Koston
abe37c9841 [uptime] Use scheduler millis_64() for rollover-safe uptime tracking (#14170) 2026-02-21 03:08:49 +00:00
J. Nick Koston
8589f80d8f [api,ota,captive_portal] Fix fd leaks and clean up socket_ip_loop_monitored setup paths (#14167) 2026-02-20 20:59:49 -06:00
J. Nick Koston
0e38acd67a [api] Warn when clients connect with outdated API version (#14145) 2026-02-20 19:21:56 -06:00
J. Nick Koston
a3f279c1cf [usb_host] Implement disable_loop/enable_loop pattern for USB components (#14163) 2026-02-20 19:21:14 -06:00
J. Nick Koston
35037d1a5b [core] Deduplicate base64 encode/decode logic (#14143)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 19:20:58 -06:00
J. Nick Koston
d206c75b0b [logger] Fix loop disable optimization using wrong preprocessor guard (#14158) 2026-02-20 19:20:44 -06:00
tomaszduda23
1d3054ef5e [nrf52,logger] Early debug (#11685) 2026-02-20 16:12:50 -06:00
Jonathan Swoboda
db6aa58f40 [max7219digit] Fix typo in action names (#14162)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:06:46 -05:00
Pawelo
48115eca18 [safe_mode] Extract RTC_KEY constant for shared use (#14121)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
2026-02-20 14:08:31 -06:00
dependabot[bot]
edfc3e3501 Bump ruff from 0.15.1 to 0.15.2 (#14159)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-02-20 19:32:41 +00:00
dependabot[bot]
1a37632891 Bump pylint from 4.0.4 to 4.0.5 (#14160)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-20 19:27:45 +00:00
dependabot[bot]
b85a49cdb3 Bump github/codeql-action from 4.32.3 to 4.32.4 (#14161)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-20 13:27:15 -06:00
Jonathan Swoboda
9c0eed8a67 [e131] Remove dead LWIP TCP code path from loop() (#14155)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-02-20 17:03:39 +00:00
Jonathan Swoboda
887375ebef Merge branch 'release' into dev 2026-02-20 11:24:25 -05:00
Jonathan Swoboda
49356f4132 Merge pull request #14151 from esphome/bump-2026.2.1
2026.2.1
2026.2.1
2026-02-20 11:24:11 -05:00
Jonathan Swoboda
403235e2d4 [wifi] Add band_mode configuration for ESP32-C5 dual-band WiFi (#14148)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:20:29 -05:00
Jonathan Swoboda
9ce01fc369 [esp32] Add engineering_sample option for ESP32-P4 (#14139)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:20:05 -05:00
J. Nick Koston
b0a35559b3 [esp32] Bump ESP-IDF to 5.5.3.1, revert GATTS workaround (#14147) 2026-02-20 10:19:01 -06:00
Jonathan Swoboda
8aaf0b8d85 Bump version to 2026.2.1 2026-02-20 10:17:12 -05:00
Jonathan Swoboda
28d510191c [ld2410/ld2450] Replace header sync with buffer size increase for frame resync (#14138)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:17:12 -05:00
Jonathan Swoboda
4c8e0575f9 [ld2420] Increase MAX_LINE_LENGTH to allow footer-based resync (#14137)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:17:12 -05:00
Jonathan Swoboda
49afe53a2c [ld2410] Add frame header synchronization to readline_() (#14136)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:17:12 -05:00
Jonathan Swoboda
d19c1b689a [ld2450] Add frame header synchronization to fix initialization regression (#14135)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-02-20 10:17:12 -05:00
Jonathan Swoboda
e7e1acc0a2 [pulse_counter] Fix PCNT glitch filter calculation off by 1000x (#14132)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:17:12 -05:00
J. Nick Koston
7bdeb32a8a [uart] Always call pin setup for UART0 default pins on ESP-IDF (#14130) 2026-02-20 10:17:12 -05:00
Jonathan Swoboda
f412ab4f8b [wifi] Sync output_power with PHY max TX power to prevent brownout (#14118)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:17:12 -05:00
Jonathan Swoboda
0fc09462ff [safe_mode] Log brownout as reset reason on OTA rollback (#14113)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:17:12 -05:00
J. Nick Koston
d78496321e [esp32_ble] Enable CONFIG_BT_RELEASE_IRAM on ESP32-C2 (#14109)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:17:12 -05:00
Jonathan Swoboda
ac76fc4409 [pulse_counter] Fix build failure when use_pcnt is false (#14111)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:17:12 -05:00
Jonathan Swoboda
a343ff1989 [ethernet] Improve clk_mode deprecation warning with actionable YAML (#14104)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:17:12 -05:00
Jonathan Swoboda
2d2178c90a [socket] Fix IPv6 compilation error on host platform (#14101)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:17:11 -05:00
J. Nick Koston
25b14f9953 [e131] Fix E1.31 on ESP8266 and RP2040 by restoring WiFiUDP support (#14086) 2026-02-20 10:17:11 -05:00
J. Nick Koston
2491b4f85c [ld2420] Use constexpr for compile-time constants (#14079) 2026-02-20 10:17:11 -05:00
J. Nick Koston
cb8b14e64b [web_server] Fix water_heater JSON key names and move traits to DETAIL_ALL (#14064) 2026-02-20 10:17:11 -05:00
J. Nick Koston
887172d663 [pulse_counter] Fix compilation on ESP32-C6/C5/H2/P4 (#14070) 2026-02-20 10:17:11 -05:00
J. Nick Koston
e4aa23abaa [web_server] Double socket allocation to prevent connection exhaustion (#14067) 2026-02-20 10:17:11 -05:00
J. Nick Koston
8c0cc3a2d8 [udp] Register socket consumption for CONFIG_LWIP_MAX_SOCKETS (#14068) 2026-02-20 10:17:11 -05:00