This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Attribute reporting in Z-Stack ZCL implementation

Other Parts Discussed in Thread: Z-STACK

Hi,

I can't clearly understand if the reporting mechanism is implemented in Z-Stack ZCL? Seems it is not.

Sample applications have a note inside the code: "See ZCL Test Applicaiton (zcl_testapp.c) for sample code on Attribute Reporting", but I can't find this "zcl_testapp.c" in Z-Stack or any references in documentation and web-site. I found a part of implementation, which should process configure reporting in esp and smartmeter samples, but it is a stub implementation. So the question is: Does TI have or plan implementation for attribute reporting, or this should be done by the developer? :-)

 

  •  

    Hello,

    Anyone has found any information about this "missed" file "zcl_testapp.c" about Attribute reporting?

  • TestApp is an internal tool which is not released to public. It should not have been mentioned in the comments, sorry for any inconvenience.

    Z-Stack has ZCL reporting capability, and all of the hook-ups for integration with application are available, but it this is not trivial. Unfortunately, there is no example which is available yet.

    ZCL reporting example will be included in next release of HA sample application.

    Regards,

  •  hello 

    i just want to know when ti can issue the code about the reporting example ,i try to reaserch the reporting code ,but failed.....so i want ti to help me...

  •  

    Hi,

        Please ignore the references to zcl_testapp.c, this is not part of the Z-Stack release. Configure reporting should be done in the appication and is not part of the ZCL. I have attached an example of configure reporting, it is based on 2.3.0, so you may need to port the configure reporting code to the latest Z-Stack application, but I guess you will need to port this into your aplpication anyway.

    I have implemented both client and server side functionality in both the Light and the Switch. The samples configure the switch as the server and light as the client, the instructions for using this example are below.

    1.    Extract the attached zip into the ZStack-CC2530-2.3.0-1.4.0\Projects\zstack\ dir
    2.    The examples can then be found in ZStack-CC2530-2.3.0-1.4.0\Projects\zstack\HomeAutomation-ConfigReportingV3\
    3.    Open the SampleLight Project.
    4.    Select the CoordinatorEb-Pro configuration.
    5.    Enable configure reporting by un-commenting ZCL_REPORT in f8wConfig.cfg
    6.    Build and download.
    7.    Open the SampleLight Project.
    8.    Select the RouterEb-Pro configuration.
    9.    Build and download.
    10.    Power both devices.
    11.    Press joystick left on the Switch/Coordinator to bind the devices.
    12.    Press up on the Switch and check LED1 on Light is toggled to insure the binding was successful.
    13.    Press down on the Switch. This will send a ConfigReportCmd to the light requesting a report of the On/Off cluster be sent at a min of 6s and max of 7s.
    14.    Each time the light sends a report it will toggle LED2.
    15.    Each time the Switch receives a report it will report it on the LCD.
    16.    Press down on the Light. This will send a ConfigReportCmd to the Switch informing it that it should receive an On/Off report no more than every 8s (Timeout period).
    17.    Remove power from the Light. After 8s of not receiving reports the Switch will report the time out to the LCD and toggle LED3.

    I hope this helps.

     

    HomeAutomation-ConfigReportingV3.zip
  •   thank you ,thank you very much ,i will follow your step to study it

  • hello ,i have understand the report code throught your souport.thank you very much .

    and i also want to know about the mechanism of the "Changes to ’Discrete’ Attributes"  ,it is from the datasheet about the "zcl"

    It describes that :

    If the attribute has a ’discrete’ data type, a report shall be generated when the  attribute undergoes any change of value. Discrete types are general data types (which are often used as set of bit fields), logical types, bitmap types,
    enumerations, strings, identifiers and IEEE address (see Table 2.14).

    so that i want to know whether i must to compile added  codes to report the on/off  state of the light to the swith when  any change of value on the light happen.

  • Hi Topcat
    I have a question about the reporting mechanism of ZCL(in zstack)

    11. Press joystick left on the Switch/Coordinator to bind the devices.

    1. as Item 11 notice, does the reporting mechanism only being effective on two device which had success in binding?

    2. what will cause reporting? receiving the report cmd , or local toggle onoff light?

    3. reporting to who? only who configured it report or boardcast for all devices on the network?
  • 1. Everyone in the same Zigbee network can send report configuration to the device if it knows short address, active endpoint and its attribute.
    2. When a device receives report config command, it would trigger report. However, you have to implement this in application by yourself.
    3. It will report to its binding destination.
  • Hi Yikai 

          i have got the example of config reporting。

         but  i am curious about whether the example is only for show-how~~~~~

         

        1. SAMPLELIGHT_ENDPOINT??? if there are more than endpoint , this should not be right 。

        2.  zclSampleLight_DstAddr should be change to all devices  which have sent the config report for the local devices,not only the binding one

        3. if remote devices  was not config the ZCL_CLUSTER_ID_GEN_ON_OFF clusterID ,is that right to put this in the function?

        4. the pOnOffReportCmd was only set as one attribute

        5. the direction should not be right only define ZCL_FRAME_SERVER_CLIENT_DIR

      if ( events & SAMPLELIGHT_ON_OFF_REPORT_ATTRIBUTE_EVT )
      {
        if ( pOnOffReportCmd != NULL )
        {
          static uint8 led2State=0;
          //Send the report
          zcl_SendReportCmd( SAMPLELIGHT_ENDPOINT, &zclSampleLight_DstAddr,
                           ZCL_CLUSTER_ID_GEN_ON_OFF, pOnOffReportCmd,
                           ZCL_FRAME_SERVER_CLIENT_DIR, 1, 0 );

          //Reset the timer. Time out in ms so *1000 to get seconds
          osal_start_timerEx( zclSampleLight_TaskID, SAMPLELIGHT_ON_OFF_REPORT_ATTRIBUTE_EVT, OnOffReportMinInterval*1000 );
         
          //toggle LED 2 every time we send the message (just for debug)
          led2State ^= 1;
          HalLedSet( HAL_LED_2, led2State );
        }
        //Clear the event
        return ( events ^ SAMPLELIGHT_ON_OFF_REPORT_ATTRIBUTE_EVT );
      }

  • 1. Do you mean more than one endpoint? If there is more than one endpoint, you should request different simple descriptor for each endpoint and your application should keep a record for this.
    2. If you enable NV_RESOTRE, short address shouldn't change.
    3, 4 &5. Don't understand your questions well.
  • Hi Yikai
    what i mean is that all those itme of the zcl_SendReportCmd()function should be “come” or “get ” from Remote devices while receive the report config Cmd , if we make it more “intelligentialize”

    uint8 srcEP,
    afAddrType_t *dstAddr,
    uint16 clusterID,
    zclReportCmd_t *reportCmd,
    uint8 direction,
    uint8 disableDefaultRsp,
    uint8 seqNum

    anyway,those item should be add in the NV when there a new CfgReport Cmd coming

    because,we are not sure they were as same as every time。。。


    but if we want to do this , there should be a lot of work。。。。。

    so i just broadcast to all devices which RxOnWhenIdle == TRUE ,and only the OnOff attribute would be OK to report
  • Broadcast is not a good idea in mesh network.
  • Hi Yikai
    i can‘t get the report in the receive side !

    i add below code in the receive side。。

    1. enable the ZCL_REPORT
    2. Add a private function “zclXXXX_ProcessInReportCmd( pInMsg );” into the item ZCL_CMD_REPORT of zclXXXX_ProcessIncomingMsg() function to get the report


    but i set a breakpoint at the zclXXXX_ProcessIncomingMsg(), it did not stop while other remote device send a report to it 。

    is that any more need to do if i want to receive the report ???


    BR!
  • Try to add cluster ID used in your ZCL send report command to out cluster list of receiver side.

  • it does not work。

    do you mean that add the cluster ID in the zclxxxx_data_c file


    const cId_t zclxxxxxx_OutClusterList[ZCLxxxxxxx_MAX_OUTCLUSTERS] =
    {
    ZCL_CLUSTER_ID_GEN_IDENTIFY,
    ZCL_CLUSTER_ID_CLOSURES_DOOR_LOCK
    };
  • Try to set a breakpoint on zcl_ProcessMessageMSG in zcl_event_loop and see if it hits.
  • i have set  a break point here, but it never  stop  here  although there is a report , and  it feedback a Ack

      

  • Hi Yikai , it is the endpoint problem, i have set a wrong endpoint that it could not transmit the report data to the application
  • That's not what I suggest. Set a breakpoint on zcl_ProcessMessageMSG(...) in zcl_event_loop(...).