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.

CC1352R: Sending broadcast generic data trough Zigbee

Part Number: CC1352R
Other Parts Discussed in Thread: AES-128, Z-STACK

Hi All,

I recently started the development of a bluetooth and zigbee application using TI DMM. 
For the setup I have the following:
3 CC1352R launchpads: 

  • one configured as sniffer - using Ubiqua protocol analyzer, I have set up the network key, and started the protocol analyzer before the boards in the network.
  • one running the "dmm_zr_light_remote_display_oad_app_CC1352R1_LAUNCHXL_tirtos_ccs" 
  • one running the "dmm_zc_switch_remote_display_oad_app_CC1352R1_LAUNCHXL_tirtos_ccs" modified with a callback that is triggered after commisioning by a BLE packet:
    Added in zcl_samplesw.c
    uint8_t EP = 0;
    uint8_t transID = 0;
    uint8_t theMessageData[]={"\0\0\30Hello World"};
    
    //@TST
    static void tstCallback(){
    
        zstack_getZCLFrameCounterRsp_t pRsp;
        Zstackapi_getZCLFrameCounterReq(appServiceTaskId, &pRsp);
    
        theMessageData[1] = transID++;
    
           zstack_afDataReq_t pReq;
           pReq.dstAddr.addrMode = zstack_AFAddrMode_BROADCAST;
    //       pReq.dstAddr.addr.shortAddr = 0x6c1c; //Not needed for BROADCAST?
           pReq.dstAddr.endpoint = 0xFF;
           pReq.pRelayList = NULL;
           pReq.n_relayList = 0;
           pReq.srcEndpoint = 0xFF;
           pReq.clusterID = ZCL_CLUSTER_ID_LIGHTING_BALLAST_CONFIG;
           pReq.transID = &(pRsp.zclFrameCounter);
           pReq.options.ackRequest = FALSE;
           pReq.options.apsSecurity = FALSE;
           pReq.options.limitConcentrator = FALSE;
           pReq.options.skipRouting = FALSE;
           pReq.options.suppressRouteDisc = FALSE;
           pReq.options.wildcardProfileID = FALSE;
           pReq.radius = AF_DEFAULT_RADIUS;
           pReq.n_payload = sizeof(theMessageData);
           pReq.pPayload = theMessageData;
    
        zstack_ZStatusValues rsp = Zstackapi_AfDataReq(appServiceTaskId, &pReq);
        
    }


    However I face the following problems:
    The Ubiqua protocol analyzer, and as well Wireshark cannot Decrypt the packet, I triple checked the TC key in the app and is the same as the default key and the key I put in Wireshark and Ubiqua.
    Even so when the callback is called, there is no new message on the network, I cannot see any new packet that is consistent with me triggering the callback, other packets are seen when commisioning and from time to time. When looking at the rsp value it is 0,indicating that the transmission was sucessfull?


    Do you have any ideas why the protocol analyzers do not work? Also what I am doing wrong when sending a broadcast message?

    PS: I am using the 4.20.01.04 CC13X2 26x2 SDK

    Thank you!

  • Try to refer to Packet Sniffer section to use Ubiqua or Wireshark to sniff Zigbee traffic.

  • Hi! 

    The sniffing problem was solved by setting the following on Wireshark: AES-128 Encryption, No Integrity Protection on the Zigbee Network Layer 
    Tab. In the article you send it is set to :AES-128 Encryption, 32-bit Integrity Protection.  Now wireshark does no longer report decryption issues.

    I also managed to send data using the following structure: 

                zstack_getZCLFrameCounterRsp_t pRsp;
                Zstackapi_getZCLFrameCounterReq(appServiceTaskId, &pRsp);
    
                theMessageData[1] = transID++;
    
                zstack_afDataReq_t pReq;
                pReq.dstAddr.addrMode = zstack_AFAddrMode_BROADCAST;
                pReq.dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR_DEVALL;
                pReq.dstAddr.endpoint = EP;
                pReq.pRelayList = NULL;
                pReq.n_relayList = 0;
                pReq.srcEndpoint = SAMPLELIGHT_ENDPOINT;
                pReq.clusterID = 0xF00D;
                pReq.transID = &(pRsp.zclFrameCounter);
                pReq.options.ackRequest = FALSE;
                pReq.options.apsSecurity = TRUE;
                pReq.options.limitConcentrator = FALSE;
                pReq.options.skipRouting = FALSE;
                pReq.options.suppressRouteDisc = FALSE;
                pReq.options.wildcardProfileID = FALSE;
                pReq.radius = AF_DEFAULT_RADIUS;
                pReq.n_payload = sizeof(theMessageData);
                pReq.pPayload = theMessageData;
    
                Zstackapi_AfDataReq(appServiceTaskId, &pReq);

    taken from the Zigbee Fundamental Project Development (plus setting the address to broadcast), however when pressing the right button of the launchpad I immediately see 2 Zigbee packets, however there is no "Hello World" String in the data, see the snipping below:



  • I cannot see your attached picture.

  • Can you try again? I have re-uploaded it

  • Also please see an attached startup of the 2 boards using ubiqua, and the configured keys

  • Can you attach your sniffer log instead of screenshot?

  • Sure,

    Here is the startup + the 2 packets that are sent when pressing the button (12 and 13).
    ubiqua_startup.zip

  • I cannot decrypt your sniffer log. Can you join the device from scratch to test again with sniffer to sniff all the packet and attach the new sniffer log so I can get network key correctly?

  • That is the sniffer log when keeping the devices in reset until ubiqua starts and then releasing reset.

    Also now I made the following setup:
    one board runs zc_light_CC1352R1_LAUNCHZL_tirtos_CCS and the other runs zr_sw_CC1352R1_LAUNCHZL_tirtos_CCS with no modifications (as they come with the stack).
    I kept both devices in reset and started Ubiqua then released reset. ubiqua_startup_defaultFw.zip

  • There is no association and key exchange process in your sniffer log. Please do factory reset to both ZC and ZR to test and do sniffer log to attach it again.

  • I have erased the flash on both devices, reloaded the firmware for both and kept them in reset until ubiqua starts.
    Then I selected commision for both devices. The Light toggle works from both.
    ubiqua_new_commission.zip

  • I don't see key exchange in your sniffer log. I think you don't do factory reset before you test this. Please make sure you do factory reset on your ZC and ZR to test and provide sniffer again.

  • Hi!

    I have found the problem, for a correct setup I had to do the following:

    Reset both boards using the "Reset to FN" option in the serial menu.
    Then after that press commsison on both devices using the serial menu. Then sending messages work. 
    I guess the problem was that I did not try to erase the flash/ reset to FN. Maybe the Z-Stack saves some values to the FLASH?


    Thank you for your support!