You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my code, I create an endpoint list on endpoint 1, add mandatory clusters (Basic, Identify), add the OnOff cluster and then I add a custom cluster (0xFF02) with one custom attribute (0x0000, with a custom value of 10):
When I join this device to the network I can see the custom cluster (with a simple descriptor request) and the custom attribute (with a discover attributes request).
I can read the OnOff cluster OnOff attribute without any issues, but when I send a read attribute request to the custom cluster (0xFF02) with manufacturer specific flag set and manuf. code 0x1075, the device receives it but it can't read the attribute value.
So I added the esp_zb_raw_command_handler_register(zb_raw_cmd_handler); to do intercept (but not really) the zcl messages coming to the device so I can print the data there:
As you can see there, I print all the data about the received command and also if the command is a Read Attribute Request, I search the cluster attribute and print the data found in the cluster descriptor. Finally I try to get the attribute value using esp_zb_zcl_get_attribute() and esp_zb_zcl_get_manufacturer_attribute().
There are the logs when I run the application:
Sending a Read Attribute request to the OnOff cluster, OnOff attribute:
I (761600) ESP_ZB_ON_OFF_LIGHT: zb_raw_cmd_handler()
W (761600) ESP_ZB_ON_OFF_LIGHT: Dst endpoint: 1
W (761600) ESP_ZB_ON_OFF_LIGHT: Cluster id : 0x0006, Command id: 0x00
W (761600) ESP_ZB_ON_OFF_LIGHT: Cmd common : true
W (761610) ESP_ZB_ON_OFF_LIGHT: Manuf Spec : false
W (761620) ESP_ZB_ON_OFF_LIGHT: Manuf data : 0x0000
I (761620) ESP_ZB_ON_OFF_LIGHT: - Cluster: 0x0006, manuf code: 0x0000
I (761630) ESP_ZB_ON_OFF_LIGHT: - Attr_count: 3
I (761630) ESP_ZB_ON_OFF_LIGHT: Attr[0]: 0xfffd, type: 0x21, manuf code: 0xffff
I (761640) ESP_ZB_ON_OFF_LIGHT: Attr[1]: 0x0000, type: 0x10, manuf code: 0xffff
I (761650) ESP_ZB_ON_OFF_LIGHT: Attr[2]: 0xffff, type: 0x00, manuf code: 0xffff
I (761660) ESP_ZB_ON_OFF_LIGHT: esp_zb_zcl_get_attribute() = OK
I (761660) ESP_ZB_ON_OFF_LIGHT: esp_zb_zcl_get_manufacturer_attribute() = OK
Sending a Read Attribute request to the custom cluster (0xff02), attribute 0x0000:
I (809330) ESP_ZB_ON_OFF_LIGHT: zb_raw_cmd_handler()
W (809330) ESP_ZB_ON_OFF_LIGHT: Dst endpoint: 1
W (809330) ESP_ZB_ON_OFF_LIGHT: Cluster id : 0xff02, Command id: 0x00
W (809330) ESP_ZB_ON_OFF_LIGHT: Cmd common : true
W (809340) ESP_ZB_ON_OFF_LIGHT: Manuf Spec : true
W (809340) ESP_ZB_ON_OFF_LIGHT: Manuf data : 0x1075
I (809350) ESP_ZB_ON_OFF_LIGHT: - Cluster: 0xff02, manuf code: 0x0000
I (809360) ESP_ZB_ON_OFF_LIGHT: - Attr_count: 3
I (809360) ESP_ZB_ON_OFF_LIGHT: Attr[0]: 0xfffd, type: 0x21, manuf code: 0xffff
I (809370) ESP_ZB_ON_OFF_LIGHT: Attr[1]: 0x0000, type: 0x23, manuf code: 0xffff
I (809380) ESP_ZB_ON_OFF_LIGHT: Attr[2]: 0xffff, type: 0x00, manuf code: 0xffff
I (809390) ESP_ZB_ON_OFF_LIGHT: esp_zb_zcl_get_attribute() = Error
I (809390) ESP_ZB_ON_OFF_LIGHT: esp_zb_zcl_get_manufacturer_attribute() = Error
As you can see, the first request is fine, both esp_zb_zcl_get_attribute and esp_zb_zcl_get_manufacturer_attribute are returning the attribute value.
But on the second one, as you can see, in the cluster descriptor the manuf. code is 0x0000 and for each attribute on that cluster the manuf. code is 0xffff. I think this is why neither esp_zb_zcl_get_attribute and esp_zb_zcl_get_manufacturer_attribute are working to get the attribute value.
Also, the response for the Read Attribute Request is code 0x86 (ESP_ZB_ZCL_STATUS_UNSUP_ATTRIB).
I dont see where to set the manuf. code for the cluster and attributes and I'm not sure if this is why the esp_zb_zcl_get_manufacturer_attribute are not working correctly.
So my question is, what do I have to do for this custom clusters to work correctly? Read/Write attribute, Reporting, and cluster commands.
Thanks!
Additional context.
No response
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Custom clusters: esp_zb_zcl_get_attribute() and esp_zb_zcl_get_manufacturer_attribute() not working
Custom clusters: esp_zb_zcl_get_attribute() and esp_zb_zcl_get_manufacturer_attribute() not working (TZ-1150)
Sep 18, 2024
For time being, setting manufacturer code is not supported. Don't set the access of the attribute to ESP_ZB_ZCL_ATTR_MANUF_SPEC when creating the custom attribute:
Question
Hi,
I'm working on an application which has the OnOff cluster and a Custom Cluster (Manufacturer Specific) based on the example on how to create custom clusters: https://docs.espressif.com/projects/esp-zigbee-sdk/en/latest/esp32/user-guide/zcl_custom.html
In my code, I create an endpoint list on endpoint 1, add mandatory clusters (Basic, Identify), add the OnOff cluster and then I add a custom cluster (0xFF02) with one custom attribute (0x0000, with a custom value of 10):
When I join this device to the network I can see the custom cluster (with a simple descriptor request) and the custom attribute (with a discover attributes request).
I can read the OnOff cluster OnOff attribute without any issues, but when I send a read attribute request to the custom cluster (0xFF02) with manufacturer specific flag set and manuf. code 0x1075, the device receives it but it can't read the attribute value.
So I added the
esp_zb_raw_command_handler_register(zb_raw_cmd_handler);
to do intercept (but not really) the zcl messages coming to the device so I can print the data there:This is my
zb_raw_cmd_handler
function:As you can see there, I print all the data about the received command and also if the command is a Read Attribute Request, I search the cluster attribute and print the data found in the cluster descriptor. Finally I try to get the attribute value using
esp_zb_zcl_get_attribute()
andesp_zb_zcl_get_manufacturer_attribute()
.There are the logs when I run the application:
As you can see, the first request is fine, both
esp_zb_zcl_get_attribute
andesp_zb_zcl_get_manufacturer_attribute
are returning the attribute value.But on the second one, as you can see, in the cluster descriptor the manuf. code is 0x0000 and for each attribute on that cluster the manuf. code is 0xffff. I think this is why neither
esp_zb_zcl_get_attribute
andesp_zb_zcl_get_manufacturer_attribute
are working to get the attribute value.Also, the response for the Read Attribute Request is code 0x86 (ESP_ZB_ZCL_STATUS_UNSUP_ATTRIB).
I dont see where to set the manuf. code for the cluster and attributes and I'm not sure if this is why the
esp_zb_zcl_get_manufacturer_attribute
are not working correctly.So my question is, what do I have to do for this custom clusters to work correctly? Read/Write attribute, Reporting, and cluster commands.
Thanks!
Additional context.
No response
The text was updated successfully, but these errors were encountered: