Other Parts Discussed in Thread: SYSCONFIG
Hi,
Is it possible to switch between Zigbee Coordinator to Zigbee Router and vice versa in run time or at boot up?
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.
Hi,
Is it possible to switch between Zigbee Coordinator to Zigbee Router and vice versa in run time or at boot up?
Hi Krishna,
A ZNP can switch roles before commissioning, but after starting and joining a network the node must maintain its current role until it is factory reset (i.e. clearing NV memory).
Regards,
Ryan
Hi Thanks for the response. Which command in Z-Tool, I need to use for switching network role from Router to Coordinator and vice versa?
SYS_OSAL_NV_WRITE to Id 0x87 where value 0 is Coordinator, 1 is Router, and 2 is End Device. YK covers this functionality in a blog post.
Regards,
Ryan
Tried series of commands with above blog post, Zigbee Coordinator works, returns device type as ZC and forms network. But Zigbee Router returns device type as ZR but do not start beacon. Stuck with router role.
Once commissioning has begun, the current role must remain until a factory reset is performed. This can apply to other network information stored in the NV as well, so applying SYS_OSAL_NV_WRITE Id 0x03 to value 0x03 with a SYS_RESET is recommended for instances where the device does not begin as expected.
Regards,
Ryan
I tried the steps as it is. Coordinator works (it forms the network and UTIL_GET_DEVICE_INFO command responds DeviceState as Coordinator. But after that changing to Router didn't worked for me. UTIL_GET_DEVICE_INFO command responds DeviceState as DEV_HOLD (0x0).
Tried once more by skipping Coordinator commands. After flashing the Software directly executed SYS_OSAL_NV_WRITE (Id 0x03 and Value 0x03) -> SYS_RESET (HARD_RESET, 0x0) followed by SYS_OSAL_NV_WRITE (Id 0x87 and Value 0x01). Even after this UTI_GET_DEVICE_INFO command responds DeviceState as DEV_HOLD (0x0). Please review attached log for the same and provide feedback.
When you start BDB COMMISSIONING on router, do you enable permit join on coordinator?
No I did not enabled permit join on coordinator. I wanted to see Beacon Request on channel 13 continuously.
Do you mean, UTI_GET_DEVICE_INFO will respond DeviceState as DEV_ROUTER only after joining with Zigbee Coordinator?
It won't send Beacon Requests continuously?
I followed exact steps given (sequence of commands) and enabled permit join in Coordinator just before sending BDB Commissioning in Router. Then Router joined network and DeviceState changed to DEV_ROUTER.
But, if permit joining is not enabled in Coordinator then I can see that Router sends (after sending BDB Commissioning command to Router) only one frame of Beacon Request. Please refer sniffer screenshot attached below. I would like to see continuous Beacon Request from Router at-least for certain duration (may be 30 sec or 60 sec or any other value). How this can be achieved?

You have to create a periodic timer event to call bdb start commission every 30 sec or 60 sec or any other value
Ok understood.
It means, UTI_GET_DEVICE_INFO will respond DeviceStatus as DEV_ROUTER only after joining to the Zigbee Coordinator network.
Also it needs to customise to send Beacon Request continuously.
Please confirm.
Which are the modules which corresponds to network role switchin in ZNP example application?
When using ZNP, device would turn DEV_ROUTER only after joining to the Zigbee network.
Ok.
What is the switch "DMM_LNT" is for? Where I can get details about the switches?
In main.c of "dmm_zc_switch_remote_display_app" example.
I need to use ZNP application (switching network role between Coordinator and Router) in "dmm_zc_switch_remote_display_app" (BLE Peripheral + Zigbee). Can it be included easily? Is is straight forward? Please advise.
DMM_LNT is an internal "Large Network Test" for which no instructions have been provided to customers. You can follow the Add MT Interface instructions but keep in mind that the existing UART UI must be removed or an additional UART peripheral must be established for the NPI.
Regards,
Ryan
Ok. Thank you for the suggestion.
Existing UART UI can be removed by disabling switch "CUI_DISABLE" right? Please correct me if I am wrong.
Is there any reference for adding additional UART peripheral for NPI? Is it given in Add MT Interface itself?
I am able to use ZNP application with "dmm_zc_switch_remote_display_app".
Since "dmm_zc_switch_remote_display_app" is Zigbee Coordinator application, UTIL_GET_DEVICE_INFO command just responds DeviceType as COORDINATOR, as shown in image below. I would like to have Router also. How I can achieve it?
The UART UI is disabled with CUI_DISABLE defined. UART peripherals can be added in SysConfig and further configured by NPITLUART_initializeTransport. Keep in mind that all existing DMM projects define their Zigbee role, i.e. "dmm_[zc/zr/zed]_switch...", and do not include ZNP functionality, thus it would not be possible to alter the Zigbee roles of these projects. You cannot change a dmm_zc_switch_remote_display_app to a Router role through the MT API. You would need to use a second dmm_zc_switch_remote_display_app project for ZR functionality.
Regards,
Ryan
My requirement is to have BLE Peripheral + Zigbee Coordinator/Router (zigbee role switching). With which example application I can achieve this?
My requirement is to have BLE Peripheral + Zigbee Coordinator/Router (zigbee role switching). With which example application I can achieve this?
Not sure what your question is about. Can you elaborate?
I need to have BLE Peripheral and Zigbee in a single application.
In Zigbee, I need both Router and Coordinator (switching like in ZNP application).
Can we have all these 3 in single application? At a time 2 should work (BLE Peripheral + Zigbee Coordinator and/or BLE Peripheral + Zigbee Router).
Is this is possible with the available SDK examples?
I think, I can have BLE Peripheral + Zigbee Coordinator (dmm_zc_switch_remote_display_app) and BLE Peripheral + Zigbee Router (dmm_zr_switch_remote_display_app) and ZNP (Zigbee Coordinator and Router, one ate time, switching).
I need to have all these 3 in single application. Is this possible?
I won’t say it’s not possible but TI doesn’t provide such examples. Maybe Ryan Brown1 can give you some suggestions.
My response is similar to YK's. It may be possible to create a ZNP + BLE DMM application, however this has not been fully investigated by TI. You can refer to the DMM Integration SimpleLink Academy Lab to further consider creating your own DMM application.
Regards,
Ryan
Try to refer to https://sunmaysky.blogspot.com/2019/12/how-to-create-periodic-event-to-toggle.html?m=1 . It’s similar in Zigbee stack.
Ok.
I tried to use "OsalPortTimers_startTimer" to create a timeout after 100ms but didn't worked for me. Is there usage conditions?
You can review osal_port_timers.h for usage conditions.
/********************************************************************* * @fn OsalPortTimers_startTimer * * @brief * * This function is used to create and start a TIRTOS timer. * * * @param uint8_t taskId - task ID to post event to when timer expires * @param uint32_t eventId - event to post * @param uint32_t timeout - timeout in ms * * @return OsalPort status code */ extern uint8_t OsalPortTimers_startTimer(uint8_t taskId, uint32_t eventId, uint32_t timeout);
There are also examples of it being used in zcl_sample*.c, zd_app.c, and bdb.c which can be referenced.
Regards,
Ryan
Hi,
I have added custom events "SerialComProcessEvents" to "zstackTasksArr" array and registered task in "stackServiceFxnsInit" as shown in below images:


To add my custom events, which are working but, it executing any Zigbee operations like forming network then SW is getting hang because of adding this custom events. What could be the reason for this?
Have you actively debugged your project to determine where the call stack is located when the code hangs, and checked all of the TI-RTOS metrics with the ROV? Does changing the order of your serial event in the list change behavior? Have you referenced the NPI usage for your SerialComProcessEvents/SerialComInit and could you considered modifying the NPI to achieve your application instead?
Regards,
Ryan
Thanks for the response.
It will keep waiting for response (function definition sendReqDefaultRsp). pCmdStatus will never become true and will not come out of while loop.

Changing order of in the list is not changing the behaviour.
No, not referenced NPI usage and not considered modifying NPI.
The behavior leads me to believe that your serial port and zstack tasks are overlapping. I recommend that you closely follow the NPI example of task creation and message handling.
Regards,
Ryan
Hi, Thank you for your valuable suggestion. I will try to follow NPI example as you suggested.