Part Number: LP-CC2652RB
Other Parts Discussed in Thread: CC2652RB, UNIFLASH
Tool/software:
Hi. I've encountered many stability issues with my sensor design using SDK 6.20 and, after some discussions with my team and you guys, we've decided to move forward with the latest SDK version in the hope that we'll se better performance. However, I've noticed some issues that make it almost impossible to run applications with the new project structure. The development setup is as follows: CC2652RB for the sensors we're working on, a sonoff coordinator with zigbee2mqtt and home assistant for sensor testing. We've written a special external converter to ensure proper pairing and cluster discovery so we can test device functionality.
Problem 1: It seems that with the latest sdk version, the project files are not copied into the workspace, but rather referenced from the SDK install directory. That is not too big of a problem, but when I edit the _data.c other files, they are edited in the install location. Can I somehow copy the files into the project directory so that I can make multiple sensors starting from the same core project?
Problem 2: It seems that with the current SDK version, I am unable to pair any device with Z2M as I get an error that manufacturer name and model identifier are undefined. I've checked the _data.c file and both match the external converter. I went as far as comparing the _data.c file of sdk 7.41 to _data.c of sdk 6.20 and they appear to be identical. Even though they are identical in structure, sensors flashed with the firmware built on sdk 7.41 would never pair, while sensors build on sdk 6.20 pair with no issues. I've checked the user guide for both and found no special mentions about additional steps required to forward this information to the coordinator. I found a workaround this by first flashing a sensor with sdk 6.20 and pairing it, then reflashing it with sdk 7.41. Device announce works with sdk 7.41, but when I try to manually read any value, I get an error. The projects I use for testing are bare sample_temperaturesensor from both sdks with no added functionality. I would imagine that device discovery and the commissioning process are being handled by TI's zstack implementation, especially for sample projects.
Does Problem 2 stem from an incomplete implementation on my side of the sample project for SDK 7.41? How can I make sure that Z2M properly identifies the manufacturer and model identifier for my sensor so I can proceed with adding other features? I've found no migration guide from SDK 6 to SDK 7.
Logs I got from Z2M when pairing device:
[2025-01-09 14:09:58] debug: z2m: Received Zigbee message from '0x00124b0031e58b3e', type 'readResponse', cluster 'genBasic', data '{}' from endpoint 8 with groupID 0
[2025-01-09 14:09:58] debug: z2m: Skipping message, still interviewing
[2025-01-09 14:09:58] debug: zh:controller:endpoint: Error: ZCL command 0x00124b0031e58b3e/8 genBasic.read(["swBuildId"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false,"sendPolicy":"immediate"}) failed (Status 'UNSUPPORTED_ATTRIBUTE')
[2025-01-09 14:09:58] debug: zh:controller:device: Interview - failed to read attribute 'softwareBuildID' from endpoint '8' (Error: ZCL command 0x00124b0031e58b3e/8 genBasic.read(["swBuildId"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false,"sendPolicy":"immediate"}) failed (Status 'UNSUPPORTED_ATTRIBUTE'))
[2025-01-09 14:09:58] debug: zh:controller:device: Interview - completed for device '0x00124b0031e58b3e'
[2025-01-09 14:09:58] debug: zh:controller:database: Writing database to '/config/zigbee2mqtt/database.db'
[2025-01-09 14:09:58] info: zh:controller: Succesfully interviewed '0x00124b0031e58b3e'
[2025-01-09 14:09:58] info: z2m: Successfully interviewed '0x00124b0031e58b3e', device has successfully been paired
[2025-01-09 14:09:58] warning: z2m: Device '0x00124b0031e58b3e' with Zigbee model 'undefined' and manufacturer name 'undefined' is NOT supported, please follow https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html
[2025-01-09 14:09:58] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":null,"friendly_name":"0x00124b0031e58b3e","ieee_address":"0x00124b0031e58b3e","status":"successful","supported":null},"type":"device_interview"}'
Code from _data.c
const uint8_t zclSampleTemperatureSensor_ManufacturerName[] = { 16, 'T','e','x','a','s','I','n','s','t','r','u','m','e','n','t','s' };
const uint8_t model[] = { 10, 'A','F','T', 'D','U','M','M','Y','Y','Y'};
CONST zclAttrRec_t zclSampleTemperatureSensor_Attrs[] =
{
// *** General Basic Cluster Attributes ***
{
ZCL_CLUSTER_ID_GENERAL_BASIC,
{ // Attribute record
ATTRID_BASIC_ZCL_VERSION,
ZCL_DATATYPE_UINT8,
ACCESS_CONTROL_READ,
(void *)&zclSampleTemperatureSensor_ZCLVersion
}
},
{
ZCL_CLUSTER_ID_GENERAL_BASIC, // Cluster IDs - defined in the foundation (ie. zcl.h)
{ // Attribute record
ATTRID_BASIC_HW_VERSION, // Attribute ID - Found in Cluster Library header (ie. zcl_general.h)
ZCL_DATATYPE_UINT8, // Data Type - found in zcl.h
ACCESS_CONTROL_READ, // Variable access control - found in zcl.h
(void *)&zclSampleTemperatureSensor_HWRevision // Pointer to attribute variable
}
},
{
ZCL_CLUSTER_ID_GENERAL_BASIC,
{ // Attribute record
ATTRID_BASIC_MANUFACTURER_NAME,
ZCL_DATATYPE_CHAR_STR,
ACCESS_CONTROL_READ,
(void *)zclSampleTemperatureSensor_ManufacturerName
}
},
{
ZCL_CLUSTER_ID_GENERAL_BASIC,
{ // Attribute record
ATTRID_BASIC_MODEL_IDENTIFIER,
ZCL_DATATYPE_CHAR_STR,
ACCESS_CONTROL_READ,
(void *)model
}
},
{
ZCL_CLUSTER_ID_GENERAL_BASIC,
{ // Attribute record
ATTRID_BASIC_POWER_SOURCE,
ZCL_DATATYPE_ENUM8,
ACCESS_CONTROL_READ,
(void *)&zclSampleTemperatureSensor_PowerSource
}
},
{
ZCL_CLUSTER_ID_GENERAL_BASIC,
{ // Attribute record
ATTRID_BASIC_PHYSICAL_ENVIRONMENT,
ZCL_DATATYPE_ENUM8,
(ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
(void *)&zclSampleTemperatureSensor_PhysicalEnvironment
}
},
{
ZCL_CLUSTER_ID_GENERAL_BASIC,
{ // Attribute record
ATTRID_CLUSTER_REVISION,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
(void *)&zclSampleTemperatureSensor_basic_clusterRevision
}
},
// *** Identify Cluster Attribute ***
{
ZCL_CLUSTER_ID_GENERAL_IDENTIFY,
{ // Attribute record
ATTRID_IDENTIFY_IDENTIFY_TIME,
ZCL_DATATYPE_UINT16,
(ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
(void *)&zclSampleTemperatureSensor_IdentifyTime
}
},
{
ZCL_CLUSTER_ID_GENERAL_IDENTIFY,
{ // Attribute record
ATTRID_CLUSTER_REVISION,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ | ACCESS_GLOBAL,
(void *)&zclSampleTemperatureSensor_identify_clusterRevision
}
},
// *** Temperature Measurement Attriubtes ***
{
ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
{ // Attribute record
ATTRID_TEMPERATURE_MEASUREMENT_MEASURED_VALUE,
ZCL_DATATYPE_INT16,
ACCESS_CONTROL_READ | ACCESS_REPORTABLE,
(void *)&zclSampleTemperatureSensor_MeasuredValue
}
},
{
ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
{ // Attribute record
ATTRID_TEMPERATURE_MEASUREMENT_MIN_MEASURED_VALUE,
ZCL_DATATYPE_INT16,
ACCESS_CONTROL_READ,
(void *)&zclSampleTemperatureSensor_MinMeasuredValue
}
},
{
ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
{ // Attribute record
ATTRID_TEMPERATURE_MEASUREMENT_MAX_MEASURED_VALUE,
ZCL_DATATYPE_INT16,
ACCESS_CONTROL_READ,
(void *)&zclSampleTemperatureSensor_MaxMeasuredValue
}
},
{
ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
{ // Attribute record
ATTRID_CLUSTER_REVISION,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
(void *)&zclSampleTemperatureSensor_temperaturems_clusterRevision
}
},
};
External converter:
const {temperature, humidity, battery} = require('zigbee-herdsman-converters/lib/modernExtend');
const definition = {
zigbeeModel: ['AFTDUMMYYY'],
model: 'AFTDUMMYYY',
vendor: 'TexasInstruments',
description: 'Temperature sensor',
/**
* Modern extends encapsulate fromZigbee, toZigbee, exposes, etc..
*/
extend: [temperature()],
};
module.exports = definition;