<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Binding an nrf52 Zigbee light switch to a light bulb</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85787/binding-an-nrf52-zigbee-light-switch-to-a-light-bulb</link><description>I have been playing with an Ikea Tradfri E1812 button, a Philips Hue bulb, and zigbee2mqtt. I see that when I bind the button&amp;#39;s OnOff output cluster to the bulb&amp;#39;s OnOff input cluster, the sniffed traffic indicates that the ZC sends a Bind Request to the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Mar 2022 03:22:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85787/binding-an-nrf52-zigbee-light-switch-to-a-light-bulb" /><item><title>RE: Binding an nrf52 Zigbee light switch to a light bulb</title><link>https://devzone.nordicsemi.com/thread/359258?ContentTypeID=1</link><pubDate>Tue, 22 Mar 2022 03:22:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76b7ed7a-6464-4ba7-99be-fc6d2751d5c4</guid><dc:creator>mytzyiay</dc:creator><description>&lt;p&gt;Hmm, seems a bit quirky for me.&amp;nbsp; On unbind, the entry isn&amp;#39;t removed until the next power cycle, and unbinding a group doesn&amp;#39;t even work at all.&lt;/p&gt;
&lt;p&gt;However this is good enough for my current purposes.&amp;nbsp; Thanks for the help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Binding an nrf52 Zigbee light switch to a light bulb</title><link>https://devzone.nordicsemi.com/thread/359177?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 14:27:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f90b641-5747-4f06-b989-6285ba21d80e</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="mytzyiay"]&lt;p&gt;The binding table is stored by ZBOSS in flash, right?&lt;/p&gt;
&lt;p&gt;What is the point of storing this binding table if there is no way to use it?&amp;nbsp; It seems like the API may be incomplete.&lt;/p&gt;[/quote]
&lt;p&gt;I apologize, it seems like I was mistaken. While testing this last week I was not able to get the binding table entries. However, it seemed to be some error on my end, as today I was able to get the source and destination binding tables on both light switch and light bulb.&lt;/p&gt;
&lt;p&gt;The binding table is stored in&amp;nbsp;gc_aps_bind_src_table and&amp;nbsp;gc_aps_bind_dst_table.&lt;/p&gt;
&lt;p&gt;These functions are what I used to test, and will print the binding table entries:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void get_src_bind_table()
{
    uint32_t i;
	zb_uint16_t addr;
	LOG_INF(&amp;quot;Source bind table&amp;quot;);
    for (i = 0; i &amp;lt; gc_aps_bind_src_table_size; i++)
    {
        zb_address_short_by_ref(&amp;amp;addr, gc_aps_bind_src_table[i].src_addr);
		if(gc_aps_bind_src_table[i].src_end!=0){
        	LOG_INF(&amp;quot;short addr: 0x%04x&amp;quot;, addr);
        	LOG_INF(&amp;quot;ep: %d cluster: 0x%04hx&amp;quot;, 
                	gc_aps_bind_src_table[i].src_end, gc_aps_bind_src_table[i].cluster_id);
		}
    }
}

