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.

CC2538: Receive Inter-Pan messages

Part Number: CC2538
Other Parts Discussed in Thread: CC2652R, Z-STACK

I am trying to implement interpan communication between a coordinator(cc2538 with zstack 3.0.2) which has the ota dongle example and a router that has the generic example(cc2652R with latest sdk). I send the message from the router and I can see it in the packet sniffer but the coordinator does not receive it. What do I have to do to make it work?

A screenshot of the packet:

The router code:

    if(_btn == gRightButtonHandle)
    {
        zstack_getZCLFrameCounterRsp_t pRsp;
        Zstackapi_getZCLFrameCounterReq(appServiceTaskId, &pRsp);


        StubAPS_SetInterPanChannel(0x0F);


        dstAddr.addrMode= afAddrBroadcast;
        dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR_DEVALL;
        dstAddr.endPoint = STUBAPS_INTER_PAN_EP;
        dstAddr.panId = 0xFFFF;

        static uint8_t inter_msg[] = {"HELLO, WORLD!"};

        if(AF_DataRequest(&dstAddr,
                          &zclGenericAppEpDesc,
                          0x0000,
                          sizeof(inter_msg),
                          inter_msg,
                          &(pRsp.zclFrameCounter),
                          AF_DISCV_ROUTE,
                          AF_DEFAULT_RADIUS) == afStatus_SUCCESS )
        {

        }
        else{
            StubAPS_SetIntraPanChannel();
        }
        //Zstackapi_bdbResetLocalActionReq(appServiceTaskId);
    }

  • Hi Panagiotis,

    You can read more about Inter-PAN Transmission from Section 18 of the Z-Stack 3.0 Developer's Guide located in Z-Stack 3.0.2\Documents.  Note that INTER_PAN must be defined (not the default) and messages are received through AF_INCOMING_MSG_CMD with DstEndPoint equal to STUBAPS_INTER_PAN_EP.  The ZC's network should be formed, and you can also evaluate sending an interpan message which matches the destination's PAN ID instead of a broadcast.  If you experience more difficulty, please provide further debug information from your CC2538 ZC.

    Regards,
    Ryan

  • I formed the ZC's network, I also sent an interpan message which matches the destination's PAN ID but I still can't receive it. In ZC I have added StubAPS_RegisterApp( &ota_DongleEp );  in OTA_Dongle_Init( byte task_id );, I also added StubAPS_ProcessEvent and StubAPS_Init in OSAL_OTA_Dongle.c and I have defined INTER_PAN . Am I missing something that I haven't added?

    New packet sniffer screenshot:

    New code:

        if(_btn == gRightButtonHandle)
        {
            zstack_getZCLFrameCounterRsp_t pRsp;
            Zstackapi_getZCLFrameCounterReq(appServiceTaskId, &pRsp);
    
    
            StubAPS_SetInterPanChannel(0x0F);
    
    
            dstAddr.addrMode= (afAddrMode_t)Addr16Bit;
            dstAddr.addr.shortAddr = 0x0000;
            dstAddr.endPoint = STUBAPS_INTER_PAN_EP;
            dstAddr.panId = 0x0014;
    
            static uint8_t inter_msg[] = {"HELLO, WORLD!"};
    
            if(AF_DataRequest(&dstAddr,
                              &zclGenericAppEpDesc,
                              0x0000,
                              sizeof(inter_msg),
                              inter_msg,
                              &(pRsp.zclFrameCounter),
                              AF_DISCV_ROUTE,
                              AF_DEFAULT_RADIUS) == afStatus_SUCCESS )
            {
    
            }
            else{
                StubAPS_SetIntraPanChannel();
            }
        }
    

  • I identified the problem. I had accidentally enabled all channels in f8wConfig.cfg. Now that I set up only one channel it works.

    Thank you for the help!

  • I have a question. If I set the InterPan channel the same as the one the in the IntraPan channel, do I need to call StubAPS_SetIntraPanChannel(); after AF_DATA_CONFIRM; Because I don't call it and everything works

  • StubAPS_SetInterPanChannel changes the device's channel for inter-PAN communication, StubAPS_SetIntraPanChannel sets the device's channel back to the NIB channel.  If you never need to change channels for inter-PAN communication then these functions do not need to be called.

    Regards,
    Ryan

  • Ok great. Also is the range of interpan smaller than intrapan? I have set a ZR to send interpan reports every 10 seconds but the interpan ZC misses some of them. When I send them to the network's coordinator, it sends them all

  • Setting the interpan channel does not change transmission output power.  Is the ZC MAC ACKing the interpan message?  How many retries is the ZR attempting?  You could try enabling APS ACKs so that the ZC responds with a message which can be confirmed by the ZR, otherwise choose to send the message again.

    Regards,
    Ryan

  • I will enable APS ACK. Thank you for the help!!!