Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the manufacturerName not working #33

Open
jrossouw opened this issue Sep 9, 2023 · 3 comments
Open

Setting the manufacturerName not working #33

jrossouw opened this issue Sep 9, 2023 · 3 comments

Comments

@jrossouw
Copy link

jrossouw commented Sep 9, 2023

The example code does not appear to set the manufacturer code correctly when pairing the device with my Homey Pro controller. My controller always show the manufacturer as "TELINK" while in the example sensor code it is set it to:

const uint8_t au8ManufacturerName[] = {13,'L','I','L','Y','G','O', '.', 'S', 'e', 'n', 's', 'o', 'r'};

Has anyone else experienced this issue?

@jrossouw
Copy link
Author

jrossouw commented Dec 4, 2023

Setting the model identifier seems to work, but not setting the manufacturer. Any idea what I am doing wrong here:
`
case ZBHCI_CMD_NETWORK_STATE_REPORT:

           sDstAddr.u16DstAddr = 0x0000;

            zbhci_ZclSendReportCmd(0x02, sDstAddr, 1, 1, 0, 1, ZB_ZCL_CLUSTER_ID_BASIC, 0x0004, ZCL_DATA_TYPE_CHAR_STR, sizeof(manufacturerName), (uint8_t*)&manufacturerName);

            vTaskDelay(100 / portTICK_PERIOD_MS);

            zbhci_ZclSendReportCmd(0x02, sDstAddr, 1, 1, 0, 1, ZB_ZCL_CLUSTER_ID_BASIC, 0x0005, ZCL_DATA_TYPE_CHAR_STR, sizeof(modelIdentifier), (uint8_t*)&modelIdentifier);

            vTaskDelay(100 / portTICK_PERIOD_MS);

`

@papadeltasierra
Copy link

papadeltasierra commented Jan 25, 2024

You need to look at the Telink SDK examples where they set

zcl_basicAttr_t g_zcl_basicAttrs = ...

This will be in the <something>Cfg.c file. This pulls in a #defined byte array that should contain your manufacturer name and the model. This definitely works as I am using it.

@asat232
Copy link

asat232 commented Oct 8, 2024

Absolutely correct question.
First of all lets look how its intended to work for example zigbee2mqtt (as coordinator) and sampleLight (as router).
Both of them having two parts of code: first for ESP32C3 in this repo and pre-built for TLSR8258 telink-zigbee-sdk (slightly modified version of original telink_zigbee_sdk).

zigbee2mqtt (ccoridnator) getting Announcement Indication code here

uint16_t au16AttrList[1] = {0x0005};
zbhci_ZclAttrRead(0x02, (ts_DstAddr) {.u16DstAddr = payload->u16NwkAddr}, 1, 1, 0, 0x0000, 1, au16AttrList);

And getting respose from sampleLight (router):

ZCL_ATTR_READ_RSP
Type: 0x8100
(ZCL Attr Read Rsp)
Src Ep: 0x1
Cluster ID: 0000
Attr Num: 0x01
Attr List:
Attr 0:
Attr ID: 0x05
Data Type: 0x42
Data Len: 0x08
Attr Data: TLSR82xx

because in pre-built binary we have this code
But on successful commissioning code here, sampleLight getting ZBHCI_CMD_NETWORK_STATE_REPORT code here

sDstAddr.u16DstAddr = 0x0000;
zbhci_ZclSendReportCmd(0x02, sDstAddr, 1, 1, 0, 1, 0x0000, 0x0005, ZCL_DATA_TYPE_CHAR_STR, sizeof(au8ManufacturerName), (uint8_t *)&au8ManufacturerName);

Coordinator getting:

ZCL_REPORT_MSG_RCV
Type: 0x8104
  (ZCL Attr Report)
  Src Ep:     0x1
  Cluster ID: 0000
  Attr Num:   0x01
  Attr List:
    Attr 0:
      Attr ID:   0x05
      Data Type: 0x42
      Data Len:  0x0c
      Attr Data: LILYGO.Light

So, if coordinator reading Basic Cluster Attributes its always getting what is hardcoded in TLSR8258 firmware.
The code in sampleLight NOT setting Attribute, its just sending Attribute Report with fake value.

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

No branches or pull requests

3 participants