This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Which SDK, examples need to download for the generic zigbee application for the 2 devices of nrf52840 dongle

Hi to all team,

I have two units of nrf52840 dongle with me.

I have to develop the generic application firmware where data send from one dongle(coordinator) is getting received by another dongle(Router/End Device) based on zigbee 802.15.4.

I have search the SDK from the nordic site but there i am getting confused because SDK i have found is for home automation based where coordinator is do commisioning.

So i have to need only SDK, examples which while programmed to nrf52840 dongle fulfills the concept of sending data from one dongle to other dongle based on zigbee.

So can anyone who has worked on this dongle, please let me know which soft-device, SDK and examples i have to download for these generic application from the nordic site.

Thanks & regards,

Ronak Jain  

Parents
  • Hi Marte,

    Thanks for the reply.

    The purpose of developing the project is that we have to developed such a standard generic gateway(Coordinator) based on zigbee mesh topology so that if any device purchased from the market would be joined and operate by the coordinator easily.

    So to fulfil the above requirement can  u please give me the reply of my below query.

    1) which softdevice will be required for zigbee mesh topology as i am using for nrf52840 dongle hardware for this.

    2) which firmware is valid to use for coordinator from the below 2 points a & b? If a & b are not correct than pls let me know which example i have to used for preparing the coordinator firmware

         - a) One Single firmware i can implement taking the use of example of Zigbee Light coordinator alongwith the Zigbee light switch code portion in it? so that by this firmware coordinator can form the network, allow the multiple router/end device to join the network and also control the single or multiple bulb by sending command

         -b) Zigbee CLI Agent router example.

    3) For testing purpose use zigbee light bulb code as a end device which can join with the coordinator mesh network through pan id and than bulb is controlled through coordinator . 

    Thanks and regards,

    Ronak Jain

  • Hi,

    1)

    a)

    If what you want is a coordinator acting as a generic gateway and not doing a lot of additional things, or doing specific predefined things, then you should use the light coordinator from the light control example. This example already has the needed functionalities for working as a coordinator, and can form networks, open/close the network, permit devices to join the network, etc. If you have this example programmed on a device, the device will automatically start creating a network when it starts up, and it will open the network as part of this. In addition, you can open the network after it has closed with by pressing a button. On the Dongle, this will be the user configurable button SW1.

    If you want the coordinator to send specific commands in addition to simply being a coordinator/gateway, then you must add this to the example. If you want it to be able to for example control light bulbs, then you can use the relevant code from the light switch example for this. However, if this coordinator is just meant to be a generic gateway and only handle the network, then this is not needed.

    b)

    If you instead want your coordinator to not just handle the network, but also be able to operate all kinds of Zigbee devices and send different cluster commands and so forth, as it seems like from your description, then you will need to use something the user can interact with more than they can with the light coordinator now. If so, the CLI agent example might be a better starting point. The light coordinator is implemented according to Zigbee specifications, so it will be able to let devices join, and the devices can be controlled by other devices that are programmed to control that device (such as a light switch and a light bulb), but if you want the coordinator itself to control the devices, this will not be enough.

    There are a lot of different clusters in the Zigbee Cluster Library, and they all have different attributes and commands. You can see a list of clusters in our SDK in ZCL clusters. If you want to be able to control all kinds of Zigbee devices, your device will have to implement functionality for all these attributes and commands. Some of this is generic and common for all clusters, such as the commands to read or write attributes, configure attribute reporting and more, as you can see in ZCL commands shared by all clusters. However, the cluster commands are cluster specific, so if you for example want to send the command to turn off something, such as a light bulb, you will have to send the "Off command" from the ZCL On/Off cluster, which in our SDK is done with the macro ZB_ZCL_ON_OFF_SEND_OFF_REQ. Because of this you should use something with user interaction, and a device that can handle all sorts of commands. So this is where the CLI agent comes in, as the cli subsystem handles this. With this, you can issue CLI commands to the coordinator and tell it what to do, such as sending commands to another device in the network, for example to turn off the light.

    As the CLI agent example is now, you have to use either UART or a USB CDC device to communicate with the CLI agent, and you must send the commands as described in the CLI reference. However, you can create something to make this easier for the user to use, for example something to use on top of this, as long as the CLI commands are sent correctly to the device. Because of this, the device will need to be connected to something that can communicate with it using one or both of the two interfaces I mentioned. Also be aware that this example does not automatically set the coordinator role or start the network, so you will either have to do that by issuing CLI commands at start up, or add this in the code.

    2)

    Yes, you can use the light bulb example to test. The light bulb is a router by default, but you can change this role to end device if you want to. If the network is open, then the light bulb will join the network using network steering.

    Best regards,

    Marte

