Skip to content

app_main: enable SRP auto-host-address to fix Thread commissioning#41

Merged
GuvHas merged 2 commits intomainfrom
claude/review-esp32-thread-code-EsKdn
Mar 19, 2026
Merged

app_main: enable SRP auto-host-address to fix Thread commissioning#41
GuvHas merged 2 commits intomainfrom
claude/review-esp32-thread-code-EsKdn

Conversation

@GuvHas
Copy link
Copy Markdown
Owner

@GuvHas GuvHas commented Mar 19, 2026

The SRP client gets stuck in "Updated" state and never sends its SRP Update to the OTBR. Without an SRP Update, the OTBR never proxies the _matter._tcp record to mDNS, HA's matter-server cannot locate the device for CASE, and the FailSafe timer expires (t=200.6s), rolling back the entire commissioning (Thread dataset + NOC).

Root cause: on ESP32 with WiFi present in the build (even when disabled via CONFIG_ENABLE_WIFI_STATION=n), the CHIP SDK does not reliably call otSrpClientSetHostAddresses() after Thread attaches. The SRP client has the _matter._tcp service queued but its host object has zero addresses, so OpenThread never transmits the SRP Update.

Fix: call otSrpClientEnableAutoHostAddress() once on the CHIP/OpenThread task immediately after esp_matter::start(). This puts the SRP client into auto-host-address mode: OpenThread itself watches the Thread netif for address changes and keeps the SRP host addresses current, removing the dependency on the CHIP SDK calling otSrpClientSetHostAddresses() at the right moment.

https://claude.ai/code/session_01SxqAiQApiRTwXefk9aQ6bR

claude added 2 commits March 19, 2026 10:53
The SRP client gets stuck in "Updated" state and never sends its SRP
Update to the OTBR.  Without an SRP Update, the OTBR never proxies the
_matter._tcp record to mDNS, HA's matter-server cannot locate the device
for CASE, and the FailSafe timer expires (t=200.6s), rolling back the
entire commissioning (Thread dataset + NOC).

Root cause: on ESP32 with WiFi present in the build (even when disabled
via CONFIG_ENABLE_WIFI_STATION=n), the CHIP SDK does not reliably call
otSrpClientSetHostAddresses() after Thread attaches.  The SRP client has
the _matter._tcp service queued but its host object has zero addresses,
so OpenThread never transmits the SRP Update.

Fix: call otSrpClientEnableAutoHostAddress() once on the CHIP/OpenThread
task immediately after esp_matter::start().  This puts the SRP client
into auto-host-address mode: OpenThread itself watches the Thread netif
for address changes and keeps the SRP host addresses current, removing
the dependency on the CHIP SDK calling otSrpClientSetHostAddresses() at
the right moment.

https://claude.ai/code/session_01SxqAiQApiRTwXefk9aQ6bR
…nce()

esp_openthread_get_instance() is declared in the ESP-IDF OpenThread component
header <esp_openthread.h>, not in the CHIP SDK's OpenthreadLauncher.h.
Fixes the build error introduced in the previous SRP workaround commit.

https://claude.ai/code/session_01SxqAiQApiRTwXefk9aQ6bR
@GuvHas GuvHas merged commit d7581bc into main Mar 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants