Commit Graph
24985 Commits
Author SHA1 Message Date
J. Nick Koston 373168ccf0 Merge remote-tracking branches 'origin/ble-fix-event-pool-queue-sizing', 'origin/espnow-fix-event-pool-queue-sizing', 'origin/event-pool-document-sizing-requirement' and 'origin/mqtt-fix-event-queue-data-race' into integration 2026-03-17 12:07:12 -10:00
J. Nick Koston 8acc033873 [core] Document EventPool sizing requirement with LockFreeQueue
Add a comment to EventPool documenting that when paired with a
LockFreeQueue<T, N>, the pool should be sized to N-1 (the queue's
actual capacity) to prevent slot leaks and SPSC violations.
2026-03-17 11:58:47 -10:00
J. Nick Koston da1ee1bf66 [mqtt] Fix outbound EventPool/LockFreeQueue sizing off-by-one
Size the outbound pool to N-1 to match queue capacity, same as the
inbound pool fix in the previous commit.
2026-03-17 11:52:31 -10:00
J. Nick Koston 61513d3deb [espnow] Fix EventPool/LockFreeQueue sizing off-by-one
LockFreeQueue<T,N> is a ring buffer that holds N-1 elements (one slot
is reserved to distinguish full from empty). With the pool also sized
to N, the Nth allocate() succeeds but push() fails — permanently
leaking one pool slot since the element is never returned.

Size both receive and send pools to N-1 to match queue capacity.
2026-03-17 11:46:52 -10:00
J. Nick Koston a078d1b14d [esp32_ble] Fix EventPool/LockFreeQueue sizing off-by-one
LockFreeQueue<T,N> is a ring buffer that holds N-1 elements (one slot
is reserved to distinguish full from empty). With the pool also sized
to N, the Nth allocate() succeeds but push() fails — permanently
leaking one pool slot since the element is never returned.

Size the pool to N-1 to match queue capacity. This guarantees
allocate() returns nullptr before push() can fail.
2026-03-17 11:46:18 -10:00
J. Nick Koston 95ff70eb48 [mqtt] Fix data race on inbound event queue
The ESP-IDF MQTT client dispatches events from its own task, which
pushed to a std::queue while the main loop popped from it. std::queue
is not thread-safe; concurrent access can corrupt its internal state.

Replace with EventPool + LockFreeQueue (SPSC ring buffer) already
used elsewhere in the codebase. The pool is sized to queue capacity
(SIZE-1) so allocate() fails before push() can, which prevents both
a slot leak and an SPSC violation on the pool's free list.