Reply
  • Hi,

    1)

    a)

    If what you want is a coordinator acting as a generic gateway and not doing a lot of additional things, or doing specific predefined things, then you should use the light coordinator from the light control example. This example already has the needed functionalities for working as a coordinator, and can form networks, open/close the network, permit devices to join the network, etc. If you have this example programmed on a device, the device will automatically start creating a network when it starts up, and it will open the network as part of this. In addition, you can open the network after it has closed with by pressing a button. On the Dongle, this will be the user configurable button SW1.

    If you want the coordinator to send specific commands in addition to simply being a coordinator/gateway, then you must add this to the example. If you want it to be able to for example control light bulbs, then you can use the relevant code from the light switch example for this. However, if this coordinator is just meant to be a generic gateway and only handle the network, then this is not needed.

    b)

    If you instead want your coordinator to not just handle the network, but also be able to operate all kinds of Zigbee devices and send different cluster commands and so forth, as it seems like from your description, then you will need to use something the user can interact with more than they can with the light coordinator now. If so, the CLI agent example might be a better starting point. The light coordinator is implemented according to Zigbee specifications, so it will be able to let devices join, and the devices can be controlled by other devices that are programmed to control that device (such as a light switch and a light bulb), but if you want the coordinator itself to control the devices, this will not be enough.

    There are a lot of different clusters in the Zigbee Cluster Library, and they all have different attributes and commands. You can see a list of clusters in our SDK in ZCL clusters. If you want to be able to control all kinds of Zigbee devices, your device will have to implement functionality for all these attributes and commands. Some of this is generic and common for all clusters, such as the commands to read or write attributes, configure attribute reporting and more, as you can see in ZCL commands shared by all clusters. However, the cluster commands are cluster specific, so if you for example want to send the command to turn off something, such as a light bulb, you will have to send the "Off command" from the ZCL On/Off cluster, which in our SDK is done with the macro ZB_ZCL_ON_OFF_SEND_OFF_REQ. Because of this you should use something with user interaction, and a device that can handle all sorts of commands. So this is where the CLI agent comes in, as the cli subsystem handles this. With this, you can issue CLI commands to the coordinator and tell it what to do, such as sending commands to another device in the network, for example to turn off the light.

    As the CLI agent example is now, you have to use either UART or a USB CDC device to communicate with the CLI agent, and you must send the commands as described in the CLI reference. However, you can create something to make this easier for the user to use, for example something to use on top of this, as long as the CLI commands are sent correctly to the device. Because of this, the device will need to be connected to something that can communicate with it using one or both of the two interfaces I mentioned. Also be aware that this example does not automatically set the coordinator role or start the network, so you will either have to do that by issuing CLI commands at start up, or add this in the code.

    2)

    Yes, you can use the light bulb example to test. The light bulb is a router by default, but you can change this role to end device if you want to. If the network is open, then the light bulb will join the network using network steering.

    Best regards,

    Marte

