Commit Graph
24629 Commits
Author SHA1 Message Date
J. Nick Koston 98379b70e9 Merge branch 'cache-errno-local' into integration 2026-03-12 15:58:32 -10:00
J. Nick KostonandClaude Opus 4.6 4e5d1cae8d Cache errno into local variable to eliminate duplicate __errno() calls
On embedded targets (ESP32, RP2040, ESP8266), errno expands to
(*__errno()) - a function call returning a pointer to thread-local
storage. The compiler cannot optimize away repeated accesses since
errno is treated as volatile. Cache it once into a const int local
to avoid redundant calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 15:57:16 -10:00
J. Nick Koston 3342cd04ea Merge remote-tracking branch 'upstream/dev' into integration
# Conflicts:
#	esphome/components/mdns/mdns_rp2040.cpp
2026-03-12 15:45:08 -10:00
J. Nick Koston 920af91db6 [rp2040] Fix compiler warnings in crash_handler and mdns (#14739) 2026-03-13 01:37:46 +00:00
J. Nick KostonandCopilot a744261934 [mdns] Fix RP2040 mDNS not restarting after WiFi reconnect (#14737)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-13 01:12:22 +00:00
J. Nick Koston 59c1368440 [i2c] Fix RP2040 I2C bus selection based on pin assignment (#14745) 2026-03-12 14:53:46 -10:00
J. Nick Koston 7e8e085a04 [light] Fix binary light spamming 'brightness not supported' warning with strobe effect (#14735) 2026-03-12 14:49:07 -10:00
J. Nick Koston 22b25724ae [wifi] Reject EAP/WPA2 Enterprise config on unsupported platforms (#14746) 2026-03-12 14:48:55 -10:00
J. Nick Koston 89719cf4b2 [water_heater] Set OPERATION_MODE feature flag when modes are configured (#14748) 2026-03-12 14:48:41 -10:00
J. Nick KostonandCopilot e15b19b223 [captive_portal] Fix captive portal inaccessible when web_server auth is configured (#14734)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-12 14:48:29 -10:00
J. Nick Koston 2ca13972b9 [debug] Fix missing reset reason for RP2040/RP2350 (#14740) 2026-03-12 14:48:06 -10:00
J. Nick KostonandClaude Opus 4.6 7bb4e75459 [rp2040] Use full flash for sketch in testing mode (#14747)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:47:16 -10:00
J. Nick Koston 47a3f29962 Merge branch 'fix-water-heater-operation-mode-flag' into integration 2026-03-12 14:44:30 -10:00
J. Nick Koston 77068ea410 [water_heater] Add integration test assertion for OPERATION_MODE feature flag 2026-03-12 14:12:47 -10:00
J. Nick Koston cd6c65c670 [water_heater] Set OPERATION_MODE feature flag when modes are configured
The template water_heater component was setting the supported modes
list but not setting the WATER_HEATER_SUPPORTS_OPERATION_MODE feature
flag, causing Home Assistant to not know that mode selection is
supported.

Fixes https://github.com/esphome/esphome/issues/14605
2026-03-12 14:10:57 -10:00
J. Nick Koston a4d278874b Merge branch 'fix-rp2040-crash-handler-section-attr' into integration 2026-03-12 13:42:04 -10:00
J. Nick Koston b62f7037df replace copilots broken suggestion with something that actually works 2026-03-12 13:41:53 -10:00
J. Nick Koston f4eddbea29 Merge remote-tracking branch 'origin/dev' into integration 2026-03-12 13:39:05 -10:00
J. Nick Koston acdc24971c Merge remote-tracking branch 'origin/fix-rp2040-testing-mode-flash' into integration 2026-03-12 13:38:56 -10:00
J. Nick Koston 5203305060 Merge remote-tracking branch 'origin/fix-rp2040-crash-handler-section-attr' into integration 2026-03-12 13:38:48 -10:00
J. Nick Koston 1b78f55bdf Merge branch 'fix-rp2040-i2c-bus-selection' into integration 2026-03-12 13:38:29 -10:00
J. Nick Koston 975854bd9f Merge remote-tracking branch 'upstream/fix-wifi-eap-rp2040-validation' into integration 2026-03-12 13:38:21 -10:00
J. Nick KostonandClaude Opus 4.6 ce2e0381c1 [rp2040] Use full flash for sketch in testing mode
In testing mode, set filesystem_size to 0m so the full 2MB flash is
available for the sketch partition. This prevents linker overflow when
CI groups many components into a single build, matching the approach
used by ESP8266's testing mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:34:20 -10:00
J. Nick KostonandCopilot fb88550a8d Update esphome/components/mdns/mdns_rp2040.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-12 13:31:53 -10:00
J. Nick Koston fd8e510745 [light] Fix ambiguous set_effect overload for const char* (#14732) 2026-03-12 18:28:25 -05:00
J. Nick Koston d7310fff32 [wifi] Reject EAP/WPA2 Enterprise config on unsupported platforms
WPA2 Enterprise (EAP) is only implemented for ESP32 and ESP8266 but the
config schema accepted it on all platforms. On RP2040 this caused a
bootloop with no useful error message. Now rejects EAP config at
validation time on unsupported platforms.

Closes https://github.com/esphome/esphome/issues/14743
2026-03-12 13:26:44 -10:00
J. Nick Koston 32e8efb7b7 Use formula-based description instead of incomplete GPIO pin lists
Addresses review feedback: the hard-coded pin lists only covered RP2040
GPIOs and were incomplete for RP2350 (GPIO up to 47). Now describes the
(gpio / 2) % 2 rule instead.
2026-03-12 13:24:27 -10:00
Brian Kaufman 25c74c8f99 [OTA] Stage exact uploaded size for ESP8266 web OTA (gzip fix) (#14741) 2026-03-12 13:23:29 -10:00
J. Nick Koston 75a546bd96 Add datasheet references for RP2040/RP2350 I2C pin mapping 2026-03-12 13:21:03 -10:00
J. Nick Koston 0400c2d3a3 [i2c] Fix RP2040 I2C bus selection based on pin assignment instead of definition order
The RP2040 I2C bus was previously assigned Wire/Wire1 based on the order
I2C buses were defined in YAML, not based on which GPIO pins were used.
This caused I2C1 to not work when only a single bus was configured with
I2C1 pins (e.g., GPIO6/GPIO7).

Now selects the correct Wire instance using the RP2040/RP2350 GPIO pin
mapping formula: (pin / 2) % 2. Also adds config validation to catch
SDA/SCL pin mismatches and duplicate controller assignments.

Closes https://github.com/esphome/esphome/issues/14742
2026-03-12 13:19:20 -10:00
J. Nick Koston 6e3b2743fa Merge branch 'fix-rp2040-debug-reset-reason' into integration 2026-03-12 12:43:46 -10:00
J. Nick Koston 2cb758899c Document str param as non-null in buf_append_str 2026-03-12 12:43:25 -10:00
J. Nick Koston 5faa34886d Avoid dangling else across preprocessor boundary 2026-03-12 12:42:39 -10:00
J. Nick Koston 7f8e12a679 Merge fix-rp2040-debug-reset-reason into integration 2026-03-12 12:27:07 -10:00
J. Nick Koston 1017ce87d6 [debug] Implement reset reason for RP2040/RP2350
The debug component's reset reason text sensor was returning an empty
string on RP2040/RP2350 platforms. Read the chip reset registers to
report the actual reset source.

RP2040: reads VREG_AND_CHIP_RESET for POR and RUN pin.
RP2350: reads POWMAN chip_reset for POR, brown-out, RUN pin, and
power supply glitch.
Both: checks watchdog_caused_reboot() from the Pico SDK, and
distinguishes between crash (HardFault), watchdog timeout, and
software reset by consulting the crash handler data.

Also adds buf_append_str() helper to helpers.h for efficient plain
string appends without format parsing overhead.
2026-03-12 12:26:37 -10:00
J. Nick Koston 9826af8af1 Merge remote-tracking branch 'origin/fix-rp2040-crash-handler-section-attr' into integration 2026-03-12 12:19:57 -10:00
J. Nick Koston 06cb1839f2 [rp2040] Fix compiler warnings in crash_handler and mdns
Fix two GCC warnings on RP2040 builds:

1. crash_handler.cpp: Move __attribute__((section(".noinit"))) from
   the struct type to the variable declaration where it belongs.

2. mdns_rp2040.cpp: Suppress IRAM_ATTR macro redefinition warning
   caused by Arduino-Pico's PolledTimeout.h redefining it to empty.
2026-03-12 12:19:38 -10:00
J. Nick Koston 1e3925c5a3 Merge remote-tracking branch 'origin/fix-rp2040-crash-handler-section-attr' into integration 2026-03-12 12:17:20 -10:00
J. Nick Koston 5da6fff7be Merge remote-tracking branch 'upstream/fix-rp2040-debug-reset-reason' into integration 2026-03-12 12:17:08 -10:00
J. Nick Koston 662f14e10b [debug] Implement reset reason for RP2040/RP2350
The debug component's reset reason text sensor was returning an empty
string on RP2040/RP2350 platforms. Read the chip reset registers to
report the actual reset source.

RP2040: reads VREG_AND_CHIP_RESET for POR, RUN pin, and debug port.
RP2350: reads POWMAN chip_reset for POR, brown-out, RUN pin, watchdog
variants, glitch detect, debugger, rescue, and core powerdown.
Both: checks watchdog_caused_reboot() from the Pico SDK.

Also adds buf_append_str() helper to helpers.h for efficient plain
string appends without format parsing overhead.
2026-03-12 12:16:16 -10:00
J. Nick Koston 35d060154c [rp2040] Fix -Wattributes warning in crash_handler
Move __attribute__((section(".noinit"))) from the struct type to the
variable declaration where it belongs. GCC warns because the section
attribute applies to variables, not types.
2026-03-12 12:13:58 -10:00
J. Nick Koston 3fb393456c Merge remote-tracking branch 'origin/fix-rp2040-mdns-reconnect' into integration 2026-03-12 12:06:21 -10:00
J. Nick Koston c7560f6878 [mdns] Fix RP2040 mDNS not restarting after WiFi reconnect
The RP2040's LEAmDNS library relies on LwipIntf::stateUpCB() to
restart mDNS when the network interface reconnects. However, this
callback is stubbed out in arduino-pico because the original ESP8266
implementation used schedule_function() which doesn't exist in
arduino-pico, and the callback can't safely run directly since netif
status callbacks fire from IRQ context while _restart() allocates
UDP sockets.

The previous workaround blocked all component setup via can_proceed()
until WiFi connected, which only helped on initial boot but did not
handle reconnects.

Replace with a proper fix: detect WiFi reconnection from the existing
50ms mDNS update interval (main loop context) and call
MDNS.notifyAPChange() to restart mDNS probing and announcing.
2026-03-12 12:05:32 -10:00
J. Nick Koston c1a4320c62 Merge remote-tracking branch 'origin/fix-rp2040-mdns-reconnect' into integration 2026-03-12 11:58:57 -10:00
J. Nick Koston f869bbcfa6 Merge remote-tracking branch 'origin/captive-portal-auth-bypass' into integration 2026-03-12 11:58:52 -10:00
J. Nick Koston b0dd029e9b Merge remote-tracking branch 'origin/fix-light-set-effect-ambiguous-overload' into integration 2026-03-12 11:58:45 -10:00
J. Nick Koston 4d7ab65ab6 Merge branch 'refactor/sliding-window-static-ring-buffer' into integration 2026-03-12 11:58:34 -10:00
J. Nick Koston f6d3ce7eb3 [mdns] Fix RP2040 mDNS not restarting after WiFi reconnect
The RP2040's LEAmDNS library relies on LwipIntf::stateUpCB() to
restart mDNS when the network interface reconnects. However, this
callback is stubbed out in arduino-pico because the original ESP8266
implementation used schedule_function() which doesn't exist in
arduino-pico, and the callback can't safely run directly since netif
status callbacks fire from IRQ context while _restart() allocates
UDP sockets.

The previous workaround blocked all component setup via can_proceed()
until WiFi connected, which only helped on initial boot but did not
handle reconnects.

Replace with a proper fix: detect WiFi reconnection from the existing
50ms mDNS update interval (main loop context) and call
MDNS.notifyAPChange() to restart mDNS probing and announcing.
2026-03-12 11:55:03 -10:00
J. Nick Koston 7ce12c31f3 add clear for https://github.com/esphome/esphome/pull/14733 2026-03-12 11:19:34 -10:00
J. Nick Koston bdf7608990 [sensor] Add FixedRingBuffer and use it in SlidingWindowFilter
Add FixedRingBuffer<T, MAX_CAPACITY> to helpers.h as the runtime-sized
equivalent of StaticRingBuffer. Uses std::conditional_t to auto-select
uint8_t/uint16_t/uint32_t index types based on MAX_CAPACITY.

Convert SlidingWindowFilter from manual ring buffer logic on FixedVector
to FixedRingBuffer<float>, eliminating window_head_, window_count_,
and window_size_ fields.
2026-03-12 11:07:35 -10:00