Also rename the outbound pool from mqtt_event_pool_ to
mqtt_outbound_pool_ to avoid confusion with the new inbound pool.
2026-03-17 11:25:14 -10:00
J. Nick Koston c88a01227c Merge remote-tracking branch 'upstream/dev' into integration 2026-03-17 10:21:29 -10:00
J. Nick Koston 9a729608d5 [core] Add back deprecated set_internal() for external projects (#14887) 2026-03-17 19:58:05 +00:00
Jonathan Swoboda 53fa346ddc [speaker] Fix media playlist using announcement delay (#14889) 2026-03-17 19:18:49 +00:00
J. Nick Koston b3210de374 [core] Extract shared C++ build helpers from cpp_unit_test.py (#14883) 2026-03-17 08:53:36 -10:00
J. Nick Koston 82ccc37ba1 [ethernet] Mark EthernetComponent as final (#14842) 2026-03-17 08:14:52 -10:00
J. Nick Koston 3826e95506 [api] Fix ProtoMessage protected destructor compile error on host platform (#14882) 2026-03-17 08:14:36 -10:00
Jonathan Swoboda b083491e74 [microphone] Switch IDF test to new I2S driver (#14886) 2026-03-17 13:46:32 -04:00
Diorcet Yann 73ca0ff106 [core] Small improvements (#14884) 2026-03-17 09:22:31 -04:00
J. Nick Koston 81497d8a45 Merge remote-tracking branch 'origin/integration' into integration 2026-03-16 17:24:39 -10:00
J. Nick Koston 39019ef078 Merge remote-tracking branch 'upstream/fnv1-hash-no-concat' into integration 2026-03-16 17:24:24 -10:00
J. Nick Koston 8525439dc8 [debug] [bme680_bsec] Use fnv1_hash_extend to avoid temporary string allocations
Replace fnv1_hash(str1 + str2) with fnv1_hash_extend(fnv1_hash(str1), str2)
to avoid constructing temporary std::string objects just to compute a hash.
This eliminates the only callers of operator+(const char*, StringRef),
allowing the linker to drop 197 bytes of string concatenation code.
2026-03-16 17:23:10 -10:00
J. Nick Koston 0069b736a4 Merge remote-tracking branch 'origin/ble-server-inline-is-active' into integration 2026-03-16 16:42:29 -10:00
J. Nick KostonandCopilot Autofix powered by AI 9242895f87 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-16 16:42:14 -10:00
J. Nick Koston 8b87440c64 Merge branch 'integration' of https://github.com/esphome/esphome into integration 2026-03-16 16:39:39 -10:00
J. Nick Koston 714628b547 Merge remote-tracking branch 'upstream/ble-server-inline-is-active' into integration 2026-03-16 16:39:15 -10:00
J. Nick Koston 3f74f4216c Merge remote-tracking branch 'upstream/socket-lwip-raw-udp' into integration 2026-03-16 16:39:04 -10:00
J. Nick Koston b333bb76e4 Merge branch 'dev' into socket-lwip-raw-udp 2026-03-16 16:36:46 -10:00
J. Nick Koston 2fe09b1e94 [esp32_ble, esp32_ble_server] Inline is_active/is_running and remove STL bloat from BLE server loop
Move ESP32BLE::is_active() and BLEServer::is_running() to headers
with ESPHOME_ALWAYS_INLINE to eliminate cross-TU call overhead on
every loop iteration. Replace std::remove_if + erase in
BLEServer::loop() with a simple index-based compacting loop,
removing ~250 bytes of unrolled STL template machinery.
2026-03-16 16:36:43 -10:00
J. Nick Koston 273637b6d7 tweak 2026-03-16 16:35:32 -10:00
J. Nick Koston 93b103be0e Merge remote-tracking branch 'origin/ble-server-inline-is-active' into integration 2026-03-16 16:27:59 -10:00
J. Nick Koston 0f4f5aa392 [esp32_ble, esp32_ble_server] Inline is_active/is_running and remove STL bloat from BLE server loop
Move ESP32BLE::is_active() and BLEServer::is_running() to headers
with ESPHOME_ALWAYS_INLINE to eliminate cross-TU call overhead on
every loop iteration. Replace std::remove_if + erase in
BLEServer::loop() with a simple index-based compacting loop,
removing ~250 bytes of unrolled STL template machinery.
2026-03-16 16:27:39 -10:00
J. Nick Koston 3d77e95b11 merge 2026-03-16 15:47:32 -10:00
J. Nick Koston eb34cf0142 Merge remote-tracking branch 'upstream/esp32-sram1-as-iram' into integration 2026-03-16 15:26:12 -10:00
J. Nick Koston bd3287a554 [esp32] Add sram1_as_iram option for +40KB IRAM on original ESP32
Add a new `sram1_as_iram` option under `esp32 > framework > advanced`
that enables CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM, reclaiming
40KB of SRAM1 memory as additional IRAM on the original ESP32.

This requires a bootloader from ESP-IDF v5.1 or later. USB flashing
updates the bootloader automatically, but OTA does not. At boot,
ESPHome now detects the bootloader version and suggests enabling
this option when the bootloader is compatible.
2026-03-16 15:24:12 -10:00
J. Nick Koston 03db9d7ada Merge remote-tracking branch 'upstream/esp32-sram1-as-iram' into integration 2026-03-16 15:16:58 -10:00
J. Nick Koston 6423f9832f [esp32] Add sram1_as_iram option for +40KB IRAM on original ESP32
Add a new `sram1_as_iram` option under `esp32 > framework > advanced`
that enables CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM, reclaiming
40KB of SRAM1 memory as additional IRAM on the original ESP32.

This requires a bootloader from ESP-IDF v5.1 or later. USB flashing
updates the bootloader automatically, but OTA does not. At boot,
ESPHome now detects the bootloader version and suggests enabling
this option when the bootloader is compatible.
2026-03-16 15:15:42 -10:00
Jesse Hills bba11b3b1e Merge branch 'beta' into dev 2026-03-17 14:14:03 +13:00
Jesse Hills a40d97f346 Merge pull request #14873 from esphome/bump-2026.3.0b3
2026.3.0b3
2026.3.0b3
2026-03-17 14:13:29 +13:00
J. Nick Koston 0a67cf4496 Merge remote-tracking branch 'upstream/esp32-sram1-as-iram' into integration 2026-03-16 15:12:57 -10:00
J. Nick Koston d7dc641fcb [esp32] Add sram1_as_iram option for +40KB IRAM on original ESP32
Add a new `sram1_as_iram` option under `esp32 > framework > advanced`
that enables CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM, reclaiming
40KB of SRAM1 memory as additional IRAM on the original ESP32.

This requires a bootloader from ESP-IDF v5.1 or later. USB flashing
updates the bootloader automatically, but OTA does not. At boot,
ESPHome now detects the bootloader version and suggests enabling
this option when the bootloader is compatible.
2026-03-16 15:12:32 -10:00
J. Nick Koston fe759e613e Merge remote-tracking branch 'upstream/esp32-sram1-as-iram' into integration 2026-03-16 14:56:49 -10:00
J. Nick Koston 9c81c0ab53 [esp32] Add sram1_as_iram option for +40KB IRAM on original ESP32
Add a new `sram1_as_iram` option under `esp32 > framework > advanced`
that enables CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM, reclaiming
40KB of SRAM1 memory as additional IRAM on the original ESP32.

This requires a bootloader from ESP-IDF v5.1 or later. USB flashing
updates the bootloader automatically, but OTA does not. At boot,
ESPHome now detects the bootloader version and suggests enabling
this option when the bootloader is compatible.
2026-03-16 14:54:20 -10:00
J. Nick Koston 8e8faaa983 Merge remote-tracking branch 'upstream-ssh/api-overflow-buffer-cleanup' into integration 2026-03-16 13:11:13 -10:00
J. Nick Koston 1ecbd28742 Address review: restore queue-full log, fix power-of-2 comment
- Add HELPER_LOG when overflow buffer is full and connection is dropped
- Clarify comment: defaults are power of 2 (not a requirement for users)
2026-03-16 13:09:41 -10:00
J. Nick Koston 61cc3022cb Address review: save errno before use, fix docs, add missing include
- Save errno into local before check_socket_write_err_ and HELPER_LOG
  to avoid potential clobbering between reads
- Update try_drain() doc: 0 means all-drained or no-progress (callers
  only act on -1)
- Include socket/headers.h explicitly for struct iovec
2026-03-16 13:08:08 -10:00
J. Nick Koston 69956c54a7 fix power of 2 2026-03-16 13:04:29 -10:00
J. Nick Koston 3ac6eb0f5a Address review: only log hard errors, fix try_drain doc comments
- Move HELPER_LOG after errno check so transient WOULD_BLOCK doesn't
  spam very-verbose logs during normal backpressure
- Fix try_drain() docstring: -1 can be EWOULDBLOCK or hard error
  (caller distinguishes via errno), 0 means no progress (not would-block)
2026-03-16 13:01:42 -10:00
J. Nick Koston 1450d1e487 Merge branch 'dev' into api-overflow-buffer-cleanup 2026-03-16 12:51:38 -10:00
Jesse Hills d6c67d5c35 Bump version to 2026.3.0b3 2026-03-17 11:45:03 +13:00
Jonathan Swoboda 0816b27398 [core] Support both dot and dash separators in Version.parse (#14858) 2026-03-17 11:45:03 +13:00
Jonathan Swoboda 9133582aa0 [as3935] Fix ENERGY_MASK dropping bit 4 of lightning energy MMSB (#14861) 2026-03-17 11:45:02 +13:00
Jonathan Swoboda f36b0fcb61 [am43] Fix battery update throttle using wrong type (#14864) 2026-03-17 11:45:02 +13:00
Jonathan Swoboda bb0a5dc8a8 [lilygo_t5_47] Fix Y coordinate mapping and clamp touch point count (#14865) 2026-03-17 11:45:02 +13:00
Jonathan Swoboda 0c260e483e [gpio][dallas_temp] Fix one_wire read64() and DS18S20 division by zero (#14866) 2026-03-17 11:45:02 +13:00