<?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>Distinguishing between Zigbee pairing states?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85381/distinguishing-between-zigbee-pairing-states</link><description>To provide feedback to the user through the LED state, I would like the behavior to be something like this: 
 
 If the nRF52840 Zigbee device is unpaired and ready for a ZC to add it, flash the blue LED 
 If it is paired but it&amp;#39;s still searching for its</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Mar 2022 08:25:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85381/distinguishing-between-zigbee-pairing-states" /><item><title>RE: Distinguishing between Zigbee pairing states?</title><link>https://devzone.nordicsemi.com/thread/356769?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 08:25:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60f172db-513f-43ee-a84f-3708bba795ef</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That is good to hear!&lt;/p&gt;
[quote user="mytzyiay"]What logic do I need to add in order to keep it from counting children of my router node[/quote]
&lt;p&gt;You can use either the device_type field of&amp;nbsp;&lt;span&gt;zb_nwk_nbr_iterator_entry_t&lt;/span&gt; to check if the device is an end device, or the relationship field to check if it is a child.&amp;nbsp;&lt;/p&gt;
&lt;table border="1" height="91"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Device type&lt;/td&gt;
&lt;td&gt;The type of the neighbor device:&lt;br /&gt;0x00 = ZigBee coordinator&lt;br /&gt;0x01 = ZigBee router&lt;br /&gt;0x02 = ZigBee end device&lt;br /&gt;0x03 = Unknown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Relationship&lt;/td&gt;
&lt;td&gt;The relationship between the neighbor and&lt;br /&gt;the current device:&lt;br /&gt;0x00 = neighbor is the parent&lt;br /&gt;0x01 = neighbor is a child&lt;br /&gt;0x02 = neighbor is a sibling&lt;br /&gt;0x03 = None of the above&lt;br /&gt;0x04 = previous child&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&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: Distinguishing between Zigbee pairing states?</title><link>https://devzone.nordicsemi.com/thread/356718?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2022 20:04:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a707ba3d-6fd8-462e-a0ae-3202a3a0679e</guid><dc:creator>mytzyiay</dc:creator><description>&lt;p&gt;This seems to work for me so far.&amp;nbsp; What logic do I need to add in order to keep it from counting children of my router node?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;static bool has_active_neighbors = false;&lt;br /&gt;&lt;br /&gt;static void check_neighbors(zb_uint8_t bufid);&lt;br /&gt;&lt;br /&gt;static void neighbor_check_cb(zb_uint8_t bufid)&lt;br /&gt;{&lt;br /&gt; zb_nwk_nbr_iterator_params_t *args = ZB_BUF_GET_PARAM(bufid, zb_nwk_nbr_iterator_params_t);&lt;br /&gt; has_active_neighbors = args-&amp;gt;index != ZB_NWK_NBR_ITERATOR_INDEX_EOT;&lt;br /&gt;&lt;br /&gt; ZB_SCHEDULE_APP_ALARM(check_neighbors, bufid, ZB_MILLISECONDS_TO_BEACON_INTERVAL(1000));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void check_neighbors(zb_uint8_t bufid)&lt;br /&gt;{&lt;br /&gt; zb_ret_t error_code;&lt;br /&gt;&lt;br /&gt; if (bufid == ZB_BUF_INVALID) {&lt;br /&gt; error_code = zb_buf_get_out_delayed_func(check_neighbors);&lt;br /&gt; ZB_ASSERT(error_code == RET_OK);&lt;br /&gt; return;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; zb_nwk_nbr_iterator_params_t *args = ZB_BUF_GET_PARAM(bufid, zb_nwk_nbr_iterator_params_t);&lt;br /&gt; args-&amp;gt;update_count = 0;&lt;br /&gt; args-&amp;gt;index = 0;&lt;br /&gt;&lt;br /&gt; error_code = zb_nwk_nbr_iterator_next(bufid, neighbor_check_cb);&lt;br /&gt; ZB_ASSERT(error_code == RET_OK);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void schedule_neighbor_check(void)&lt;br /&gt;{&lt;br /&gt; ZB_SCHEDULE_APP_CALLBACK(check_neighbors, ZB_BUF_INVALID);&lt;br /&gt;}&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Distinguishing between Zigbee pairing states?</title><link>https://devzone.nordicsemi.com/thread/356549?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2022 11:34:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ddaac80-9ea6-4228-bf56-9c660e638a3f</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is no signal generated for this, but what you can do is to check the neighbor table. The signal&amp;nbsp;ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT is generated when all entries&lt;span&gt;&amp;nbsp;&lt;/span&gt;in the&amp;nbsp;devices&lt;span&gt;&amp;nbsp;&lt;/span&gt;neighbor table have aged out, except for the entries for end devices that the device itself is the parent of.&amp;nbsp;Using the function&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/zboss/3.11.1.0/group__nwk__management__service.html#ga9614febdf2ad20a6b94397a733a2a6dd"&gt;zb_nwk_nbr_iterator_next()&lt;/a&gt;&amp;nbsp;you can get entries in the neighbor table, so you can check whether there are any entries that are not a child of the device, and if so, you know that the router is able to communicate with other devices again. As of now, there are no examples showing how to use this function in the latest tag of nRF Connect SDK, but it is used in this pull request:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/6961/files/ce1cd4337ce0de6de9cc14b26ea740e17d8cccf7"&gt;https://github.com/nrfconnect/sdk-nrf/pull/6961/files/ce1cd4337ce0de6de9cc14b26ea740e17d8cccf7&lt;/a&gt;, specifically in the function&amp;nbsp;refresh_active_nbt_table().&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: Distinguishing between Zigbee pairing states?</title><link>https://devzone.nordicsemi.com/thread/356391?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 16:46:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b21e812-f9e3-4108-934e-8ce02b8b63c4</guid><dc:creator>mytzyiay</dc:creator><description>&lt;p&gt;OK.&amp;nbsp; Which signal should I watch for to determine that the router has reconnected with other devices (i.e. the number of active links is &amp;gt;0) and so I can turn the LED green again?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Distinguishing between Zigbee pairing states?</title><link>https://devzone.nordicsemi.com/thread/356207?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 09:03:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2880fd64-ef99-44f3-9aa4-6499f4722dcc</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="mytzyiay"]If I start up the nRF52 board when the ZC is completely powered off, it&amp;#39;s still claiming that it joined the network and it&amp;#39;s illuminating the ZIGBEE_NETWORK_STATE_LED[/quote]
&lt;p&gt;This is actually correct. In this case the router has previously been commissioned to and joined the network, and it has the network data stored in NVRAM. When it restarts it does not need to be commissioned again, since it will use the stored network data to rejoin the network.&lt;/p&gt;
&lt;p&gt;The coordinator is not necessary for a Zigbee network to work.&amp;nbsp;In typical Zigbee networks where the coordinator is the Trust Center, the coordinator is responsible for creating a network and for commissioning new devices. However, if the coordinator is turned off or not reachable for some reason, the network will not stop working. You will be unable to commission new devices without a Trust Center, but the devices that have already been commissioned will keep working and can keep communicating.&lt;/p&gt;
[quote user="mytzyiay"]W: Parent is unreachable[/quote]
&lt;p&gt;This is printed when the signal&amp;nbsp;ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT is generated, which happens when a device is unable to reach any router or coordinator. If you have one coordinator and multiple routers in your network, and the coordinator is turned off this signal will not be generated, since the routers will still be able to find other routers.&lt;/p&gt;
[quote user="mytzyiay"]I want it to be clear to the user whether the nRF52 board has successfully&amp;nbsp;established communication with&amp;nbsp;other Zigbee nodes.&amp;nbsp; In the case where I power up a paired node and it can&amp;#39;t find any other Zigbee devices on the PAN, I&amp;#39;d like to flash red rather than green to alert the user to the connectivity issue.[/quote]
&lt;p&gt;You can use&amp;nbsp;ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT in&amp;nbsp;zboss_signal_handler() for this.&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: Distinguishing between Zigbee pairing states?</title><link>https://devzone.nordicsemi.com/thread/356139?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 18:19:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:631aec1c-533f-4265-bdcc-6f13afaba0a0</guid><dc:creator>mytzyiay</dc:creator><description>&lt;p&gt;I saw this code and have tested&amp;nbsp;it with a simple&amp;nbsp;two node network, just the ZC and my router/lightbulb on nRF52840.&amp;nbsp; If I start up the nRF52 board when the ZC is completely powered off, it&amp;#39;s still claiming that it joined the network and it&amp;#39;s illuminating the ZIGBEE_NETWORK_STATE_LED:&lt;/p&gt;
&lt;p&gt;I: ZBOSS Light Bulb example started&lt;br /&gt;I: Production configuration is not present or invalid (status: -1)&lt;br /&gt;I: Zigbee stack initialized&lt;br /&gt;I: Unimplemented signal (signal: 54, status: 0)&lt;br /&gt;I: Joined network successfully on reboot signal (Extended PAN ID: XXX, PAN ID: YYY)&lt;br /&gt;W: Parent is unreachable&lt;br /&gt;W: Parent is unreachable&lt;br /&gt;W: Parent is unreachable&lt;br /&gt;W: Parent is unreachable&lt;/p&gt;
&lt;p&gt;I do not want this.&amp;nbsp; I want it to be clear to the user whether the nRF52 board has successfully&amp;nbsp;established communication with&amp;nbsp;other Zigbee nodes.&amp;nbsp; In the case where I power up a paired node and it can&amp;#39;t find any other Zigbee devices on the PAN, I&amp;#39;d like to flash red rather than green to alert the user to the connectivity issue.&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;Zigbee router devices do not have parent devices&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Perhaps I&amp;#39;m using the wrong terminology to refer to &amp;quot;the peer(s) my router talks to&amp;quot;, but the documentation at&amp;nbsp;your link and the error message output seems to state otherwise?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Distinguishing between Zigbee pairing states?</title><link>https://devzone.nordicsemi.com/thread/356100?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 15:23:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98a42076-4500-4919-8cb1-3a314170029f</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Something similar to this is already done in both the light bulb and light switch samples, where LED 3 is used to indicate that the device has joined a network. This is done by calling the function&amp;nbsp;zigbee_led_status_update() inside the Zigbee signal handler:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;zboss_signal_handler&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;zb_bufid_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;bufid&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;{&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;/* Update network status LED. */&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;zigbee_led_status_update&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;bufid&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;ZIGBEE_NETWORK_STATE_LED&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The function will turn the LED on if the status of the signal&amp;nbsp;ZB_BDB_SIGNAL_STEERING is equal to RET_OK, which means that the device has successfully joined a network. If the status of this signal is something else or the device leaves the network (ZB_ZDO_SIGNAL_LEAVE) the LED will turn off.&lt;/p&gt;
&lt;p&gt;Zigbee router devices do not have parent devices, so the second condition where the device has joined the network but does not have a parent is not relevant. I suggest checking out our&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/nrf/ug_zigbee_qsg.html"&gt;Zigbee quick start guide&lt;/a&gt;&amp;nbsp;to get more familiar with how Zigbee works, and the different roles.&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>