Topic

FAQ
Login Register
ZibBee - reporting
Sep 02, 2022 07:21

/

A

/A

Based on the example SampleLight:

There is the following:

/* Set default reporting configuration */

u8 reportableChange = 0x00;

bdb_defaultReportingCfg(LIGHT_ENDPOINT, HA_PROFILE_ID, ZCL_CLUSTER_GEN_ON_OFF, ZCL_ATTRID_ONOFF, 0x0000, 0x003c, (u8 *)&reportableChange);

With Maximum reporting interval, in seconds = 0xx3C

and function:

void report_handler(void) {

  if(zb_isDeviceJoinedNwk()){

   if(zcl_reportingEntryActiveNumGet()){

    u16 second = 1;//TODO: fix me

    reportNoMinLimit();

    //start report timer

    reportAttrTimerStart(second);

   }

   else{

    //stop report timer

    reportAttrTimerStop();

   }

  }

}


Should the report be sent automatically, or is something else missing in the code of the example sampleLight?





14 replies
TL_Soyo Sep 02, 2022 10:18
0
/A

Hi,
The reporting is automatic. The user only needs to configure the default reporting parameters(bdb_defaultReportingCfg(LIGHT_ENDPOINT, HA_PROFILE_ID, ZCL_CLUSTER_GEN_ON_OFF, ZCL_ATTRID_ONOFF, 0x0000, 0x003c, (u8 *)&reportableChange);) of the device. After the coordinator binds the device, it can automatically report. At the same time, the coordinator can also configure the default reporting parameters.


wes58 [Author] Sep 04, 2022 09:22
0
/A

Hi,

I did some testing because the reporting didn t work . I toggle some LEDs in some functions in zcl_reporting.c and found out the following:

Function reportAttrTimerStart()

zb_bindingTblSearched(pEntry->clusterID, pEntry->endPoint) is always FALSE, so timer TL_ZB_TIMER_SCHEDULE is never executed.


When I comment out if(zb_bindingTblSearched) the timer is executed and it gets to function reportAttr(reportCfgInfo_t *pEntry).


But again, because of zb_bindingTblSearched() returning FALSE, the function returns, and the report is not send!

When I comment out in function reportAttr(), if(zb_bindingTblSearched), I get to zcl_sendReportCmd()


But because of the setting, dstEpInfo.dstAddrMode = APS_DSTADDR_EP_NOTPRESETNT, the gateway doesn t get the report.

If I change to:

dstEpInfo.dstAddrMode = APS_SHORT_DSTADDR_WITHEP;

dstEpInfo.dstAddr.shortAddr = 0xffff;

dstEpInfo.dstEp = 1;

the gateway receives the reports.


When I call function aps_binding_entry = *bindTblEntryGet();, in BDT I can see that all values in aps_binding_entry are 0?


So I found the following issues:

1. zb_bindingTblSearched returns false. Becuase there is no c file for this function I can t see what is going on there.

2 . dstEpInfo.dstAddrMode = APS_SHORT_DSTADDR_WITHEP;- message not received by gateway (I assume that it is sent, because zcl_sendReportCmd() is executed). Is it a gateway issue?


Can you please advise how to fix it?


wes58 [Author] Sep 04, 2022 10:33
0
/A





TL_Soyo Sep 05, 2022 11:09
0
/A


Hi,

  zb_bindingTblSearched  will return true  after coordinator binds the device,you can use ZGC TOOL with telink coordinator to bind peer Cluster,after you can report

wes58 [Author] Sep 05, 2022 14:27
0
/A

I can't use ZGC TOOL. I tried, and first I get ModuleNotFoundError: No module named 'PyQt5'
After I install PyQt5 I get ModuleNotFoundError: No module named 'pandas'

I stopped here. What else will be missing when I install pandas?

Besides, I don't want to modify my gateway board to connect to PC. And I would have to do it every time I add a new device (in the future). It is running together with ESP32 now. 


What is the binding request message that is send to the device? I could send it from ESP32.


For now, I just removed zb_bindingTblSearched as I described in my previous post and it has been working fine.


TL_Soyo Sep 05, 2022 14:47
0
/A

Hi,

   It designed for zigbee certification,and binding msg is controlled by ZDO layer,you cant use ZCL msg to send,if you dont need certification,remoe it is OK.and find more imformation from zigbee Spec.

wes58 [Author] Sep 05, 2022 15:40
0
/A

I just make it for myself, so I do care about zigbee certification.

I will try to send ZBHCI Binding Request msg. from ESP32 to the gateway - 55 00 20 00 0E A1 00 00 00 00 00 00 36 B5 0B 00 06 01 CC CC AA, and see what I get.


What about the second issue I had - dstEpInfo.dstAddrMode = APS_SHORT_DSTADDR_WITHEP didn t work. Gateway didn t receive the message. Would it work after binding?

TL_Soyo Sep 05, 2022 16:07
0
/A

you said gateway can receive,what is the question?

wes58 [Author] Sep 05, 2022 16:23
0
/A

Sorry, I made a mistake. Original SDK code uses - dstEpInfo.dstAddrMode = APS_DSTADDR_EP_NOTPRESETNT.

And this didn't work.

So the question was, whether it will work after binding i.e. when zb_bindingTblSearched returns true?


TL_Soyo Sep 06, 2022 09:56
0
/A

Yes,it will,and you can modify the dstAddrMode as you did.

binding will make device save peer device's mac address,that named binding table,then uses - dstEpInfo.dstAddrMode = APS_DSTADDR_EP_NOTPRESETNT.stack will automatic find the peer mac address ,send report to peer device by APS_LONG_DSTADDR_WITHEP.

wes58 [Author] Sep 06, 2022 10:26
0
/A

I tried to send Request Binding message from ESP32 through the gateway to the device, but I don't have any luck. So, I don't know where to look to see what is wrong.

I assume that, that there is no source code to see if the message was received by the device so I can't do anything.

TL_Soyo Sep 06, 2022 10:54
0
/A

It is ZDO msg,you can see pkg only from sniffer,no feedback to ZCL layer.we dont know whether the binding msg is right now.

wes58 [Author] Sep 06, 2022 11:00
0
/A

Shouldn't I receive ZBHCI_CMD_BINDING_RSP message?



wes58 [Author] Sep 07, 2022 05:33
0
/A

After looking in the ZigBee specification I saw that the device should send a msg:


2.2.4.3.1.3 Effect on Receipt On receipt of this primitive by a device that is not currently joined to a network, or by a device that does not support a binding table, or if any of the parameters has a value which is out of range, the APSME issues the APSME-BIND.confirm primitive with the Status parameter set to ILLEGAL_REQUEST.

If the APS sub-layer on a device that supports a binding table receives this primitive from the NHLE, the APSME attempts to create the specified entry directly in its binding table. If the entry could be created, the APSME issues the APSME-BIND.confirm primitive with the Status parameter set to SUCCESS. If the entry could not be created due to a lack of capacity in the binding table, the APSME issues the APSME-BIND.confirm primitive with the Status parameter set to TABLE_FULL.

2.2.4.3.2 APSME-BIND.confirm This primitive allows the next higher layer to be notified of the results of its request to bind two devices together, or to bind a device to a group.


So, why there is nothing received by the gateway?