我发现初始化时将设备类型从 ZG_SLEEPY_END_DEVICE 改为 ZG_END_DEVICE,就可以收到网关下发的数据
Code: Select all
STATIC VOID_T app_end_device_node_init(VOID_T)
{
TAL_ZG_NODE_CFG_T node_config = {
.node_type = ZG_END_DEVICE,
.tx_power = 10,
.scan_interval = 200,
.scan_duration = ZG_SCAN_DURATION_3,
.config.ed_cfg.poll_config.forever_flag = 0,
.config.ed_cfg.poll_config.fast_swicth_parent = 1,
.config.ed_cfg.poll_config.interval_ms = 1000,
.config.ed_cfg.poll_config.max_failed_times = 5,
.config.ed_cfg.poll_config.duration_after_data_ms = 2000,
.config.ed_cfg.poll_config.duration_after_join_ms = 30000,
.config.ed_cfg.poll_config.duration_after_rejoin_ms = 15000,
.config.ed_cfg.rejoin_config.power_on_active = 1,
.config.ed_cfg.rejoin_config.send_data_active = 1,
.config.ed_cfg.rejoin_config.attempts = 3,
.config.ed_cfg.rejoin_config.interval = 1000,
};
//config zigbee node
tal_zg_node_config(&node_config);
}
但改完后,会一直收到 cluster 0x00, cmd 0x00,然后过一段时间就自动重启了
重启原因是软复位
Code: Select all
[D] : app general msg cb: cluster 0x00, cmd 0x00, payload_len: 2
[D] : payload:
01 00
[D] : app general msg cb: cluster 0x00, cmd 0x00, payload_len: 2
[D] : payload:
01 00
[D] : app general msg cb: cluster 0x00, cmd 0x00, payload_len: 2
[D] : payload:
01 00
[D] : app general msg cb: cluster 0x00, cmd 0x00, payload_len: 2
[D] : payload:
01 00
[D] : app general msg cb: cluster 0x00, cmd 0x00, payload_len: 2
[D] : payload:
01 00
[D] : app general msg cb: cluster 0x00, cmd 0x00, payload_len: 2
[D] : payload:
01 00
[D] : app general msg cb: cluster 0x00, cmd 0x00, payload_len: 2
[D] : payload:
01 00
省略...
[I] : wopener device init start ...
[I] : poweron reset reason: 4, msg: Software triggered reset (TY_RST_SOFTWARE)