This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Zigbee: Giving end device permission to join network

Hi,

I'm working with the nrf52840-DK and using the nRF5 SDK v15.2.0 Stack version.

I´ve got a working program for my coordinator (C) and my end device (ED). The C establishes the network successfully, the ED is able to join and they are both able to send messages to each other, by pressing one of the buttons on the nrf52840 DK. It also works to find out the short address and other information about the new joined device.
NOTE: I attached my coordinators main, buttons_handler_function, and zboss_signal_handler below.

As soon as the ED is switched on, it starts searching for a network, if it is in range of my C, it instantly joins the network. Now I want my C not to respond to the joining requests of the the ED unless one of the C buttons is pressed.

So far I couldn´t find a way to control the commissioning/joining procedure. Feels like Zigbee is managing all of this stuff by it self and is giving me just an interrupt in the zboss_signal_handler. It jumps correctly into the case ZB_ZDO_SIGNAL_DEVICE_ANNCE, which gives me the chance to get all the informations about the new device (as mentioned above) and call other functions. But at the time I get the interrupt in the zboss_signal_handler, the joining procedure is already done!

I already figured out that I could change -> ZB_DEFAULT_PRMIT_JOINING_DURATION   0xff  (in zb_config_common.h ). But I don´t know on which value I have to set ZB_DEFAULT_PRMIT_JOINING_DURATION in order to lower the permit time to a few seconds. But this still won´t enable me to control the commissioning/joining procedure.


So my two issues that I´m struggling with are:

1. How to control the commissioning/joining procedure?

2. Do I have to reduce the joining duration and how do I do that?

Thanks
Greetings Luke

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "zboss_api.h"
#include "zboss_api_aps.h"
#include "zb_mem_config_med.h"
#include "zb_error_handler.h"
#include "zb_zcl_commands.h"
#include "zb_zcl_basic.h"
#include "bsp.h"
#include "boards.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#define MAX_CHILDREN 2 /**< The maximum amount of connected devices. Setting this value to 0 disables association to this device. */
#define IEEE_CHANNEL_MASK (1l << ZIGBEE_CHANNEL) /**< Scan only one, predefined channel to find the coordinator. */
#define COORDINATOR_ENDPOINT 10 /**< Device endpoint, used to receive light controlling commands. */
#define ERASE_NVRAM_AT_REBOOT ZB_FALSE /**< Do not erase NVRAM to save the network parameters after device reboot or power-off. */
#define ZB_ON_STATUS BSP_BOARD_LED_0 //LED indicating that device boot was successful
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX