Connecting a Zigbee router to a network with a specific PAN ID

NRF52840DK
NCS 2.8.0

Hello,
We are developing an application where a device with router function must join a coordinator network. The coordinator uses OOB (proprietary IR) to transmit the parameters of the network it forms to the router (PAN Id, Extended PAN Id, Channel). The router should not join networks whose PAN Id differs from the one transmitted from the coordinator.
To test this behavior, we use the Zigbee shell example, on two NRF52840DK boards, using the following commands:

Router board:

uart:~$ bdb role zr
Router role set
Done
uart:~$ bdb panid 0x57ca
Done
uart:~$ bdb start
Started router
Done
[00:03:53.518,218] <inf> zigbee_app_utils: Production configuration is not present or invalid (status: -1)
[00:03:53.518,676] <inf> zigbee_app_utils: Zigbee stack initialized
[00:03:53.524,139] <inf> zigbee_app_utils: Device started for the first time
[00:03:53.524,139] <inf> zigbee_app_utils: Start network steering
[00:03:53.524,169] <inf> zigbee_app_utils: Started network rejoin procedure.
[00:03:56.292,907] <inf> zigbee_app_utils: Unimplemented signal (signal: 54, status: 0)
[00:03:57.324,737] <inf> zigbee_app_utils: Unimplemented signal (signal: 54, status: 0)
[00:03:57.327,362] <inf> zigbee_app_utils: Joined network successfully (Extended PAN ID: f4ce3694d85533d8, PAN ID: 0x57cc)
[00:03:57.327,392] <inf> zigbee_app_utils: Network rejoin procedure stopped.
uart:~$

Coordinator board:

uart:~$ bdb role zc
Zigbee shell does not erase the NVRAM between reboots, but is not aware of the previously configured role.
Remember to set the coordinator role after rebooting the device.
Coordinator set
Done
uart:~$ bdb start
Started coordinator
Done
[00:02:12.252,075] <inf> zigbee_app_utils: Production configuration is not present or invalid (status: -1)
[00:02:12.252,563] <inf> zigbee_app_utils: Zigbee stack initialized
[00:02:12.258,056] <inf> zigbee_app_utils: Device started for the first time
[00:02:12.258,087] <inf> zigbee_app_utils: Start network formation
[00:02:12.810,516] <inf> zigbee_app_utils: Unimplemented signal (signal: 54, status: 0)
[00:02:12.812,622] <inf> zigbee_app_utils: Network formed successfully, start network steering (Extended PA N ID: f4ce3694d85533d8, PAN ID: 0x57cc)
[00:02:13.269,042] <inf> zigbee_app_utils: Unimplemented signal (signal: 54, status: 0)
[00:02:13.271,697] <inf> zigbee_app_utils: Joined network successfully (Extended PAN ID: f4ce3694d85533d8, PAN ID: 0x57cc)
[00:03:19.457,763] <inf> zigbee_app_utils: Device update received (short: 0xe3f3, long: f4ce36dec1d2db97, s tatus: 1)
[00:03:19.709,777] <inf> zigbee_app_utils: New device commissioned or rejoined (short: 0xe3f3)
[00:03:20.664,642] <inf> zigbee_app_utils: Device authorization event received (short: 0xe3f3, long: f4ce36 dec1d2db97, authorization type: 1, authorization status: 0)
[00:03:20.769,897] <inf> zigbee_app_utils: Unimplemented signal (signal: 54, status: 0)

Despite the fact that the PAN Id for the router is set different from that generated a coordinator (0x57ca vs 0x57cc), the router still successfully connected to the network. How can I make sure that the router connects only to a specific network with a specific PAN Id?