void get_dst_bind_table()
{
    uint32_t i;
	zb_uint16_t addr;
	LOG_INF(&amp;quot;Destination bind table&amp;quot;);
    for (i = 0; i &amp;lt; gc_aps_bind_dst_table_size; i++)
    {
        zb_address_short_by_ref(&amp;amp;addr, gc_aps_bind_dst_table[i].u.long_addr.dst_addr);
		if(gc_aps_bind_dst_table[i].u.long_addr.dst_end!=0){
			LOG_INF(&amp;quot;short addr: 0x%04x&amp;quot;, addr);
        	LOG_INF(&amp;quot;ep: %d cluster: 0x%04hx&amp;quot;, 
                	gc_aps_bind_dst_table[i].u.long_addr.dst_end, gc_aps_bind_src_table[i].cluster_id);
        	LOG_INF(&amp;quot;group addr: 0x%04hx&amp;quot;, gc_aps_bind_dst_table[i].u.group_addr);
		}
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Calling these functions prints the following:&lt;/p&gt;
&lt;p&gt;On the light switch:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Source bind table&lt;/code&gt;&lt;br /&gt;&lt;code&gt;short addr: 0xc417&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ep: 1 cluster: 0x0006&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Destination bind table&lt;/code&gt;&lt;br /&gt;&lt;code&gt;short addr: 0x7b8c&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ep: 10 cluster: 0x0006&lt;/code&gt;&lt;br /&gt;&lt;code&gt;group addr: 0x0a09&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;On the light bulb:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Source bind table&lt;/code&gt;&lt;br /&gt;&lt;code&gt;short addr: 0x7b8c&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ep: 10 cluster: 0x0006&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Destination bind table&lt;/code&gt;&lt;br /&gt;&lt;code&gt;short addr: 0xc417&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ep: 1 cluster: 0x0006&lt;/code&gt;&lt;br /&gt;&lt;code&gt;group addr: 0x0110&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;When testing this I created the bindings between the switch and bulb from the coordinator (Zigbee Shell) in order for it to be as close to&amp;nbsp;your use case as possible.&lt;/p&gt;
&lt;p&gt;Please note that in my functions I have a check on the endpoint. This is because the empty entries are filled up with 0x0000 and 0, so without this check you would get an output filled with the empty entries as well:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Destination bind table&lt;/code&gt;&lt;br /&gt;&lt;code&gt;short addr: 0x7b8c&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ep: 10 cluster: 0x0006&lt;/code&gt;&lt;br /&gt;&lt;code&gt;group addr: 0x0a09&lt;/code&gt;&lt;br /&gt;&lt;code&gt;short addr: 0x0000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ep: 0 cluster: 0x0000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;group addr: 0x0000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;short addr: 0x0000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ep: 0 cluster: 0x0000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;group addr: 0x0000&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Endpoint 0 is reserved for ZDO, so if the endpoint in the binding table is 0 you know what this means the entry is empty.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Binding an nrf52 Zigbee light switch to a light bulb</title><link>https://devzone.nordicsemi.com/thread/358929?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 17:38:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6f91473-7eb9-4113-8ee7-0616119e21ee</guid><dc:creator>mytzyiay</dc:creator><description>&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;The function&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v3.2.0/group__zdo__bind.html?cp=8_7_1_5_1_2_3_30#gab444d1f5881aa628703830334c5216f5"&gt;zb_zdo_find_bind_src()&lt;/a&gt;&lt;span&gt;&amp;nbsp;can be used to check if there are any binding table entries on the specific endpoint and cluster ID, but not to get the binding table itself.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;That could be helpful if it actually returned the destination address + endpoint (so I could &lt;em&gt;use&lt;/em&gt; the binding table entry for something), but I don&amp;#39;t understand why it would be useful if it&amp;#39;s only returning a boolean?&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;One way to solve this is to handle it locally on your device when you send a bind request. If you are using a normal bind request you must know the address, endpoint, and cluster in order to send the bind request, so the device will already have this information.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Right, but my device (a simple light switch with no LCD or other UI) doesn&amp;#39;t send the binding request.&amp;nbsp; Instead, I rely on the controller, which has a nice rich web GUI that lets users perform bindings using human-readable device names / room locations and other contextual clues.&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;There is no way to get the binding table on a local device.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The binding table is stored by ZBOSS in flash, right?&lt;/p&gt;
&lt;p&gt;What is the point of storing this binding table if there is no way to use it?&amp;nbsp; It seems like the API may be incomplete.&lt;/p&gt;
&lt;p&gt;Also it looks like there is an addressing mode that references the binding table (&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/85840/is-zb_aps_addr_mode_bind_tbl_id-actually-supported"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/85840/is-zb_aps_addr_mode_bind_tbl_id-actually-supported&lt;/a&gt;&amp;nbsp;) but I wasn&amp;#39;t able to get it to work.&amp;nbsp; Do we have any examples or additional information on what this is intended to do?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Binding an nrf52 Zigbee light switch to a light bulb</title><link>https://devzone.nordicsemi.com/thread/358769?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 07:21:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d165a6df-959f-4a24-9ef3-ef4a7e9927cc</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When you were testing with&amp;nbsp;Ikea Tradfri E1812 button&amp;nbsp;and Philips Hue bulb, did you see whether they sent a regular bind request or if it were an end device bind? If it were an end device bind request that you can use&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v3.2.0/group__zdo__bind.html?cp=8_7_1_5_1_2_3_28#ga4a4a142c1a03b19f61cf0598b1d480db"&gt;zb_end_device_bind_req()&lt;/a&gt;&amp;nbsp;to get a similar behavior.&amp;nbsp;&lt;/p&gt;
[quote user="mytzyiay"]What is the best way to read the local binding table so my nRF52840 can find the address of the bound light bulb(s)?[/quote]
&lt;p&gt;There is no way to get the binding table on a local device. You can&amp;nbsp;use&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v3.2.0/group__zdo__bind.html?cp=8_7_1_5_1_2_3_31#ga732559445340acf1bc71a8dc1affcd5f"&gt;zb_zdo_mgmt_bind_req()&lt;/a&gt;&amp;nbsp;to send a Mgmt_Bind_req to a remote device (or the device can send it to itself) to get the binding table. The function&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v3.2.0/group__zdo__bind.html?cp=8_7_1_5_1_2_3_30#gab444d1f5881aa628703830334c5216f5"&gt;zb_zdo_find_bind_src()&lt;/a&gt;&amp;nbsp;can be used to check if there are any binding table entries on the specific endpoint and cluster ID, but not to get the binding table itself.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One way to solve this is to handle it locally on your device when you send a bind request. If you are using a normal bind request you must know the address, endpoint, and cluster in order to send the bind request, so the device will already have this information. When you call&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v3.2.0/group__zdo__bind.html?cp=8_7_1_5_1_2_3_29#ga403cbc689175cec5196544d784d5b067"&gt;zb_zdo_bind_req()&lt;/a&gt;&amp;nbsp;to send a bind request the second parameter is the callback function that should be called when the device gets a bind response. This response does not contain much, but it does contain a parameter for whether the bind was successful or not, so if it were successful you know that you were able to create a binding with that specific device and endpoint. You can see an example of how I have done binding in bind_req() and zb_bind_callback() here:&amp;nbsp;&lt;a href="https://github.com/martelmy/Zigbee-examples-nRF5-SDK/blob/main/bind_req_cmd/main.c#L147"&gt;https://github.com/martelmy/Zigbee-examples-nRF5-SDK/blob/main/bind_req_cmd/main.c#L147&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Binding an nrf52 Zigbee light switch to a light bulb</title><link>https://devzone.nordicsemi.com/thread/358036?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 16:09:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b5afca6-3006-47b2-a024-1ba5b86bdaa1</guid><dc:creator>mytzyiay</dc:creator><description>&lt;p&gt;I want the controller to create the bind request.&amp;nbsp; Then I want my nRF52840 based switch to accept the binding, and obtain the bulb&amp;#39;s address from the binding table to pass to ZB_ZCL_ON_OFF_SEND_REQ() so that it behaves just like the Ikea button.&lt;/p&gt;
&lt;p&gt;I do not want my switch to have to find the light bulb on its own, because a switch has a very limited UI compared to the controller&amp;#39;s web interface.&lt;/p&gt;
&lt;p&gt;What is the best way to read the local binding table so my nRF52840 can find the address of the bound light bulb(s)?&lt;/p&gt;
&lt;p&gt;Do I need to do anything special to allow the controller to bind my nRF52840 to a light bulb?&amp;nbsp; Or will ZBOSS automatically accept incoming binding requests?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Binding an nrf52 Zigbee light switch to a light bulb</title><link>https://devzone.nordicsemi.com/thread/357985?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 14:26:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd3428f2-7e1e-4135-a469-0d0d6a351c5c</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which light bulb to send the On/Off commands to is decided by the short address and endpoint passed to the macro&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/zboss/3.11.1.0/group___z_b___z_c_l___o_n___o_f_f.html#ga69a2ec2b35faab89d0d3395dc485e4c7"&gt;ZB_ZCL_ON_OFF_SEND_REQ&lt;/a&gt;.&amp;nbsp;You do not necessarily need to create a binding between the light bulb and light switch. As long as the light switch has found the light bulb and knows its short address and endpoint you can use this as parameters in ZB_ZCL_ON_OFF_SEND_REQ to unicast On/Off commands.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you still want to create a binding between the two you can&amp;nbsp;use&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/zboss/3.11.1.0/group__zdo__bind.html#ga403cbc689175cec5196544d784d5b067"&gt;zb_zdo_bind_req()&lt;/a&gt;&amp;nbsp;to send a bind request.&amp;nbsp;You need to create and fill the bind request parameters,&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/zboss/3.11.1.0/structzb__zdo__bind__req__param__s.html"&gt;zb_zdo_bind_req_param_t&lt;/a&gt;, which will be passed to the bind request. If you want each button to be uniquely binded to one light bulb then each button must have its own endpoint.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>