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.

LAUNCHXL-CC26X2R1: Can you programmatically change the channel in zigbee and restart the launchpad?

Part Number: LAUNCHXL-CC26X2R1


I have the ZigBee Light/Switch sample application working with a third launchpad as a sniffer connected to Wireshark.

It uses the default channel 11 to commission, and does this correctly. (set from f8wconfig.opts) and checked in PuTTy

I would like to programmatically change the channel.

Using the following code I have set the primary channel to 14 which I can validate with a Zstackapi_bdbGetAttributesReq() call

        zstack_bdbSetAttrReq.bdbPrimaryChannelSet = 0x4000;
        zstack_bdbSetAttrReq.has_bdbPrimaryChannelSet = true;
        Zstackapi_bdbSetAttributesReq(zclSampleLight_Entity, &zstack_bdbSetAttrReq);

but it appears that this only changes the data in nonvolatile memory.

How can I make my light (coordinator) programmatically restart on a different channel?

  • You can change BDB_DEFAULT_PRIMARY_CHANNEL_SET in bdb_interface.h to change primary channels.

  • Are you attempting to change the channel at runtime, after the coordinator has already formed the network? This is not a recommended typical use case but you can use a ZC factory reset or the Network Manager to accomplish this.

    e2e.ti.com/.../515585
    e2e.ti.com/.../700284
    dev.ti.com/.../z-stack-overview.html

    Regards,
    Ryan
  • What I would like to accomplish is to:

    1) start both devices on channel 11 using PuTTy

    2) while both devices are on the network using channel 11, at some time later would like to change the channel on the coordinator to something other than 11.

    3) would like to do this from a timer event.

    So far I have tried Zstackapi_DevStartReq() which restarts commissioning process on the original channel 11 even though I have tried the following

    bdbAttributes.bdbPrimaryChannelSet =  0x4000;

    as well as 

            zstack_bdbSetAttributesReq_t  zstack_bdbSetAttrReq;
            zstack_bdbSetAttrReq.bdbPrimaryChannelSet = 0x4000;
            zstack_bdbSetAttrReq.has_bdbPrimaryChannelSet = true;
            Zstackapi_bdbSetAttributesReq(zclSampleLight_Entity, &zstack_bdbSetAttrReq);

    In either case it will not force the board to try using channel 14?

    So to summarize I am trying to select a specific channel to use programmatically from my timer event.

  • Yes, I am attempting to change the channel at runtime... i.e. pick a specific channel at a specific time.

    I tried the following - in order do complete a factory reset ... from the timer event after both boards were on channel 11 and commissioning was complete. (running under debug)

    //reset to factory new ...
    Zstackapi_bdbResetLocalActionReq(zclSampleLight_Entity);

    Then I get the following two errors, and need to physically reset the board to continue ...

    Cortex_M4_0: Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 8.0.903.6)

    Cortex_M4_0: Trouble Halting Target CPU: (Error -2064 @ 0x0) Unable to read device status. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 8.0.903.6)

    Do I need to do something else before trying the factory reset?
  • I suppose you should use Zstackapi_ZdoMgmtNwkUpdateReq to change channel. You can refer to dev.ti.com/.../z-stack-overview.html

  • Performing a factory reset will interfere with the IDE debug session, this is expected behavior.

    Regards,
    Ryan