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.

Can't receive Interpan messages

Other Parts Discussed in Thread: Z-STACK

Hi All,

Does anyone have an example of an Interpan application, using GenericApp?

In Texas Instruments Sniffer i see the packeges been sending in Interpan channel (0x18) but i didnt receive in the enddevice .

I read the Z-Stack Developer's Guide and compile the Z-Stack with INTER_PAN option and added the files in both sides of the network.

In GenericApp_Init  of both applications i added this functions

  StubAPS_RegisterApp( &GenericApp_epDesc );

  StubAPS_SetInterPanChannel( 0x18 );

 

  GenericApp_INTERPAN(); // only in app for sending

and the function 

/*********************************************************************

 * @fn      GenericApp_SendTheMessage

 *

 * @brief   Send "the" message.

 *

 * @param   none

 *

 * @return  none

 */

void GenericApp_INTERPAN( void )

{

// GenericApp_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;

 //GenericApp_DstAddr.addr.shortAddr = 0x0000;

  GenericApp_DstAddr.addrMode = (afAddrMode_t)AddrBroadcast;

  GenericApp_DstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR; 

  GenericApp_DstAddr.endPoint = STUBAPS_INTER_PAN_EP;

  GenericApp_DstAddr.panId = 0x6666;

 

 

  char theMessageData[] = "666666";

  valorEnv++;

  if ( AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,

                       GENERICAPP_CLUSTERID,

                       (byte)osal_strlen( theMessageData ) + 1,

                       (byte *)&theMessageData,

                       &GenericApp_TransID,

                       AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )

  {

    // Successfully requested to be sent.

  //  HalLcdWriteStringValue( "Pongs ENV", valorEnv, 10, HAL_LCD_LINE_1 );

  }

  else

  {

    // Error occurred in request to send.

  }

}

 

 

