E_ZCL_ERR_CLUSTER_NOT_FOUND error from eZCL_SetReportableFlag and eZCL_ReportAttribute

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

E_ZCL_ERR_CLUSTER_NOT_FOUND error from eZCL_SetReportableFlag and eZCL_ReportAttribute

1,136 Views
pldrouin_
Contributor II

Hi,

I am trying to report an attribute through a function call of eZCL_ReportAttribute as described in JN-UG-3115, but I am stuck with an E_ZCL_ERR_CLUSTER_NOT_FOUND error from eZCL_ReportAttribute and (eZCL_SetReportableFlag) originating from the eZCL_SearchForClusterEntry internal function. Here is how I call eZCL_SetReportableFlag (after ZCL initialisation):

teZCL_Status status=eZCL_SetReportableFlag(0x01, MEASUREMENT_AND_SENSING_CLUSTER_ID_TEMPERATURE_MEASUREMENT, TRUE, FALSE, 0x0000);

After this line, status has a value of E_ZCL_ERR_CLUSTER_NOT_FOUND (10)

In ZBPro Configuration editor, I have the cluster "TemperatureMeasurement"  (0x0402) listed as both an input and output clusters for the End Point "Application" (1), and I verified that the cluster is listed in s_au16Endpoint1InputClusterList and s_au16Endpoint1OutputClusterList in zps_gen.c.

Why is the cluster not found? I tried to also call eCLD_TemperatureMeasurementCreateTemperatureMeasurement, but my understanding is that all it does it to populate structures that are not related to the data accessed by the eZCL_SearchForClusterEntry internal function, so it did not fix the issue. I am just trying to report an attribute through a function call. I do not want to use polling or automatic reporting if possible.

Thank you!

0 Kudos
6 Replies

970 Views
pldrouin_
Contributor II

Hi Mario,

I am working on a modified version of the EndDevice firmware in JN-AN-1217. Yes I did modify the zpscfg using ZBPro Configuration editor as explained in my first post in order to add the 0402 cluster (I added it in the profile and also as input and output clusters for the endpoint 1 of EndDevice). Like I said zps_gen.c reflects my changes to zpscfg. I tried the clean and recompilation procedures a few times but it does not make a difference regarding the error.

I looked at the console output from the compilation process and I see that ZPSConfig.exe is run using the right app.zpscfg file and zps_gen.o is also generated using the right zps_gen.c file. I can find my 0x0402 cluster ID values in the s_au16Endpoint1InputClusterList and s_au16Endpoint1OutputClusterList arrays in the zps_gen.o binary file. If I add debug print statements I see these appearing after I flash the new firmware, so I know that the firmware is reflashed.

I also tried to move up my 0402 cluster in the list of input and output clusters for EndDevice and it did not make a difference. Is there something else that could be causing the issue I am having?

Thanks!

0 Kudos

970 Views
pldrouin_
Contributor II

I just looked at the elf file and I can also see the cluster arrays with my 0402 input and output clusters there.

0 Kudos

970 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Pierre,

Could you please look at the next community document?

https://community.nxp.com/docs/DOC-335075  I am not sure if you modify the makefile.

Let me know if you still have issues with the cluster

Regards,

Mario

0 Kudos

970 Views
pldrouin_
Contributor II

Hi Mario,

thank you for the link to the community document, this was helpful. I had done everything in that document, except the hacking of the eZHA_RegisterBaseDeviceEndPoint function in the base_device.c file in the SDK. Instead I was calling the function eCLD_TemperatureMeasurementCreateTemperatureMeasurement from my app_zcl_task.c file.

So by looking at the code in eZHA_RegisterBaseDeviceEndPoint plus all the ZCL structures defined in the SDK, I realised that the zpscfg was not the issue, and that instead the critical part is the registration of an entire endpoint via the eZCL_Register function. So a single cluster cannot be added/registered in an existing endpoint, but instead the entire endpoint has to be defined, including all basic clusters and, in my case, the temperature measurement cluster, then this endpoint has to be registered through eZCL_Register.

So in order to do that, instead of hacking an SDK file as described in the community document, I decided to call eHA_RegisterTemperatureSensorEndPoint from TemperatureMeasurement.h instead of eZHA_RegisterBaseDeviceEndPoint in my app_zcl_task.c file. I also had to declare an instance of tsHA_TemperatureSensorDevice, that I called sTemperatureSensorDevice, to replace sBaseDevice.

I can then call eZCL_ReportAttribute, after assigning my temperature value to sTemperatureSensorDevice.sTemperatureMeasurementServerCluster.i16MeasuredValue and calling PDUM_hAPduAllocateAPduInstance to get an instance of PDUM_thAPduInstance to pass to eZCL_ReportAttribute. I am not sure if it is the right procedure to call PDUM_hAPduAllocateAPduInstance?

What surprised me the most is the fact that the clusters and endpoints declared in the zpscfg file do not seem to have any effect whatsoever on the ZCL functions that deal with attributes and endpoints, at least directly. Instead it looks like the entries in the zpscfg file are only used by the function ZPS_eAplAfUnicastAckDataReq which is called by eZCL_TransmitDataRequest, (which is itself called by eZCL_ReportAttribute). Is this duality of endpoint and cluster definition structures discussed/explained in a document?

Thank you!

0 Kudos

970 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Pierre,

 

As you know, we have some different AN that has implemented different endpoints, you looked at the Base Device example, but you could look at the JN-AN-1219 that is implementing the reporting process for the Temperature Measurement.

    // Register the Light Sensor on its own endpoint
    eZCL_Status = eZLO_RegisterLightSensorEndPoint(LIGHTTEMPERATUREOCCUPANCYSENSOR_SENSOR_ENDPOINT,
                                                  fptr,
                                                  &sSensor)

If you are getting the correct return value from the PDUM_hAPduAllocateAPduInstance and following the process yo passed to the ZPS_eAplAfUnicastAckDataReq should not have any issues.

Regards,

Mario

0 Kudos

969 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Pierre,

What is the example that you are working on?

Did you modify the zpscfg? Could you please save, clean and compiled all the project again?

The issue, as you know, is because the specified cluster has not been registered with the ZCL.

Regards,

Mario

0 Kudos