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.

Trying to set up End(CC2530) to End(CC2430) Device Wireless Link using SimpliciTI-IAR-1.1.1 code

Other Parts Discussed in Thread: CC2530, CC2430, SIMPLICITI

I have CC2430 as one End Device and other End Device is CC2530. I am trying to understand how the SimpliciTI  protocol works.

So I have "SMPL_LINK" on talker device (CC2530) and I have "SMPL_LINKLISTEN" on listener side (CC2430). By reading the document I understand that when it tried to set up link at first. Each End device will send each own link ID to each other and they remember and once after the link is set up they try to send and receive packet based on the link Id they received initially during the link setup. (Now I don’t understand here is this Link ID is zig bee address....? ) Also in the manual I saw its recommended to setup "THIS_DEVICE_ADDRESS" what is this used for.....? is it necessary to implement.....???? is this default address at beginning..

 

Now to my understanding once the link is setup. than both the end device will communicate only to each other and no other wireless device can interfere or nor they will interfere... this case is true until the one of the device is powered down. Once its powered down it will lose its link ID n application has to reinitiate the link... is this case correct... no in this scenario where does "THIS _DEVICE_ADDRESS" fall...?

Any help or suggestion would be appreciated.

Thanks!!!

  • Hi Aarti,

    you are right with the link setup phase,

    Ad LinkID: SimpliciTI Specification, page 13:

    "The Ports are mapped by the network layer to Link IDs which are handles provided to the customer application when a link or link-listen succeeds. The application then uses this handle when messages are sent or received."

    It's just an internal ID representing the link in the internal connection table of the NWK layer, so nothing you will find in the messages.

    AFAIK this LinkID will be occupied for the link between the two nodes until an Unlink is received. I struggled for some time with this LinkID because I have a larger network with any-to-any communication links where the LinkId became used up quite soon.

    SimpliciTI is built mainly for the usgaes: EndDevice / RangeExtender / AccessPoint  so a hierarchical network structure (e.g. star).

    The DEVICE_ADDRESS is just a 4 byte address like IPv4 and has to be assigned by YOU, either by hard coding into the software (for each device of course :-)

    or by reading the IEEE Address you programmed into the device using the SmartRF FlashProgrammer.

    There is an excellent description on how to access the IEEE programmatically: IAR_IDE_User_Manual_Rev. 1.2 (swru038) page 17

    look out for something like:

    a[0] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 0);
    a[1] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 1);
    a[2] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 2);
    a[3] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 3);

    good luck

     

  • Thanks for replying but is this Link ID unique for each device.. or its same .. or its randomly generated at each power cycle. Is this something similar chip manufacture unique ID..? how do u get unique ID for each device for wireless communication... what is Zigbee address.....? does the simpliciti support 32 bit or 64 bit zigbee address...

    In my case what we trying to achieve is theres talker and listner. once we set up link we will start receiving and sending packets but say for example the listener is power cycled than wireless link will break . now in this scenario talker had previous stored link ID of listner so it will try to relink to the same listner. now here is the question can it try tp relink to the same listner or it will broadcast the message n all teh listener will reply... how does this work...? 

    Thanks!

    Arti

     

  • First and most important: there is a perfect example for Sender/Receiver called LinkListen.

    I am sure you should have a look into it!!!!

    Second: don't confuse SimpliciTI and ZigBee, SimpliciTI is a very pragmatic, lean, smart and versatile network stack, ZigBee is an industry standard full blown networking-and-what-not stack!

    as I said the linkId is a internal identifier for the ConnectionTableEntry  representing the connection between the nodes, no magic about it, nothing really to worry about.

    Call it the internal file handle id of the connection you established. You wouldn't ask your operating system after open()-ing a file: why did you give me this handle, is it unique in the system and when I restart my program, will I get  the same handle again...

    Have a look into nwk.c:

    /************************************************************************************
     * @fn          initializeConnection
     *
     * @brief       Initialize some elements of a Connection table entry.
     *
     * input parameters
     * @param   pCInfo  - pointer to Connection Table entry to initialize. The file
     *                    scope variable holding the next link ID value is also updated.
     *
     * output parameters
     * @param   pCInfo  - certain elements are set to specific values.
     *
     *
     * @return   void
     */
    static void initializeConnection(connInfo_t *pCInfo)
    {
      linkID_t *locLID = &sPersistInfo.nextLinkID;
      uint8_t   tmp;

        /* this element will be populated during the exchange with the peer. */
      pCInfo->portTx = 0;

      pCInfo->connState  =  CONNSTATE_CONNECTED;
      pCInfo->thisLinkID = *locLID;

      /* Generate the next Link ID. This isn't foolproof. If the count wraps
       * we can end up with confusing duplicates. We can protect aginst using
       * one that is already in use but we can't protect against a stale Link ID
       * remembered by an application that doesn't know its connection has been
       * torn down. The test for 0 will hopefully never be true (indicating a wrap).
       */
      (*locLID)++;

      while (!*locLID || (*locLID == SMPL_LINKID_USER_UUD) || map_lid2idx(*locLID, &tmp))
      {
        (*locLID)++;
      }

      return;
    }

    That's all there is to it, just a simple continuously increasing byte number..

    On powercycle I would expect the node to reinitiate a Link with the non powercycled node, so the application on the receiving node - you will design it - will receive a new Link event and recognize the new communication partner

    .. and they lived happily ever after ..

     

  • Thomas is correct, the Link ID is merely a handle used by the SimpliciTI stack to access a previously established link.  Note that the information structures associated with the Link ID are lost on a power cycle.  There are two options here.

    1. You can re-link with the other node.
      This has the draw back that a new Link ID will be established on both ends.  The end that did not power cycle will have to update the Link ID to the new one otherwise it will be communicating on a dead connection link.  It would also be prudent to remove the old link via a call to SMPL_UnLink once the new connection is recognized.
    2. You can save the link table information to non-volatile storage and restore it on power up
      In this case, you will need to also incorporate some type of flag to indicate if this is the first attempt to create a link so you will not overwrite the link table with invalid information.  In this case, you need to call SMPL_Ioctl to gain access to the data structure holding all of SimpliciTI's data requiring persistent storage.  Using this handle, you can save and retrieve the data to your non-volatile storage.  This way, you will only go through the link process once, the initial time the system is powered on, and then merely restore the connection information after each power cycle.

    Jim Noxon

  • Thanks you so much. NowI got better understanding of how the Link Id works.

    I have questions

    1. I can read IEEE address on CC2430 (as shown in IAR_IDE_USER MANUAL for CC2430) but can I read IEEE Address in CC2530 from as well...n wht addres.?
    2. In the SimpliciTI frame structure it has field for src addr and dest addr... what are tehy used for and how they are set....?
    3. In peer to peer communication ... For idenfying the existing peer ....is done by getting peer IEEE address and verify it against stored address.... but should one end device request for its peer address or its included in the packet when it tried to link with peer.????
    4. IEEE Address is also know as Zigbee Address.....? or its two different things...?
    5. How does this work "THIS_DEVICE_ADDRESS" is of 32bits but IEEE address is of 64bits...?

    Sorry for some unknown random questions. I am just so confuse and new to this platform and trying to understand the basic...

    Thanks!

    Aarti