English
English
简体中文
Register
Log In
English
English
简体中文
Register
Log In
Language
English
English
简体中文
Register
Log In

How to configure low-power Zigbee sub-devices poll and Rejoin?

Last Updated on2024-02-18 06:46:22
Poll Configuration
/*
* Zigbee poll configuration
*/
typedef struct {
UINT8_T forever_flag; ///< TRUE: forever poll if device no network(TAL_ZG_NWK_POWER_ON_ONLINE/TAL_ZG_NWK_JOIN_OK/TAL_ZG_NWK_REJOIN_OK)
UINT8_T fast_swicth_parent; ///< TRUE: if ack isn't received, will continue polling until the max number of failures is reached before switching the parent
UINT16_T interval_ms; ///< poll period (bet: ms)
UINT16_T max_failed_times; ///< enter parent-lost status when poll failed x times.
UINT16_T duration_after_data_ms; ///< tiemout waitting app ack (bet: ms)
UINT_T duration_after_join_ms; ///< wakeup time when join success.(for gateway get cluser data) (bet:ms)
UINT_T duration_after_rejoin_ms; ///< wakeup time when rejoin success.(for app use) (bet:ms)
} TAL_ZG_POLL_CFG_T;
Rejoin Configuration
/*
* Zigbee end-device rejoin config
*/
typedef struct {
UINT8_T power_on_active; ///< auto rejoin when power on.
UINT8_T send_data_active; ///< auto rejoin when send data if parent lost.
UINT8_T reserved; ///< Reserved
UINT8_T attempts; ///< max rejoin attempts when parent lost.
UINT16_T interval; ///< rejoin attempt interval when parent lost.
} TAL_ZG_REJOIN_CFG_T;
Register Device
/**
* @brief register router or sleep device
* @return none
*/
STATIC VOID_T app_sleep_device_node_init(VOID_T)
{
// sleep end device node init
TAL_ZG_NODE_CFG_T node_config = {
.node_type = ZG_SLEEPY_END_DEVICE,
.tx_power = 10,
.scan_interval = 100,
.scan_duration = ZG_SCAN_DURATION_3,
.config.sleep_ed_cfg.poll_config.forever_flag = 1,
.config.sleep_ed_cfg.poll_config.fast_swicth_parent = 1,
.config.sleep_ed_cfg.poll_config.interval_ms = 250,
.config.sleep_ed_cfg.poll_config.max_failed_times = 10,
.config.sleep_ed_cfg.poll_config.duration_after_data_ms = 1000,
.config.sleep_ed_cfg.poll_config.duration_after_join_ms = 60000,
.config.sleep_ed_cfg.poll_config.duration_after_rejoin_ms = 15000,
.config.sleep_ed_cfg.rejoin_config.power_on_active = 1,
.config.sleep_ed_cfg.rejoin_config.send_data_active = 1,
.config.sleep_ed_cfg.rejoin_config.attempts = 3,
.config.sleep_ed_cfg.rejoin_config.interval = 3000,
};
//config zigbee node
tal_zg_node_config(&node_config);
}
ElementFunctionSupplementary Explanation
forever_flagWhether the device polls the parent node periodically when connected to the networkIf there is a need for the gateway to send data to the device, it is recommended to turn it on, such as for a single-fire switch. For devices like door sensors that only report status and have no interactive commands, it can be set tofalse.
fast_swicth_parentGenerally used whenforever_flagisfalse, to quickly determine if the connection with the parent node is lostWhenforever_flagisfalse, the device may not be able to detect that it has lost connection with the parent node after sending a set of data requests. Iffast_swicth_parentis set totrue, it will continue to send data requests until it detects that the connection with the parent node is lost, thus allowing for a quick reconnection to the network.
interval_msSet the interval for sending data requests-
max_failed_timesHow many times data requests can fail without response before triggering a reconnection-
duration_after_data_msContinuous data request duration after sending data once while connectedThe number of corresponding requests isduration_after_data_msdivided byinterval_ms
duration_after_join_msContinuous data request duration after successful network configurationThe number of corresponding requests isduration_after_join_msdivided byinterval_ms
duration_after_rejoin_msContinuous data request duration after successful reconnectionThe number of corresponding requests isduration_after_rejoin_msdivided byinterval_ms
power_on_activeEnable the active reconnection mechanism when the device is powered on and the parent node is lostIt is recommended to turn it on
send_data_activeEnable the reconnection mechanism when data is sent and the parent node is lostIt is recommended to turn it on
attemptsHow many beacon requests are sent in one set when the parent node is lost-
intervalHow long to wait before sending another beacon request in one set when the parent node is lost-
Example: One reconnection attempt consists of 3 beacon requests, with an interval of 3 seconds between each beacon request.

Click for services and help

Help Center