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.

LAUNCHXL-CC26X2R1: No router response at AF commands 2

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: SYSCONFIG, Z-STACK

This is a direct continuation of this thread: LAUNCHXL-CC26X2R1: No router response at AF commands - Zigbee & Thread forum - Zigbee & Thread - TI E2E support forums

I have set ZCL_CLUSTER_ID_GENERAL_ON_OFF as an input and output cluster now.

I also have disabled Green Power as it has no use and have added bdb commitioning and it does the binding automaticaly.

 I have added in the zclSampleSw_processAfIncomingMsgInd function the following lines:

if(afMsg.cmd.DataLength==3 && afMsg.clusterId == 0x06){
zclSampleSw_DstAddr.addrMode = afMsg.srcAddr.addrMode;
zclSampleSw_DstAddr.endPoint = afMsg.endPoint;
zclSampleSw_DstAddr.addr.shortAddr = afMsg.srcAddr.addr.shortAddr;
Zstackapi_getZCLFrameCounterReq(appServiceTaskId, &rsp);
zclGeneral_SendOnOff_CmdToggle( SAMPLESW_ENDPOINT, &zclSampleSw_DstAddr, 0, rsp.zclFrameCounter );

so when I toggle relay from ZR the LED in ZC turns on but I still don't get a response that it did receive the command and turned on the LED.

This appears to be a problem only on AF commands, for example I always get responses from ZDO commands

  • Hello Panagiotis,

    You've set the disableDefaultRsp parameter of zclGeneral_SendOnOff_CmdToggle to zero and thus should be receiving a Default Response from the ZC light.  Does zclSampleSw_ProcessIncomingMsg never enter zclSampleSw_ProcessInDefaultRspCmd?  You could also send a Read Attribute Command or enable device reporting, more information for which is provided in the Zigbee Fundamentals SLA.  Please provide sniffer logs if possible.

    Regards,
    Ryan

  • Hi Ryan,

    It does enter zclSampleSw_ProcessInDefaultRspCmd but I don't know how to modify it to send a response. Could you please provide an example?

    I have followed Zigbee Fundamental Project Development without PART 2 and removed the code that referenced the custom variables so as to not trigger an error

    Could you elaborate further on how and where can I send a Read Attribute Command?

    I would like to further explain how communication is made inside the custom application that I am using:

    1. I press Toggle Relay from ZR

    2. A command (AF Data Request) is sent from ZC to ZR to turn ZCS' LED on

    3. ZR turns on ZCs' LED but doesn't send a response to Data Request

  • It's confusing in your steps and descriptions for you application. In step 1, you press Toggle Relay from ZR but A command (AF Data Request) is sent from ZC to ZR to turn ZCS' LED on in steps2. Do you mean A command (AF Data Request) is sent from ZR to ZC to turn ZCS' LED on in step2?

  • Hi YiKai,

    An AF command is indeed sent from ZR to ZC. It happens between steps 2 and 3. I have attached screenshots that show the commands that the app registers and their individual details. These are the commands that are sent from ZC to ZR. zclGeneral_SendOnOff_CmdToggles' structure does have an af data request but it does not show in the app neither its response, 

  • According to your screenshots, it is ZC sending on/off command to ZR with relay and then ZC sends read attribute to ZR to collect on/off status. Do I understand this correctly? If yes, what's your issue?

  • Yes you are right. My issue is that I don't get a response message even thought it turns on ZCs' LED.

    I want responses that look like this:

    The blue lines are the responses and as you saw in the previous screenshot that I sent, there weren't any responses 

  • Do you have sniffer log when you send on/off command and read on/off attribute?

  • I haven't been able to make PACKET SNIFFER 2 work. I have followed the instructions provided by TI but it doesn't seem to work.

    The closest that I can do is the logging feature in my app which sends this:

    AF_DATA_REQUEST_RSP({'SrcAddr': 0xeef4, 'ClusterId': 6}) timed out after 5.002s (unmatched against 0 packets)

  • I cannot judge anything without sniffer log. I suggest you to setup sniffer again to check this issue.

  • While I am trying to get the sniffer running could you please answer the question that I asked Ryan?

    "It does enter zclSampleSw_ProcessInDefaultRspCmd but I don't know how to modify it to send a response. Could you please provide an example?"

  • I couldn’t understand why you need to send a response in zclSampleSw_ProcessInDefaultRspCmd?

  • Are you trying to notify your app of the zclSampleSw_ProcessInDefaultRspCmd?  MT_AF_CB_FUNC may not be defined, thus AF incoming messages will not be transported by the MT layer.  Also, your app log indicates that default responses are disabled (frame control equals 0x10).

    Regards,
    Ryan

  • MT_AF_CB_FUNC is defined.

    I would like to add that now I run zc_sw and zr_light which is the opposite of what I used to run (zc_light and zr_sw). I did it so it would make more sense from the app that I use.

    Because of this change I will explain anew how the whole thing is run and what I want out of it. Please disregard any previous info or code

    1. I press toggle relay from the ZR (light)

    2. An af data request is sent from ZC (switch) to ZR

    3. ZR led is turned on

    In the zclSampleLight_processAfIncomingMsgInd function I added the following code in order for the toggle relay from step 1 to work

    if(afMsg.cmd.DataLength==3 && afMsg.clusterId == 0x06){

    zclSampleLight_OnOffCB( COMMAND_ON_OFF_TOGGLE );

    }

    What I want is step 4 (the code up until step 3 works)

    4. ZR sents a response to ZC indicating that af data request was succesfull

    I am very sorry for the hassle, I am new to Zigbee

  • This is setting AF_ACK_REQUEST for the ZCL_CLUSTER_ID_GENERAL_ON_OFF options, as explained in the End-to-End Acknowledgements section of the Z-Stack User's Guide and demonstrated in Task 2 of the Zigbee Fundamental Project Development SLA.

    Regards,
    Ryan

  • I have some questions:

    1. Where should I configure the end-to-end acknowledgements, zc_sw, zr_light or both?

    2. What should I do inside "if" in this code segment? Could you provide an example?

    case zstackmsg_CmdIDs_AF_DATA_CONFIRM_IND:
    {
      zstackmsg_afDataConfirmInd_t *pInd =
      (zstackmsg_afDataConfirmInd_t *) pMsg;
      if(savedAPSCount == pInd->req.transID)
      {
        // PERFORM ACTION HERE
      }
    }
    break;

    Also I would like to add that I am using MT interface.
  • And when I press toggle relay in ZC, the code runs through MT_AfDataRequest

  • 1. Enabling APS ACKs Request bits is most important on the zc_sw since you are sending on/off commands from this device.  Enabling on the zr_light is not usefulunless you are reporting the on/off attribute like with the SLA.

    2. That code is only required if you desire additional APS ACK processing from your application, otherwise retries are already performed based on APS Retries/APSC_MAX_FRAME_RETRIES from SysConfig/ti_zstack_config.h, respectively.  Since you have enabled MT then you should receive a AF_DATA_CONFIRM MT_AF callback on your host.

    Regards,
    Ryan

  • To summarize:

    zc_sw: I have implemented enabling APS ACKs Request bits by following the guide from the Z-Stack User Guide that you sent me

    zr_light: The only code that I have added is the one that I mentioned before at zclSampleLight_processAfIncomingMsgInd

    So from your 2nd answer the only code that I actually want are the first and third dots from the end-to-end guide?

    It doesn't enter MT_AfDataConfirm at all. It enters afDataConfirm in zr_light but when it reaches the if statement that MT_AfDataConfirm resides, it skips it. MT_AF_CB_FUNC is defined

  • static zclOptionRec_t zclSampleSw_ZCL_Options[] = {ZCL_CLUSTER_ID_GENERAL_ON_OFF, AF_ACK_REQUEST };
    zcl_registerClusterOptionList( SAMPLESW_ENDPOINT, 1, zclSampleSw_ZCL_Options );

    I would expect you to debug zc_sw, not zr_light, since AF ACK requests should be enabled from the switch application in your setup.

    Regards,
    Ryan

  • I debugged zc_sw and noticed two things

    1. At af data request, options has a value of 0. Shouldn't it have 0x10 because of AF_ACK_REQUEST?

    I added options = AF_ACK_REQUEST; at the beggining of af data request so it would enter this part

    if ( ( options & AF_ACK_REQUEST ) &&
    ( req.dstAddr.addrMode != AddrBroadcast ) &&
    ( req.dstAddr.addrMode != AddrGroup ) )
    {
    req.txOptions |= APS_TX_OPTIONS_ACK;
    }

    I don't know if what I did was right so I would like some clarification on this.

    2. After af data request, the code goes to af data confirm. Again it wouldn't enter mt af data confirm so I removed the if statement and after that it started sending af_register_rsp to itself at all af commands with an endpoint=9 and zdo with an endpoint=0. Also on af commands it responds multiple times. Also 

    there is a different transID counter in af responses from af and zdo commands. If I don't send anything it keeps sending responses every 10 seconds

    #if defined ( MT_AF_CB_FUNC )
        /* If MT has subscribed for this callback, don't send as a message. */
    //    if ( AFCB_CHECK(CB_ID_AF_DATA_CNF,*(epDesc->task_id)) )
       // {
          /* Send callback if it's subscribed */
          MT_AfDataConfirm ((void *)msgPtr);
          /* Release the memory. */
          OsalPort_msgDeallocate( (void *)msgPtr );
       // }
      //  else
    #endif
       // {
          /* send message through task message */
         // OsalPort_msgSend( *(epDesc->task_id), (uint8_t *)msgPtr );
       // }

  • 1. APS_TX_OPTIONS_ACK would be set only for ZCL messages from the cluster for which AF_ACK_REQUEST was designated with zcl_registerClusterOptionList, and if broadcast/groupcast addressing is not used.

    2. Make sure that you are not registering the ZDO endpoint from your application, that is done by the internal Z-Stack libraries.  You should use AF_REGISTER for the endpoint from which you are sending/receiving ZCL commands (i.e. 9).  Please be sure to replace the code you've removed.

    Regards,
    Ryan

  • 2. The only place that an endpoint is registered is at zclSampleSw_Init

      //Register Endpoint  
      zclSampleSwEpDesc.endPoint = SAMPLESW_ENDPOINT;
      zclSampleSwEpDesc.simpleDesc = &zclSampleSw_SimpleDesc;
      zclport_registerEndpoint(appServiceTaskId, &zclSampleSwEpDesc);

    I still don't get any responses. 

    When I press toggle relay in the zc_sw, code passes from zclSampleSw_processAfIncomingMsgInd, which means that zr_light sends something back but the app doesn't catch it.

    Also I don't know if I have mentioned it before but the app reads the communication that happens through the UART

  • Therein lies the problem, since this endpoint is registered by the local application with its appServiceTaskId entity, messages will not be passed to the MT_TaskID.  This is as an attempt to prevent two applications (MT host and local) from controlling the same endpoint.  The MT cannot subscribe to the command for this endpoint since it is handled elsewhere.  This is one reason the MT interface is best for the ZNP project and not ideal concerning ZCL applications.

    Regards,
    Ryan

  • I managed to fix it by putting MT_AfIncomingMsg(&afMsg); at the end of zclSampleSw_processAfIncomingMsgInd.

    Thank you for the help!!!