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.

Questions to PAN_ID

HI,
I did a test with Generic App so I change the sending sequence to send directly to coordinator without binding as

  char theMessageData[] = "Hello World";
  GenericApp_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
  GenericApp_DstAddr.addr.shortAddr = 0x0000;
  GenericApp_DstAddr.endPoint = GENERICAPP_ENDPOINT;

  if ( AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,
                       GENERICAPP_CLUSTERID,
                       (byte)osal_strlen( theMessageData ) + 1,
                       (byte *)&theMessageData,
                       &GenericApp_TransID,
                       AF_ACK_REQUEST | AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )

So my questions are:

1- normaly if  the flag -DZDAPP_CONFIG_PAN_ID=0xFFFF is set the PAN_ID should be the last (Last 2 Bytes) of the IEEE Adress (Unique)  why the PAN-ID change if coordinator restartet? 

2- I switch off coordinator and the End device still on. I restart Coordinator and the Enddevice rejoin the network but not send any Packet to ccordinator? why? is it while the Coord. change the PAN_ID (as in question 1)?

3- how can I do changes that enddevice rejoin neu formed Network if Coordinator restart?

 

  • 1- I can think of 2 possible explanations for the Coordinator to change PanID after reset: (a) the IEEE address of the Coordinator is different after the reset - this could happen if your device is generating a "random" IEEE address (see zmain_ext_addr() in ZMain.c) or (b) your network has one or more Router devices which joined the Coordinator with the origimnal PanID. When the Coordinator is reset, it does a Beacon Request and the Routers will respond with the original PanID, causing the Coordinator to start it's new network with a different PanID.

    2- Yes, if your Coordinator uses a new PanID when it gets reset, the End-Device will not be able to communicate with it because the End-Device will continue (for awhile) to use the old PanID.

  •  I looked on the example. you´re right it use the zmain_ext_addr().  that mean in this case the  configuration DZDAPP_CONFIG_PAN_ID=0xFFFF
    in f8wConfig.cfg don´t has any effect?
    how can I change to have the IEEE Adress? only  comment oput the

      // Determine the extended address
      // zmain_ext_addr();

    or I have to write any other code

    Thanks

  • You should not comment out the call to zmain_ext_addr() -- that is a normal part of the start-up process. If you need to "hardwire" an address for testing purposes, instead of letting the code generate a random one, you could modify the for loop to load aExtendedAddress[ ] with your IEEE address. A more permanent answer would be to write the address to NV  -- use Z-Tool to do it from your PC or comment out the line writeNV = FALSE; in zmain_ext_addr().

  • Hi,

    for the first thank you for help.

    So in my Application I need to use the really IEEE Adress preprogrammed in de device. not hardwire any Adress for testing  purposes.

    Any API Function to read this pre programmed IEEE Adress?

  • ok I found It- it is in tne same Function to use random Adress. I have to change the zmain_ext_addr()

      // Attempt to read the extended address from the designated location in the Info Page.
          if (!osal_memcmp((uint8 *)(P_INFOPAGE+HAL_INFOP_IEEE_OSET), nullAddr, Z_EXTADDR_LEN))
          {
            osal_memcpy(aExtendedAddress, (uint8 *)(P_INFOPAGE+HAL_INFOP_IEEE_OSET), Z_EXTADDR_LEN);
          }

    thanks for help

  • Now I can read the Primary IEEE Adress and the DZDAPP_CONFIG_PAN_ID=0xFFFF is set. I still have the same Problem. The PAN_ID change after any reset. Why?

    PAND_ID should use the 2 last bytes in the IEEE (still the same after Reset) that mean PAN_ID should not change after Reset?

  • OK, since your Coordinator device has the same IEEE address when it resets, it will consider starting a network with a PanID that is equal to the last 2 bytes of its IEEE address. When it starts operation, it will broadcast out a Beacon Request. If it gets any beacons with the same PanID (from routers that joined the Coordinator before the reset), the Coordinator will not be able to start a new network with that PanID. When you observe your problem, is the new PanID equal to the previous plus 1?

  • in my Network I have only an Enddevice and a coordinator (no router). so what you say can not be happen.

  • until now I do not any solution or explination of this Problem.

    I have ENDdevice and coordinator (As test application the genericApp)

    in the config file I set the PAN_ID to 0xFFFF( to use IEEE Address last 2 bytes)

    I use IEEE primary Address (form Info page)  as coordinator address

    the Problem is any time I reset the coordinator, I hav an new other PAN_ID for example:

    IEEE Adress 00 12 4B 00 01 17 A6 21  Network ID the first time App downloded and debuged is 5EBF (not a last 2 bytes) Why?
    after rest:  1DCF, 65AC, 284E, A289,.... why it change any time ?

    it is a Bug in the GenericApp or in the API´s???????

    can you tel  me in wich Function the PAN_ID will be set for the first time?