Skip to content

fix(cluster_select): gate Thread clusters on OPENTHREAD_ENABLED (CON-1993)#1726

Merged
espressif-bot merged 1 commit into
espressif:mainfrom
cleishm:fix/disable-thread-clusters-without-openthread
Mar 3, 2026
Merged

fix(cluster_select): gate Thread clusters on OPENTHREAD_ENABLED (CON-1993)#1726
espressif-bot merged 1 commit into
espressif:mainfrom
cleishm:fix/disable-thread-clusters-without-openthread

Conversation

@cleishm
Copy link
Copy Markdown
Contributor

@cleishm cleishm commented Feb 25, 2026

Summary

  • Add depends on OPENTHREAD_ENABLED to the three Thread-related cluster Kconfig entries (Thread Network Diagnostics, Thread Border Router Management, Thread Network Directory) so they are only enabled when OpenThread is present
  • Update generate_cluster_select_files.py to emit the dependency for Thread clusters when regenerating

Problem

On WiFi-only devices (e.g. ESP32-S3), CONFIG_SUPPORT_THREAD_NETWORK_DIAGNOSTICS_CLUSTER and the other two Thread cluster configs default to y unconditionally. This causes the clusters to be created on the root node endpoint, but since CHIP_DEVICE_CONFIG_ENABLE_THREAD is disabled, attribute reads fail with CHIP_ERROR_NOT_IMPLEMENTED (error 0x2d). This produces noisy errors during Matter subscription:

E (7684) chip[DMG]: Fail to retrieve data, roll back and encode status on clusterId: 0x0000_0035, attributeId: 0x0000_0000 err = 2d

The errors are harmless (controllers handle the status responses), but they indicate unnecessary cluster registration and produce ~17 error lines on every subscription.

Fix

The generated Kconfig.in entries for the three Thread clusters now include depends on OPENTHREAD_ENABLED, so they can only be enabled when the OpenThread stack is actually available. On WiFi-only targets, the clusters won't be registered and controllers won't attempt to read their attributes.

Test plan

  • Build and flash a WiFi-only device (e.g. ESP32-S3) — confirm Thread diagnostic clusters are not created and no 0x0035 DMG errors appear
  • Build and flash a Thread-capable device (e.g. ESP32-H2/C6 with CONFIG_OPENTHREAD_ENABLED=y) — confirm Thread clusters are still created and functional

The three Thread-related clusters (Thread Network Diagnostics, Thread
Border Router Management, Thread Network Directory) default to enabled
regardless of whether OpenThread is present. On WiFi-only devices this
causes the clusters to be registered on the root node endpoint, but
read requests fail with CHIP_ERROR_NOT_IMPLEMENTED because
CHIP_DEVICE_CONFIG_ENABLE_THREAD is disabled, producing noisy DMG
errors like:

  E chip[DMG]: Fail to retrieve data ... clusterId: 0x0000_0035 err = 2d

Add `depends on OPENTHREAD_ENABLED` so these clusters are only
available when the Thread stack is actually present.
@github-actions github-actions Bot changed the title fix(cluster_select): gate Thread clusters on OPENTHREAD_ENABLED fix(cluster_select): gate Thread clusters on OPENTHREAD_ENABLED (CON-1993) Feb 25, 2026
@espressif-bot espressif-bot merged commit 81f0a4d into espressif:main Mar 3, 2026
3 checks passed
@cleishm cleishm deleted the fix/disable-thread-clusters-without-openthread branch March 13, 2026 11:27
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.

4 participants