<?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>How to configure attribute changes notifications on binding, Zigbee?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48175/how-to-configure-attribute-changes-notifications-on-binding-zigbee</link><description>There are several topics already exist on this forum concerning the attribute reporting, namely: 
 https://devzone.nordicsemi.com/f/nordic-q-a/42171/zigbee-attribute-request-and-response 
 https://devzone.nordicsemi.com/f/nordic-q-a/42327/trying-to-send</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Jun 2019 13:15:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48175/how-to-configure-attribute-changes-notifications-on-binding-zigbee" /><item><title>RE: How to configure attribute changes notifications on binding, Zigbee?</title><link>https://devzone.nordicsemi.com/thread/191834?ContentTypeID=1</link><pubDate>Mon, 10 Jun 2019 13:15:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5895c37-c69f-4f9c-b37d-f7e7642d2e02</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi Anna.&lt;/p&gt;
&lt;p&gt;I had a quick look at the stack and based on that I said you should do the function call before you started the zboss stack. I have now taken a more thorough look at the stack and found out that it should be fine doing the call after you started the stack. So if it works best for you after the stack is started just do that :-)&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure attribute changes notifications on binding, Zigbee?</title><link>https://devzone.nordicsemi.com/thread/191764?ContentTypeID=1</link><pubDate>Mon, 10 Jun 2019 03:26:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8e1870c-372b-467a-a46e-fb94fb95e277</guid><dc:creator>AnnaR</dc:creator><description>&lt;p&gt;Hi Andreas.&lt;/p&gt;
&lt;p&gt;Thank you very much for your explanation that is excellent, as usual.&lt;/p&gt;
&lt;p&gt;I have been able to adapt my project for attribute reporting on bind.&lt;/p&gt;
&lt;p&gt;But in my case, when I called the &lt;strong&gt;configure_reporting_locally&lt;/strong&gt; function before I start the zboss stack, the reporting starts on binding, and all is fine until I power off the device and power on it again. Then the device becomes unpaired, however, it didn&amp;rsquo;t leave the network before powering off. If I removing the function call, the device remains paired after power off/on, as it should.&lt;/p&gt;
&lt;p&gt;I checked with the example, but if I power off/on the devkit with Bulb (without coordinator restart), it remains paired, so this problem is not reproduced with the example.&lt;/p&gt;
&lt;p&gt;Finally, I tried to call &lt;strong&gt;configure_reporting_locally&lt;/strong&gt; after the zboss stack start, and it works (reporting on bind without device unpairing after power off/on cycle).&lt;/p&gt;
&lt;p&gt;Maybe, you have some idea about this behavior? Could you please comment, why did you advised putting the function call before the stack start, do some unobvious and non-desirable cases possible if using the call after the stack start?&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;/p&gt;
&lt;p&gt;Anna&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure attribute changes notifications on binding, Zigbee?</title><link>https://devzone.nordicsemi.com/thread/191146?ContentTypeID=1</link><pubDate>Wed, 05 Jun 2019 13:48:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5415e174-1a0b-4648-b81f-68441ea7cdd0</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]However, the question is still open, how to configure the attribute changes notification from router to coordinator just on successful Bind Request from the coordinator, so without followed explicit configuring the Attribute Reporting.[/quote]
&lt;p&gt;You are correct, there should be a default configuration for each attribute, this will be fixed in the next release which is coming soon. However, it will not be value change. &lt;/p&gt;
&lt;p&gt;In the currect SDK, can you try this:&lt;/p&gt;
&lt;p&gt;Use the CLI router as coordinator, and use the light bulb example and the light switch.&lt;/p&gt;
&lt;p&gt;1. Configure the coordinator by running these four commands: &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;log enable info zigbee.report&lt;br /&gt;bdb channel 16&lt;br /&gt;bdb role zc&lt;br /&gt;bdb start&lt;/p&gt;
&lt;p&gt;2. Open the light bulb example, copy this function into main.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void configure_reporting_locally(void)
{
  zb_zcl_reporting_info_t rep_info;
  memset(&amp;amp;rep_info, 0, sizeof(rep_info));

  rep_info.direction      = ZB_ZCL_CONFIGURE_REPORTING_SEND_REPORT;
  rep_info.ep             = HA_DIMMABLE_LIGHT_ENDPOINT;
  rep_info.cluster_id     = ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL;
  rep_info.cluster_role   = ZB_ZCL_CLUSTER_SERVER_ROLE;
  rep_info.attr_id        = ZB_ZCL_ATTR_LEVEL_CONTROL_CURRENT_LEVEL_ID;
  rep_info.dst.profile_id = ZB_AF_HA_PROFILE_ID;

  rep_info.u.send_info.min_interval = 1;
  rep_info.u.send_info.max_interval = 0;
  rep_info.u.send_info.delta.u8     = 1;

  zb_zcl_put_default_reporting_info(&amp;amp;rep_info);
} &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Go to the main(void) function and call this function before you start the zboss stack:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{
    zb_ret_t       zb_err_code;
    zb_ieee_addr_t ieee_addr;

    /* Initialize timer, logging system and GPIOs. */
    timer_init();
    log_init();
    leds_buttons_init();

#if (APP_BULB_USE_WS2812_LED_CHAIN)
    ret_code_t ret_code;
    ret_code = drv_ws2812_init(LED_CHAIN_DOUT_PIN);
    APP_ERROR_CHECK(ret_code);
#endif

    /* Set ZigBee stack logging level and traffic dump subsystem. */
    ZB_SET_TRACE_LEVEL(ZIGBEE_TRACE_LEVEL);
    ZB_SET_TRACE_MASK(ZIGBEE_TRACE_MASK);
    ZB_SET_TRAF_DUMP_OFF();

    /* Initialize ZigBee stack. */
    ZB_INIT(&amp;quot;led_bulb&amp;quot;);

    /* Set device address to the value read from FICR registers. */
    zb_osif_get_ieee_eui64(ieee_addr);
    zb_set_long_address(ieee_addr);

    /* Set static long IEEE address. */
    zb_set_network_router_role(IEEE_CHANNEL_MASK);
    zb_set_max_children(MAX_CHILDREN);
    zigbee_erase_persistent_storage(ERASE_PERSISTENT_CONFIG);
    zb_set_keepalive_timeout(ZB_MILLISECONDS_TO_BEACON_INTERVAL(3000));

    /* Initialize application context structure. */
    UNUSED_RETURN_VALUE(ZB_MEMSET(&amp;amp;m_dev_ctx, 0, sizeof(m_dev_ctx)));

    /* Register callback for handling ZCL commands. */
    ZB_ZCL_REGISTER_DEVICE_CB(zcl_device_cb);

    /* Register dimmer switch device context (endpoints). */
    ZB_AF_REGISTER_DEVICE_CTX(&amp;amp;dimmable_light_ctx);

    bulb_clusters_attr_init();
    level_control_set_value(m_dev_ctx.level_control_attr.current_level);

#if (APP_BULB_USE_WS2812_LED_CHAIN)
    /* Let&amp;#39;s have a timer triggering refresh of led state */
    ret_code = app_timer_create(&amp;amp;m_ws2812_refresh_timer, APP_TIMER_MODE_REPEATED,
            ws2812_refresh_timer_timeout_handler);
    APP_ERROR_CHECK(ret_code);
    ret_code = app_timer_start(m_ws2812_refresh_timer, APP_TIMER_TICKS(5000U), NULL);
    APP_ERROR_CHECK(ret_code);
#endif

    /** Start Zigbee Stack. */
    configure_reporting_locally();  //ADDED BY ME
    
    zb_err_code = zboss_start();
    ZB_ERROR_CHECK(zb_err_code);

    while(1)
    {
        zboss_main_loop_iteration();
        UNUSED_RETURN_VALUE(NRF_LOG_PROCESS());

#if (APP_BULB_USE_WS2812_LED_CHAIN)
        if (m_ws2812_refresh_request)
        {
            if (drv_ws2812_display() == NRF_SUCCESS)
            {
                m_ws2812_refresh_request = false;
            }
        }
#endif
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Compile and flash it to a DK. Flash the light switch to another DK, make sure that both join the network by running bdb start again.&lt;/p&gt;
&lt;p&gt;3. Find the light bulb&amp;#39;s endpoint, short and long addresses:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; zdo match_desc 0xFFFD 0xFFFD 0x0104 1 0x0006 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; zdo ieee_addr &amp;lt;returned_short_address&amp;gt;&lt;br /&gt;&lt;br /&gt;4. Create binding FROM the light bulb TO the CLI ON the light bulb:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; zcl bind &amp;lt;bulb_long_addr&amp;gt; &amp;lt;bulb_ep_from_match_desc&amp;gt; &amp;lt;CLI_long_addr&amp;gt; &amp;lt;CLI_endpoint, defaults to 64&amp;gt; 0x0008 &amp;lt;bulb_short_addr&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;You should be able to see the report by clicking on the light switch:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1002x736/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-f0fc3ab7abff4f0eb335433a2865c469/pastedimage1559742361433v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Wireshark log: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-f0fc3ab7abff4f0eb335433a2865c469/Wireshark-log.zip"&gt;devzone.nordicsemi.com/.../Wireshark-log.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>