<?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 simulate Zigbee PAN Id conflict condition?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82053/how-to-simulate-zigbee-pan-id-conflict-condition</link><description>Hello Nordic support, 
 I am working on a Zigbee coordinator application, in which I would like to have some customised functionality when a pan id conflict is detected. I understand that Zigbee stack generates ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED signal</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Dec 2021 14:51:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82053/how-to-simulate-zigbee-pan-id-conflict-condition" /><item><title>RE: How to simulate Zigbee PAN Id conflict condition?</title><link>https://devzone.nordicsemi.com/thread/341557?ContentTypeID=1</link><pubDate>Wed, 01 Dec 2021 14:51:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3310e6b8-ec69-402d-b742-f0326bf92e25</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Do you have a project that I can use to replicate this without implementing everything myself? Where you set the panid manually, and print the panid at a later point in time?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to simulate Zigbee PAN Id conflict condition?</title><link>https://devzone.nordicsemi.com/thread/340988?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 06:55:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ee6f541-f1c0-4f33-a4f8-344fe79b5e36</guid><dc:creator>anusha_14</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for your response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding your questions, here are my answers:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;How did you set the PanID in your coordinators?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The PAN Id is taken from flash memory. If flash memory is not written, a random value is generated and assigned as PAN Id. There is also provision to set PAN Id via UART (i.e using Modbus protocol). I am setting the PAN Id via UART, which gets saved to flash memory. On reboot, the flash memory is read to get the PAN Id. So, for my test, I read the PAN Id of nRF52840 sample 1 hardware and set this same value to nrf52840 sample 2 hardware. Then, after reboot of nrf52840 sample 2, I expect the same PAN Id for both samples and generation of PAN Id conflict detected signal.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However, when checking with Zigbee sniffer, what I noticed is that nrf52840 sample 2 changes its PAN Id to some other value after reboot even though I have set &lt;strong&gt;zb_enable_auto_pan_id_conflict_resolution&lt;/strong&gt;(ZB_FAALSE) before starting Zigbee stack and also commented all function calls of&amp;nbsp;&lt;strong&gt;zb_start_pan_id_conflict_resolution&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Did you see the description for&amp;nbsp;ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED&amp;nbsp; in zboss_api_zdo.h or&amp;nbsp;you look at the zb_pan_id_conflict_resolution in zboss_api_nwk.h?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes, my intention is to create the condition of Pan Id conflict so that I get&amp;nbsp;ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED&amp;nbsp;&amp;nbsp;signal.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Perhaps the device that you are not debugging on is using this, so that the conflict is not detected on the device that you are debugging on.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have flashed the same firmware in both nrf52840 samples.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;But perhaps what you are really looking for is to implement a workaround similar to what is already present here? I see that the coordinator (zigbee_light_coordinator) does this by default in zigbee_helpers.c.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have seen that in zigbee_helpers.c,&amp;nbsp;zb_start_pan_id_conflict_resolution is called when&amp;nbsp;ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED&amp;nbsp;&amp;nbsp;is detected. However, what I am looking for is a way to store the changed PAN Id in flash memory (if there is a PAN Id conflict). So, I was planning to do this when&amp;nbsp;ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED&amp;nbsp;&amp;nbsp;signal is generated.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to simulate Zigbee PAN Id conflict condition?</title><link>https://devzone.nordicsemi.com/thread/340771?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 14:33:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de923fff-2c30-4b96-bd66-58ec24448376</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;How did you set the PanID in your coordinators?&lt;/p&gt;
&lt;p&gt;Did you see the description for&amp;nbsp;&lt;span&gt;ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED&amp;nbsp; in zboss_api_zdo.h:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED,        /*!&amp;lt; PAN ID conflict has been detected. Application
                                                 * has to decide whether to initiate its resolution
                                                 * or not.
                                                 * @par Signal parameter
                                                 * @see zb_start_pan_id_conflict_resolution
                                                */&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Of you look at the zb_pan_id_conflict_resolution in zboss_api_nwk.h:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
   Allow/disallow network joining

   @param param - pointer to a structure containing PAN ID conflict
   information - @see zb_pan_id_conflict_info_t

 * @b Example:
 ZB_ZDO_SIGNAL_CUT_HEADER macro may be used to remove from the buffer everything but the signal parameter (zb_pan_id_conflict_info_t structure in this case)
   @code

void zboss_signal_handler(zb_uint8_t param)
{
  zb_pan_id_conflict_info_t *info = NULL;
  zb_zdo_app_signal_hdr_t *sg_p = NULL;
  zb_zdo_app_signal_type_t sig = zb_get_app_signal(param, &amp;amp;sg_p);

  if (ZB_GET_APP_SIGNAL_STATUS(param) == 0)
  {
    switch (sig)
    {
      case ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED:
        info = ZB_ZDO_SIGNAL_GET_PARAMS(sg_p, zb_pan_id_conflict_info_t);
        ZB_ZDO_SIGNAL_CUT_HEADER(ZB_BUF_FROM_REF(param));
        zb_start_pan_id_conflict_resolution(param);
        break;
    }
  }
}
   @endcode
 */
void zb_start_pan_id_conflict_resolution(zb_uint8_t param);&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Perhaps the device that you are not debugging on is using this, so that the conflict is not detected on the device that you are debugging on.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But perhaps what you are really looking for is to implement a workaround similar to what is already present here? I see that the coordinator (zigbee_light_coordinator) does this by default in zigbee_helpers.c.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>