Children
  • Hi Marte,

    Thanks for the reply.

    Can  you clear the confusion i have.

    The development device i have is nrf52840 dongle(PCA100059 board)

    As i informed earlier to you that the purpose/goal behind the developing project is to developed a standard generic gateway(Coordinator) based on zigbee mesh topology. Corrdinator is such that  if any device purchased from the market would be joined and operate by the coordinator easily.

    So now to match the above requirements there are 2 examples option from which one is without CLI (ie. Zigbee Light control example) and the other one is with CLI Agent Example.

    So i have query as below

    1) If i am work with CLI examples, than later on i have to add the logic so that whatever the data received between nrf52840 and usb dongle manually by cli  will be replaced by firmware perspective on final firmware release at customer end, which consumes time. 

    2) If i am work without CLI Agent example, than based on this is it not possible to control all zigbee devices based on generic as mentioned on the top of this reply? Without CLI example do not support the cluster of all generic based on various profiles like HA, Zigbee Light Link, others,etc.

    3) If without CLI this firmware is failed to fulfil my goal as to make standard generic that which can control and join with any device which is purchased from market based on profile like HA, zigbee Light Link, etc. Can u give me the reason why this firmware without CLI fails compared to use firmware with CLI so that the exact difference i come to know and also i can easily able to understand the reason of choosing this finally.

    Regards,

    Ronak Jain

  • Hi Ronak Jain,

    I have some questions to clarify parts of your project, in order to better understand your requirements and to better help you with suggestions.

    Ronak Jain said:
    Corrdinator is such that  if any device purchased from the market would be joined and operate by the coordinator easily.

     Can you please clarify or describe what you mean by the coordinator being able to operate any device? Do you expect the coordinator to be able to send all kinds of ZCL command to all types of Zigbee device? To use some examples, do you want your coordinator to be able to control a light device, and to turn the light on/off, as well as to lower or raise the heat or cool setpoint of a thermostat device, and lock/unlock a door? These are just some examples of different ZCL commands for some Zigbee Home Automation devices. If this is the case, that you want your coordinator to directly control the devices and send these commands to them, then you will need some sort of human interaction to do this, as someone would have to tell the coordinator to turn on/off the light or similar. 

    If this is not the case and I have misunderstood what you want your coordinator to do, please let me know. 

    1) I am not sure I understood what you mean by this. Are you thinking about some firmware you have to change on the device itself, in the CLI agent example, or are you thinking about something else? Could you please clarify what you mean?

    2) This depends on what you mean by controlling the devices. The Zigbee stack in our SDK, ZBOSS, is made according to the Zigbee PRO R22 and Green Power Proxy Basic specifications, so it should be compatible with Zigbee devices following the Zigbee specification, and it supports the mandatory clusters there as well as mandatory profiles such as those you mentioned. However, if you want your coordinator to be able to actually control all Zigbee devices on the market, then you will have to implement this functionality in some way. At least if my understanding of what you mean by controlling them is correct, i.e. that you want to be able to send all types of ZCL commands, such as for example turning on/off a light from your coordinator. You can implement this in another example than the CLI agent if you want to. However, if you want to be able to control all sorts of devices and send all kind of commands, you should use something a bit more generic, which is where the CLI agent might be a good fit. It does not need to be the CLI agent, however, but it is a good example to look at as a starting point. Because, even though the clusters, profiles, devices and such are supported in the SDK, you need to implement some code so that your device will actually send the commands to control the devices, as this does not happen just by itself. To turn a light off, you can use the macro ZB_ZCL_ON_OFF_SEND_OFF_REQ to send the off command. This is supported in the SDK, but you will have to create some code to make your coordinator send this command when it should control a light device and turn it off. You can also send generic commands as is done in the function generic_cmd_send() in the file zigbee_cli_cmd_generic_cmd.c, where they construct the command header, fill the packet and send it with the macro ZB_ZCL_SEND_COMMAND_SHORT, but you still need to add things such as command ID, profile ID, cluster ID, and which node to send it to when doing this. So you still need some functionality to fill in these fields and then send the command. 

    3) As I tried to explain when answering your second question, you do not need CLI to fulfill your goal, but you do need to implement some way for your coordinator to control other devices, and if you want to be able to control every possible Zigbee device, then this should be something generic such as the CLI Agent. Additionally, you will need some human interaction to tell the coordinator that now it should turn off the light, so you will need to be able to interact with the coordinator in some way, which is possible in the CLI agent. However, you do not need to use CLI, you can use something else to interact with the coordinator.

    Best regards,

    Marte

  • Hi Marte,

    Thanks for the reply,

    Here Coordinator has following role to play as mentioned below:

    1) It can form the network and able to join any zigbee device purchased from market based on various profiles. Right now profiles i need to test is for HA profile.

    2) It can able to operate any HA third party device. 

    3)  Coordinator can be able to send all kinds of ZCL command to all types of Zigbee device. 

    So i have 2 nrf52840 dongle Where one dongle worked as coordinator(switch) and other as router (light bulb). Here i need to develop the firmware for basic demo to support some features as mentioned below.

    A) to on/off light of router(light bulb) from coordinator(as a switch)

    B) send msg "Hello" from coordinator to router or vice versa

    C) router device send temperature data to coordinator or vice versa.

    So to prepare this demo between coordinator and router for PCA100059 board.

    i am going to use and load the firmware of coordinator in one nrf52840 dongle and zigbee light bulb firmware in other nrf52840 dongle from the below link from nordic. Below link firmware is correct pls reply?

    • <InstallFolder>\examples\zigbee\light_control\light_coordinator
    • <InstallFolder>\examples\zigbee\light_control\light_bulb

    Here by loading the firmware above in coordinator is not only enough. Because here coordinator only form and let the other devices to join and it do not directly able  to control the light of router device.

    To control the lighting or sending mesg of router device from coordinator, I have to study the light switch example and add required things of light switch in coordinator firmware.

    Also i can add respectively cluster commands to control various HA features?

    Hope you understood the requirement as i mentioned above in detail so can you tell me by doing this way, this demo is correct and treat as a standard for controlling any Home Automation devices? If anything missing or incorrect in my written, than please let me know.

     Waiting for your reply. 

    Regards,

    Ronak Jain

  • Hi Ronak Jain,

    Thank you for clarifying.

    Ronak Jain said:
    Coordinator can be able to send all kinds of ZCL command to all types of Zigbee device. 

     What is your plan for controlling the coordinator? Something must trigger the coordinator to send commands to the devices in the network and to control them. Do you have any thoughts about how you want to do this, as this will also affect the implementation of your project? If the user wants to turn on a light bulb device using the coordinator, they must have a way to tell the coordinator to do so. In the light control example you press a button on the light switch device and it sends the ZCL ON command to the light bulb, but since the coordinator in your case should be generic and able to send all kinds of commands, the user must have the possibility to tell the coordinator to send all of these commands. 

    Ronak Jain said:
    Below link firmware is correct pls reply?

     Yes, that is the correct location of the examples.

    Ronak Jain said:
    To control the lighting or sending mesg of router device from coordinator, I have to study the light switch example and add required things of light switch in coordinator firmware.

     Yes, you will have to implement this on the light coordinator yourself. Please be aware that the light switch example use four different buttons, but you only have one button on the Dongle, so you will have to take this into consideration when implementing the light switch functionality in your example. The light switch example has one button for turning the light on and one for turning it off, so either sending ON command or OFF command. Since you only have one button you will have to use this for both turning the light on and off, so you should toggle the light. The simplest way to do so would be to instead use ZB_ZCL_ON_OFF_SEND_TOGGLE_REQ to send a toggle command to the light, instead of using ZB_ZCL_ON_OFF_SEND_REQ.

    Ronak Jain said:
    Also i can add respectively cluster commands to control various HA features?

    You can add cluster commands to the example. You can find the documentation for the clusters in our SDK here: ZCL clusters. In the documentation of each cluster you will find the cluster commands of that cluster. These clusters are already implemented and supported in the SDK, so you can use the commands similarly to how ZB_ZCL_ON_OFF_SEND_REQ is used in the light switch example, by using the macro for the command you want to send.

    Ronak Jain said:
    this demo is correct and treat as a standard for controlling any Home Automation devices

     I am not sure what the standard for this is, but if you want to be able to control all kinds of HA devices, you will have to find a way to let the user control the coordinator, as they will have to tell the coordinator to send commands. You can use the demo to test toggling of a light by using the button, but if you want to be able to do more, you will have to use something else to control the coordinator, as the Dongle only has one button, and you want to be able to send all kinds of ZCL commands.

    Additionally, some devices have higher security requirements due to the nature of the devices, such as motion sensors, keypads and more. These are IAS security zone devices, and use a cluster called IAS Zone. They have an additional enrollment step, so in order to support these devices, you must use the IAS Zone cluster as well, and you must implement IAS Zone enrollment on your coordinator. You can find more information about this in the Zigbee Cluster Library Specification under the chapter about the IAS Zone cluster (chapter 8.2 in Zigbee Cluster Library revision 6)

    Best regards,

    Marte

  • Hi,

    Thanks for the reply.

    Can you please let me know when there is need of calling these 2 case mentioned below for more clear understanding 

    case 1 : ZB_BDB_SIGNAL_DEVICE_REBOOT (used only in firmware of coordinator)

    case 2: ZB_BDB_SIGNAL_STEERING    (used in firmware of both light switch and coordinator)

    Is there any document or any pdf which helps me to understand whole zigbee joining process with coordinator from where i can come to know which command coordinator, router used for network formation, joining, network steering, msg sending etc for zboss zigbee stack

    Regards,

    Ronak Jain

Related