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 can l handle the "NWK link status" message in the application layer?

Other Parts Discussed in Thread: Z-STACK

Hi

l am using ZStack-CC2530-2.5.1. My network includes one Coordinator and many routers and no enddevice.

As known according to Zigbee protocol eventhough the coordinator go away from the newtwork, routers can maintain the PAN network with same PANID. But l want to all routers switch itself to orphan state like enddevices and terminate PAN network when coordinator device power down or missed. l wrote a few codes for detecting coordinator existing in the network. I send "SYN" string as broadcast message to every routers from coordinator  in the network. if "SYN" was not received by the routers afer timeout level, they leave theirself in the PAN network and switch to 

searching PAN network mode. it works. But l can not send "SYN" message before sending "ZDP_MatchDescReq" command becauseof needed ClusterID matching proccess.

So my questions are: 1. Is there exist any type of message  to send as broadcast without any matching proccess that every other devices can receive in the network?

2. Is "NWK link status" message can be used for this purpose? How can l handle this message on the application layer?

l have read a lot of topics in this site but l could not find exact solution for my problem or maybe l missed some useful details.

l hope l could explain my stuaiton.

Do you have an advice for this?

  • The fundamental purpose for a "self-healing mesh network" is to be able to continue the successful operation of the network after one or more routers goes down (and the Coordinator is basically just another router after the PanId is established). So what you would like to do completely defeats this fundamental feature. Are you sure that you are utilizing ZigBee correctly? I do not think that it is the best use of ZigBee to "tear-down" a network just because the ZC disappears (whether temporarily or even permanently). Experienced ZigBee users/implementers learn sooner or later that installing the network in the first place, building the network up (i.e. Network Commissioning) is the hardest/most expensive part of implementing/installing a ZigBee network - it is astonishing that you would want to tear that down.

  • Thanks for your answer Dirty Harry.

    Yes you are right absolutely the "self-healing mesh network" is one of the most valuable things in Zigbee. But l got around to this point becauseof some problems l have experienced.  Actualy my main problem is not updated assoction list by the devices in their memories when occuring any changes in network. l wrote some codes and its requires restart the router when coordinator lost. Anyway  l decided to it is not suitable solution as you said.

    When l switched off the coordinator in network includes router(s), it can not resume with same PANID due to the compiling the program without NV_RESTORE paremeter. But l can get a cleared assoction list. And when l compiled with NV_RESTORE the program, coordinator can carry on its mission with same PANID but old assocation list exist with no changes. l wrote some codes to update the asscotion list but sometimes its not work properly and caused to restart coordinator due to the invalid extended address input. Now l optimized my code as written below:

    static void S5_update_assoc_list(void) {  

       uint8 qind = 0;  

       AddrMgrEntry_t addrEntry;   NLME_LeaveReq_t req;     while(AssociatedDevList[qind].shortAddr != 0xFFFF)  

      {    

        addrEntry.user  = ADDRMGR_USER_DEFAULT;    

        addrEntry.index = qind;     AddrMgrEntryGet( &addrEntry );        

        if(AssociatedDevList[qind].age > S5_DEVICE_AGE_LIMIT && AssociatedDevList[qind].shortAddr == addrEntry.nwkAddr)    

         {      

             req.extAddr = addrEntry.extAddr;      

    req.removeChildren = TRUE;      

             req.rejoin = TRUE;      

             req.silent = FALSE;      

             NLME_LeaveReq( &req );    

          }    

        qind ++;  

        }

    }

    The code find devices with big age and remove from the association list. maybe it still needs to be optimized. For now it works fine.

    Now l have a new problem... l setup a network includes one coordinator(C) and two routers(R1, R2) and R2 connected to R1, R1 connected to C (R2->R1->C) so Coordinator's association list consist only R1 address. When l switch of R1, l assume that R2 connected to C isn't it? but l can not see R2 address in coordinator list. Why?

  • When R1 disapprear, R2 does not need to "re-associate" to the ZC, so it will never appear in ZC association table. If R2 is within radio range of ZC, it will appear in neighbor table.

    Why are you even looking at these tables anyway? Association, neighbors, routing, etc. are all problems that have been solved for you by the Z-Stack which implements the correct ZigBee specifiied behavior.

    What exactly and specifically is the problem that you are trying to solve with ZigBee which you cannot solve, or are having a problem solving with the Z-Stack.

  • ZC will be connected to PC via RS-232 in my project and l want to see updated Zigbee network topology on UART terminal. In "Method for Discovering Network Topology" PDF note the assocation table was used so l focused on it too. l am new in Zigbee and if there is another solution for discovering R2 as you said l will try. Thanks for your help.

  • Hi Harry again,

    When l used "ZDP_MgmtLqiReq()" and "ZDO_ParseMgmtLqiRsp()" to get negihbor list, l can get only 3 number of neighbor device address eventough "neighborLqiEntries" indicates 6.

    Why l can not get full list? For saving memory space?

    Thanks

  • I believe that the recommended way to "crawl the ZigBee network" and try to discover every device that is out there is to iteratively use the ZDP_IEEEAddrReq() and to request the extended response by using the ZDP_ADDR_REQTYPE_EXTENDED argument. Then all first-hop routers will give you a list of their childeren, to which you will make another iteration of ZDP_IEEEAddrReq(), and so on, and so forth. It is a pretty tedious undertaking - there should be a lot of existing threads discussing it though.

  • Hi,

    I just stumbled on this thread, a bit late ;-)

    I have a similar scenario, where maybe 200 ZEDs & ZRs will be sending application data to the ZC, which forwards the data to a remote server.

    The easiest solution for having the network topology (map) is by each device sending its parent (next hop) as part of the application data.

    NLME_GetRequest() works for ZEDs, but, as you explained - not for ZRs. If, while installing the devices, a ZR is moved, for any reason, is will still send it's original parent (which gave him his NwkAddr).

    I've been going through the neighborTable, rtgTable and AssociatedDevList, but most of the time the data (neighborEntry_t.neighborExtAddr) is corrupted... ?

    Any ideas?

    See Router parent MAC - NLME_GetCoordExtAddr() for more details.

    Thanks