Thanks

  • I´m having the same problem.

    I´m using this function to send a inter-pan:

    void GenericApp_INTERPAN( void )
    {
     
      /*
      *  INTERPAN
      */
      StubAPS_SetInterPanChannel( 0x19 );
     
      uint8 buffadd[8] = {0xF3,0x22,0x07,0x01,0x00,0x4B,0x12,0x00}; // Router IEEE MAC address
      GenericApp_DstAddr.addrMode = afAddr64Bit;
      GenericApp_DstAddr.endPoint = STUBAPS_INTER_PAN_EP;
      //GenericApp_DstAddr.endPoint = GENERICAPP_ENDPOINT;
      (void)osal_memcpy(GenericApp_DstAddr.addr.extAddr, buffadd, Z_EXTADDR_LEN);
      GenericApp_DstAddr.panId = 0x6666;
     
      char theMessageData[] = "0";
      valorEnv++;
     
      if ( AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,
                           GENERICAPP_CLUSTERID,
                           (byte)osal_strlen( theMessageData ) + 1,
                           (byte *)&theMessageData,
                           &GenericApp_TransID,
                           AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
      {
        // Successfully requested to be sent.
        if (StubAPS_InterPan(6666, STUBAPS_INTER_PAN_EP))
        {
          HalLcdWriteStringValue( "InterPan Env", valorEnv, 10, HAL_LCD_LINE_1 );
        }
      }
      else
      {
        // Error occurred in request to send.
      }
      StubAPS_SetIntraPanChannel();
    }

    I have a coordinator unsing this function that occurs when I push the button, and this coordinator is in a PAN diferent than the router (Router is in a PAN 6666), I have a coordinator to PAN 6666.

    I can see the msg sent with a sniffer, but when I debug my router it didn´t generate an event.

     

    thx for any help!

     

    Regards,

    Diego - PRAEX

  • Hi Diego,

    i still have the same problem...

    no answer from texas instrument.

    maybe Interpan is an legend.

    waiting for an answer too..

    Regards,

     

     

  • Hi all

     

    I´m having  problem in receive inter_pan messages, can anyone explain how to config the stack to receive inter_pan messages?

    If someone have a diferent document  that explain step by step inter_pan communication or a source code example please post in  this forum.

     

    Regards JVELL

  • Hi JVELL,

    we tested the Interpan at it seems to work only point-to-point, no message routing...

    Don´t know why this happened.

    Texas should really make an revision of the documentations that tell about the Interpan and do an Application Notes about it.

    Regards

  • Hi Niederheitmann:

    I have the same problem.  You said you can work point-to-point. But I can not recieve the packet at all. How can you do that? Would you paste the code and have some explain? Even the point-to-point communication is helpful for us.

  • Hi Chen,

     

    ·         Add “stub_aps.c” and “stub_aps.h” files in the NWK directory of your project. You can locate these files in “ZStack-XXXX\Components\stack\nwk”.

    ·         Include “stub_aps.h” in “GenericApp.c” and “OSAL_GenericApp.c” (“#include "stub_aps.h"”)

    ·        In “OSAL_GenericApp.c” add the red lines:

     

    const pTaskEventHandlerFn tasksArr[] = {

      macEventLoop,

      nwk_event_loop,

      Hal_ProcessEvent,

    #if defined( MT_TASK )

      MT_ProcessEvent,

    #endif

      APS_event_loop,

    #if defined ( ZIGBEE_FRAGMENTATION )

      APSF_ProcessEvent,

    #endif

      ZDApp_event_loop,

    #if defined ( ZIGBEE_FREQ_AGILITY ) || defined ( ZIGBEE_PANID_CONFLICT )

      ZDNwkMgr_event_loop,

    #endif

      GenericApp_ProcessEvent,

      StubAPS_ProcessEvent

    };

     

    void osalInitTasks( void )

    {

      uint8 taskID = 0;

     

      tasksEvents = (uint16 *)osal_mem_alloc( sizeof( uint16 ) * tasksCnt);

      osal_memset( tasksEvents, 0, (sizeof( uint16 ) * tasksCnt));

     

      macTaskInit( taskID++ );

      nwk_init( taskID++ );

      Hal_Init( taskID++ );

    #if defined( MT_TASK )

      MT_TaskInit( taskID++ );

    #endif

      APS_Init( taskID++ );

    #if defined ( ZIGBEE_FRAGMENTATION )

      APSF_Init( taskID++ );

    #endif

      ZDApp_Init( taskID++ );

    #if defined ( ZIGBEE_FREQ_AGILITY ) || defined ( ZIGBEE_PANID_CONFLICT )

      ZDNwkMgr_Init( taskID++ );

    #endif

      GenericApp_Init( taskID++ );

      StubAPS_Init( taskID );

    }

     

    ·         In “GenericApp.c” in function “void GenericApp_Init( byte task_id )” add:

    // Fill out the endpoint description.

    GenericApp_epDesc.endPoint = GENERICAPP_ENDPOINT; 

    GenericApp_epDesc.task_id = &GenericApp_TaskID;

    GenericApp_epDesc.simpleDesc = (SimpleDescriptionFormat_t *)&GenericApp_SimpleDesc;

    GenericApp_epDesc.latencyReq = noLatencyReqs;

     

    // INTERPAN - Register the endpoint description for INTERPAN

    StubAPS_RegisterApp( &GenericApp_epDesc );

    // Register the endpoint description with the AF

    afRegister( &GenericApp_epDesc );

     

    To send an menssage

    void GenericApp_INTERPAN( void )

    {

      /* Seleciona do canal do interpan */

      StubAPS_SetInterPanChannel( 0x19 );

     

      /* Buffer com o IEEE MAC Address, cria-se o buffer de traz pra frente */

      uint8 buffadd[8] = {0xF3,0x22,0x07,0x01,0x00,0x4B,0x12,0x00};

     

      /* Definições do modo de envio, com endereço 64bit e endpoint INTERPAN */

      GenericApp_DstAddr.addrMode = afAddr64Bit;

      GenericApp_DstAddr.endPoint = STUBAPS_INTER_PAN_EP;

     

      /* Copia o buffer para o endereço do destino */

      (void)osal_memcpy(GenericApp_DstAddr.addr.extAddr, buffadd, Z_EXTADDR_LEN);

     

       /* PAN de destino */

      GenericApp_DstAddr.panId = 0x6666;

     

       /* Mensagem */

      char theMessageData[] = "0";

      valorEnv++;

     

       /* Envio */

      if ( AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,

                           GENERICAPP_CLUSTERID,

                           (byte)osal_strlen( theMessageData ) + 1,

                           (byte *)&theMessageData,

                           &GenericApp_TransID,

                           AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )

      {

        /* Verifica se a aplicação INTERPAN foi enviada */

        if (StubAPS_InterPan(6666, STUBAPS_INTER_PAN_EP))

        {

          HalLcdWriteStringValue( "InterPan Env", valorEnv, 10, HAL_LCD_LINE_1 );

        }

      }

      else

      {

        // Error occurred in request to send.

      }

       /* Volta o canal para IntraPAN */

      StubAPS_SetIntraPanChannel();

    }

  • Hi Niederheitmann:

    Thanks a lot.

    I have tried several days and found the same solution in the TI's Smart Energy codes. Yes we should init the Stub_APS task in the init list. However the developer's guide forget to tell us this step. It is not easy to find the problem.

    After all, the result seems not so bad. The Inter-PAN can also be used for broadcast, by setting the PANID 0xFFFF and dstination address "Broadcast". We found it useful.

    Thanks for you help. The reply is detailed.

  • hi, I am trying with the same code and setup Coordinator A (PanID = 0x7777 Channel = 0x0B) and Coordinator B (PanID = 0x6666 Channel = 0x0B),  A periodically sending inter pan packet to B. I found when A & B is in same channel, the communication is successful, however when I set Coordinator A to channel 0x0C, Coordinator B can't receive the inter pan packets. with the sniffer, I found Coordinator A just sending the inter pan packets in it's own channel, not the channel for inter pan communication, though I called the '  StubAPS_SetInterPanChannel( 0x0B );' in Coordinator A's firmware.

    does any one can help with this issue ?

  • Hi  

         I just meet the same question as you says.So I doubt if  this way of usage is  correct.does  anyone can answer this question?