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.

How to set short address each node ?

Other Parts Discussed in Thread: CC2430, Z-STACK, CC2530

Hello,

I use GenericApp in z-stack . (cc2430)

GenericApp sent message as BROADCAST but I want to assign short address to router and end point

then sent as Unicast to each node.

 

How to set short address or mac address ?

thank you.

 

  • Hi,

    I am using cc2530 and have the same problem. try changing the address mode in GenericApp.c to Addr16Bit . but I do not know where to set short address of coordinator or router. As documents say the short address of coordinator is 0. does any one have an idea?

    Thanks,

    Leila

  • Hi Leila,

     

    You can address your data to coordinator by setting the destination

    short address to 0x0000 (read this post for more info).

    In order to send data to router, at least one of the addresses (NWK or the IEEE)

    must be already known to the sending device, then you can do the following:

    1. Sending by short address: In case where destination short addr (AKA the
      NWK address) known to the sending device, you just sending the data by
      setting the NWK addr in the destination addr. 
    2. Sending by IEEE addr: This is a more complicated case. In general you
      can not  send a message by IEEE addr (AF_DataRequest()). You must
      convert it to the NWK addr (read Z-Stack API - ZDP_NwkAddrReq() and
      ZDP_IEEEAddrReq() functions). However, in case you know  that the 
      device you are sending the message to is one of the direct children, you
      can use the IEEE addr for direct sending.

    Hope this helps.

     

    Br,

    Igor

     

  • Hi Igor,

    Thanks for the response. Let me summarize what you said and ask another question. My destination is coordinator, which I need to set the short destination address for that as 0x0000. My end device is not in a range that can communicate to coordinator directly so I am gonna use routers to cover the range and relay data to the coordinator which is a receiver for my data. You are saying I need to know the router's short or IEEE address, how I can set a desired short address to my routers because NWK address keeps changing as I turn the network on and off? in addition to that my destination is not router so setting the destination as router's address won't send my data to the coordinator, will it?

    Thanks in advance,

    Leila

  • Hi Leila,

     

    1. You don't have to worry about the routers. Once the destination is known
      (in your case the destination is always the coordinator) you can send
      your data by setting 0x0000 as destination address, the routers will be
      relaying the message/s to its final destination. It is how Z-Stack (ZigBee)
      works. Launch and forget.
      So, basically in your scenario, your have to deploy the entire ZigBee
      network (ZEDs ZRs and ZC) and then just send your data from the
      ZEDs to ZC, you don't have to worry about how the data will be
      transferred to its destination, it is Z-Stack headache. :)
      • Leila Keyvani said:
        because NWK address keeps changing as I turn the network on and off

      I strongly recommend you to read about the NV_INIT and NV_RESTORE
      features in Z-Stack developer's guide.
    2. May I suggest you the Many-to-One addressing feature (ZigBee-Pro only),
      This feature especially designed and helps to reduce the traffic in the
      large networks where one specific node acts like a data concentrator
      (I think that is an ideal solution for your scenario).
      You can read about this in Zstack developer's guide, section 5.4.

    Hope this helps.

     

    Regards,

    Igor

     

     

  • The current short address is always stored in NIB - Network Information Base structure of Z-Stack,  _NIB.nwkDevAddress.

    Are you using NV_RESTORE of your node?

    LPRF Rocks the World

  • Yes. I am using NV_ RESTORE right now. but if the destination is going to be the coordinator then do I still need to use this function?

    Leila

  • Leila, I'm not really understand your question.

    The NV_RESTORE and NV_INIT features are used to restore a single node

    (or entire network, if you wish) to its previous state in case of unexpected power

    down (reset, etc...). The partial list of items that are about to be restored are;

    PANID, Routing table, binding table, parent, children, device's state in the network...

     

    What is exactly you are trying to do with these functionalities?

  • I wrote this a reply to LRFD, he was suggesting to use that specific function to figure out the short address. I am saying since I am using coordinator as my destination then I no more need this function to figure out the short address. by the way, I am using genericapp as sample code with some modification such as converting broadcasting the "Hello world"  message  to unicast. so the code is the same for coordinator and end device. I get " Assoc cnf fail" from end device on the LCD what does this imply? 

    Thanks,

    Leila

  • It seems that Leila thinks that if ZR2 has one hop to get to ZC via ZR1, like this:

    ZR2  -->  ZR1  -->  ZC

    and the 16-bit NWK addresses are something like this:

    0xAC12  --> 0xBD23  --> 0x0000

    Then to get the message to the ZC, it must first be sent to the ZR1 @ address 0xBD23.

    Yes, this is true, but the NWK and MAC libraries are doing all of that work for you - that is the solution offered of the mesh networking. All you have to do is make the AF data request to address 0x0000 and the message will get there, ZigBee willing.

     

  • Hello,

    I have a mesh network like this:

    COORD <---> R1 <---> R2

    where R1 is directly connected to the COORD, whereas R2 is connected to R1. (Zstack 2.5.0)
    I don't use binding between the devices. To send data between the various nodes I use AF_DataRequest, but
    I only know the IEEE address of all device so, before AF_DataRequest, I use ZDP_NwkAddrReq() to discover
    the network address of the destination node.

    Everything works, but if I turn off the R1 I have a strange behavior:
    - The coordinator sends the broadcast request of ZDP_NwkAddrReq();
    - R2 responds;
    - The coordinator sends AF_DataRequest, but the destination adddress of this message is R1.

    It seems the coordinator does not update its routing table.
    Can someone help me?

    Thank you.

  • Hi,

    Try to call NLME_RouteDiscoveryRequest() periodically to update the network topology.

  • Thanks for your quickly response.


    I will try to use this function, but where do I insert that?


    My application:
    -receives message payload and destination IEEE address from serial port;
    -search the network address with the function ZDP_NwkAddrReq
    -after processing the response NwkAddrRsp, sends data with the function AF_DataRequest (with the option AF_DISCV_ROUTE)

    With the sniffer I checked that over the air are present RREQ and RREP packets.