Parents
  • Hello,

    I have forwarded your question internally and I'll get back to you when I get a reply.

    In the mean time, I will also share some initial thoughts:

    Using PAN ID as a criteria for finding a network suitable in the network steering procedure will require some changes on the appliation level. See Chs. 8.1 and 8.2 in the Zigbee PRO Base Device Behavior Specification, v3.0.1.

    Transmitting network data OOB seems similar to the touchlink commissioning procedure. Have you looked into that method? See Chs. 8.6 and 8.7 in the Zigbee PRO Base Device Behavior Specification, v3.0.1.

    Best regards,

    Maria

  • Thank you for your reply, Maria

    We studied touchlink a little, and it really serves similar purposes as our OOB, but unfortunately our coordinator is a finished device with closed source code and it does not support touchlink.

    If we cannot use PAN ID to specify a specific network to connect to, perhaps we could use Extended PAN ID for this purpose? This is acceptable for our task.

    In a similar way, using shell example, we tried to set Extended PAN Id with the bdb extpanid command, but we also did not get the required router behavior, it also connects to all networks. Also, after set bdb extpanid, the command to get the current extpanid always returns 00000000000000000, i.e. it is not actually used. If the bdb level prevents us from achieving the required behavior, perhaps we could use lower stack levels or disable bdb?

  • Dmitro Balo said:
    We studied touchlink a little, and it really serves similar purposes as our OOB, but unfortunately our coordinator is a finished device with closed source code and it does not support touchlink.

    I see, thank you for this information.

    Dmitro Balo said:
    In a similar way, using shell example, we tried to set Extended PAN Id with the bdb extpanid command, but we also did not get the required router behavior, it also connects to all networks. Also, after set bdb extpanid, the command to get the current extpanid always returns 00000000000000000, i.e. it is not actually used. If the bdb level prevents us from achieving the required behavior, perhaps we could use lower stack levels or disable bdb?

    Could you also test out using zb_set_extended_pan_id() and zb_set_pan_id() for setting extended PAN ID and PAN ID? The bdb commands in shell and the API functions seem slighly different, so it is worth to check if it makes a difference to use the API functions instead.

    Best regards,

    Maria

  • We also have our own application where we have already checked the work of the functions zb_set_extended_pan_id() and zb_set_pan_id() and got the same result as in the shell example.

    This is the code we use to set the PAN ID:

    {
        LOG_DBG("Set PAN ID");
    	LOG_DBG("Current PAN ID: %0X", zb_get_pan_id());
    	if (zigbee_is_stack_started()) {
    		LOG_WRN("Stack already started, no changed");
    		return;
    	}
    	if(zb_get_pan_id() == 0xFFFF){
    		zb_set_pan_id(0x00AC);
    	} else {
    		LOG_WRN("Device already has panid");
    	}
    	LOG_DBG("New PAN ID: %0X", zb_get_pan_id());
    }


    His log is as follows:
    [00:00:09.202,239] <dbg> Zigbee_service: OnSetPanIdReceived: Set PAN ID
    [00:00:09.202,270] <dbg> Zigbee_service: OnSetPanIdReceived: Current PAN ID: FFFF
    [00:00:09.202,270] <dbg> Zigbee_service: OnSetPanIdReceived: New PAN ID: AC

    It seems that the installation was successful, but after that our router still does not take this PAN ID into account when choosing the network to which it connects. We also noticed that after resetting the NRF, the PAN ID is again equal to 0xFFFF, i.e. it is not saved.

    This is the code we use to set the Extended PAN ID:

    LOG_DBG("Set extended PAN ID");
    zb_ext_pan_id_t extpanid;
    zb_get_extended_pan_id(extpanid);
    char ieee_addr_buf[IEEE_ADDR_BUF_SIZE] = { 0 };
    int addr_len = ieee_addr_to_str(ieee_addr_buf, sizeof(ieee_addr_buf), extpanid);
    LOG_DBG("Current Extended PAN ID: %s", ieee_addr_buf);
    
    if (zigbee_is_stack_started()) {
    	LOG_WRN("Stack already started, no changed");
    	return;
    }
    if (zigbee_is_nvram_initialised()){
    	LOG_WRN("Zigbee stack has been configured in the past.\r\n"
    	"Please disable NVRAM to change the Extended PAN ID");
    	return;
    }
    zb_ext_pan_id_t new_extpanid = { 0x99, 0xDB, 0xD3, 0xC2, 0xDE, 0x36, 0xCE, 0xF4 };
    ieee_addr_to_str(ieee_addr_buf, sizeof(ieee_addr_buf), new_extpanid);
    LOG_DBG("Try to set Extended PAN ID: %s", ieee_addr_buf);
    zb_set_extended_pan_id(new_extpanid);
    zb_get_extended_pan_id(extpanid);
    addr_len = ieee_addr_to_str(ieee_addr_buf, sizeof(ieee_addr_buf), extpanid);
    if (addr_len < 0) {
    	strcpy(ieee_addr_buf, "unknown");
    }
    LOG_DBG("Check after zb_set_extended_pan_id: %s", ieee_addr_buf);


    His log is as follows:
    [00:00:10.202,697] <dbg> Zigbee_service: OnSetExtendedPanIdReceived: Set extended PAN ID
    [00:00:10.202,880] <dbg> Zigbee_service: OnSetExtendedPanIdReceived: Current Extended PAN ID: 0000000000000000
    [00:00:10.203,125] <dbg> Zigbee_service: OnSetExtendedPanIdReceived: Try to set Extended PAN ID: f4ce36dec2d3db99
    [00:00:10.203,338] <dbg> Zigbee_service: OnSetExtendedPanIdReceived: Check after zb_set_extended_pan_id: 0000000000000000

    We perform the operations to set PAN ID and Extended PAN ID before calling zigbee_enable(). We also try to get the extended PAN ID after stack initialization (after calling zigbee_enable()) but we also get 00000000000000000
  • Thank you for sharing your results. Our experts are on this, and I'll check back in by end of Tuesday next week.

    Best regards,

    Maria

Reply Children
No Data
Related