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.

CC2530 HA Sampleswitch -ZCL Default Command



Hi Guys, i am trying to use the SampleSwitch TI example, i'll call that as MyDevice,  as a Ligth Switch togther a commercial gateway (from Mstartech)

I can see that after the the ZCL Command On/OFF my device didnt answer with ZCL Default Response. I trying to debug it but i can`t do it without an auxiliary code.

Do you can see below that the ZCL on/off was send and after it we can just see the MAC Layer mesage (802.15.4) response!

Somene had this problem?

  • If you intend to send ZCL on/off command from GW to device, you should use SampleLight as device not SampleSwitch.
  • Hi Mr Yikai,

    Thanks a lot for your assistance. But i was change to the SampleLight and than i have the same problem, my Device didn't send the feedback ZCL Default Responde. I Saw a few parameters on the ZCL on/off command, probably defined in my commercial GW,  and than i think that it have an effect on the SampleLight code. 

    Parameter sent in the ZCL on/off (I saw it on the Protocol Analyzer):

    Destination EndPoint: 10

    Source EndPoint: 10

    The ZCL on/off CMD from Commercial GTW:

    I have see on the SampleLight Code, in the zcl_samplelight, the follow code. i have uncoment those 3 lines and change those parameters values, i think that it probably have a relationship with ZCL On/Off CMD, below you can see those parameters values, original and the changes that i made.

    // Set destination address to indirect ///
    zclSampleLight_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;0 
    zclSampleLight_DstAddr.endPoint = 0;
    zclSampleLight_DstAddr.addr.shortAddr = 0;

    from zclSampleLight_DstAddr.endPoint = 0; to zclSampleLight_DstAddr.endPoint = 10;

    zclSampleLight_DstAddr.addr.shortAddr=0; to  zclSampleLight_DstAddr.addr.shortAddr = 10;

    But during the compile process, on the IAR8051, I have a problem, i need to declare those 3 parameters (zclSampleLight_DstAddr.addrMode, zclSampleLight_DstAddr.endPoint, zclSampleLight_DstAddr.addr.shortAddr)  but I dindt know how to do that!

    Would you can help me to declare and fix it? Please!

    BR

    Alex

     

  • I am confused by your question. If this commercial Zigbee works correctly, it should request active endpoint and simple descriptor of SampleLight and send ON/OFF coomand to correct endpoint. You don't have to change anything on SampleLight.
  • Hi Mr Yikai.
    I have two commercial devices, the 1st is the GW and 2st is a light switch booth from Mstartech. I working on my Device (at this time based on TI HA SampleLight), and i trying to use it as ligth switch instead of the commercial ligth switch. Because it i compared in all the time, via protocol analyzer, my Device with the comercial Light Switch.
    Apologize for not having understood me!

    As i trying to told you, I wrote in the simple descriptor of SampleLight the correct SRC and DEST (10), that i was see via Protocol when compared with the commercial devices, but during the compile procedure the IAR was request to declare the variables, but I do not know how to do! Would you help me, please?
  • Can you copy and paste what errors you see on IAR?
  • Hi Mr Yikai. I understood right now you adivise about the "verify my answer" I'll use it! Tks.

    In additional about your last question, after i have uncoment, in the Simple Descriptor, the follow lines below, i got those IAR errors:

    // Set destination address to indirect /// Original EndPoint -> 0, ShortAddr ->0 wrote by ASA
    zclSampleLight_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
    zclSampleLight_DstAddr.endPoint = 10;
    zclSampleLight_DstAddr.addr.shortAddr = 10;

      

  • There is a line "afAddrType_t zclSampleLight_DstAddr;" in original zcl_sampleLight.c. Do you remove it? If so, please add it back in LOCAL VARIABLES define section like the followings:

    /*********************************************************************
    * LOCAL VARIABLES
    */
    afAddrType_t zclSampleLight_DstAddr;
  • Hi Mr Yikai.

    Thanks, you were right! I have uncoment the line and right now the IAR was compile well. 

    But the sample descriptor changes alone had not effect! Maybe i need to check if the ZCL on/off CMD was triggered in the first treatment procedure.

    Would you suggest me please, how to include debugs imputs to make an inspector on ZCL incomming messages (zclSampleLight_ProcessIncomingMsg):

    >>>> part of the code >>>>>>

    static void zclSampleLight_ProcessIncomingMsg( zclIncomingMsg_t *pInMsg)
    {
    switch ( pInMsg->zclHdr.commandID )
    {
    #ifdef ZCL_READ
    case ZCL_CMD_READ_RSP:
    zclSampleLight_ProcessInReadRspCmd( pInMsg );
    break;

  • I suppose you can set a breakpoint in zclSampleLight_ProcessIncomingMsg to debug it.
  • Hi Mr Yikai,

    in the lest week I tried to find the specific point in the ZCL incoming messages, some case during the debug starting process i receiving the message that is imposible to run and in the other i had success to starting, but in the same cases i cant see nothing. But in my last debug I saw that:

    When the variable was reached (event & SYS_Event_Msg) my device was stop to answer acknowledge and because it my commercial GTW sending a lot of ZCL:PW_ON (messages 4532-4642). As you can see below:

    I think that its happen because my breakpoint, would you can advise me please, how to make it effective to see the first and last point, in the code, that I can see the ZCL default response message?

  • The GW sends a lot of ZCL onoff command is because that there is no MAC ack and GW does retry sending.