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.

Over-the-air reconfiguration of Z-Stack PAN ID and default Channel

Other Parts Discussed in Thread: Z-STACK, CC2530

Hi,

I am trying to add a new functionality into our Zigbee application where we can easily change the PAN ID (ZDAPP_CONFIG_PAN_ID) and default channel (DEFAULT_CHANLIST) of a given Zgibee device (Coor, Router, End Device).

The idea is to be able to send OTA a command to update these settings and after a system reset the unit will use the newly configured PAN ID and channel.

Has anyone tried this before?

what Z-Stack routines did you use to do this?

I am using Z-Stack-1.4.3-1.2.1.

Please don't suggest to upgrade to a new stack as I am creating a firmware upgrade for deployed units.

  • Hi Grant

    Just a quick brainstorm as you write that you cannot move to a different HW (e.g. CC2530 where you could use a new stack version that would support Frequency agility and its functionality to change channels).

    What about updating the local NV items that store the PAN ID and channel used, and then simply reset the device. This requires of course that you use the NV_RESTORE compile option.

    Of course you would have to make your own application messages to trigger this and find out the details, as I have not tried this. It is just an idea.

    -LL-

     

  • hi luke,

    thanks for the suggestion.

    I have already tried that option where I wrote the PAN ID and channel used into NVRAM after which I resetted the system.

    however, when reloading I still observe that it is still using the values in the compile option.

    I am not sure though if I need to enable NV_INIT as well. I already enabled NV_RESTORE in my system.

     

  • Hi again

    When you look in the ZigBee Developer's Guide (in your documents folder of the z-stack) it states the following:

    Global device configuration items are stored in ZGlobal.c, things like PAN ID, key information, network settings.

    The default values for most of these items are stored in f8wConfig.cfg. These items are stored in RAM and

    accessed throughout ZStack. To store and restore these items from non-volatile memory include the NV_INIT

    compile flag in your project.

    So I would try to use NV_INIT

    -LL-

     

  • hi luke,

    i got the answer from TI.

    there is no need to enable NV_INIT, what is critical is to update the values in the "_NIB" structure when updating the PAN ID and Channel values.

    i've tested this and it worked on my system.

  • Good to know.

    Could you please share the commands/code that you use to update the values in the "_NIB" structure for updating the PAN ID etc.?

    I would like to try it out myself later.

    Thanks!

    -LL-

  • Here's the statement that TI has provided along with the sample code

     

    ==================

    Here’s an example of how you could set the channel at run time:

     

       // Switch channel

        _NIB.nwkLogicalChannel = NewChannel;

        ZMacSetReq( ZMacChannel, & NewChannel );

    ==================

  • Thanks for the info.

    Today I also saw the following thread that helped me to better understand the differences between NV_INIT and NV_RESTORE

    http://e2e.ti.com/forums/p/1513/37655.aspx

    -LL-

  • how you would do to set panId=0x1111?

    _NIB.nwkPanId = 0x1111;

    ZMacSetReq( ZMacPanId, &_NIB.nwkPanId  );

  • Hi

    _NIB structure is just to save new settings in NV or do something else?

    but i need to know what ZMacSetReq or MAC_MlmeSetReq do, instant change of the channel, or it need a reset?

    for example a network starts on channel 12: with option -DDEFAULT_CHANLIST=0x00001000  // 12

    uint8 c12=12,c19=19,

    a command trigger a ZMacSetReq( ZMacChannel, &c19 ); on every node

     but after it, I have tested, network nodes can't see each other, so probably only coord change it's channel

    because with a other ZMacSetReq( ZMacChannel, &c12 ); nodes can see each other again

  • it shows what happen with ZMacSetRequest

    I have 1 coord and 1 router node

    commands can change PAN ID with ZMacSetReq( ZMacPanId, &val ) and Channel with PAN ID with ZMacSetReq( ZMacChannel, &val )

    chan I change PanId on coord and router it's ok, router still answer, when I change channel no answer of the router

  • Hi

    ZMacSetReq( ZMacChannel, &val ) seems to only work on the coord and not on routers

    is there a specific compile options that make ZMacSetReq work

    compile options of coord:

    CC2430EB
    ZTOOL_P1
    MT_TASK
    NV_INIT
    NV_RESTORE
    LCD_SUPPORTED=DEBUG
    INT_HEAP_LEN=4608
    HAL_UART_BIG_TX_BUF=1
    SPI_MGR_DEFAULT_MAX_TX_BUFF=1024
    SPI_MGR_DEFAULT_OVERFLOW=1

    compile options of router:

    CC2430BB
    NV_INIT