Page 1 of 1

【已解决】使用ZT5模组配置为低功耗设备,配网一直失败

Posted: 2023年 Nov 14日 22:02
by hzb

使用SDK版本: TLSR8258_TuyaOS-3.8.0, 参看tuyaos_demo_zg_pir_tl例程中的关于低功耗节点配置,但是始终入网失败,具体配置见附件源码。 麻烦帮忙分析是什么原因导致配网失败呢?
配置如下:

Code: Select all

// sleep end device node init
     TAL_ZG_NODE_CFG_T node_config = {
         .node_type = ZG_SLEEPY_END_DEVICE,
         .tx_power = 11, //10,
         .scan_interval = 100,
         .scan_duration = ZG_SCAN_DURATION_3,
         .config.sleep_ed_cfg.poll_config.forever_flag = 0,
         .config.sleep_ed_cfg.poll_config.fast_swicth_parent = 0,
         .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);
    
//zigbee joining network configuration TAL_ZG_JOIN_CFG_T join_config = { .auto_join_power_on_flag = FALSE,//defalut power on start join or not .auto_join_remote_leave_flag = TRUE,//default start join or not when receivew remote leave request .join_timeout = ZIGBEE_JOIN_MAX_TIMEOUT,//join timeout times 120s }; tal_zg_join_config(&join_config);

使用的网关是:扩展网关,以下是网关添加子设备失败日志

Code: Select all

[11-14 21:58:27:345 TUYA D][mqc_app.c:670] Rev MQTT:{"data":{"ble_safe_v2":true,"time":120,"type":0},"protocol":200,"t":1699970307}
[11-14 21:58:27:345 TUYA D][subdev_mq.c:131] Rev Device Add Cmd
[11-14 21:58:27:345 TUYA D][subdev_mq.c:167] Tell User To Add Device Type:255 Permit:1 Time:120
[11-14 21:58:27:345 TUYA D][home_security.c:2070] alarm mode:0,alarm status:0
[11-14 21:58:27:345 TUYA D][tuya_zigbee_mgr.c:436] tp: 255 timeout: 120
[11-14 21:58:27:345 TUYA D][tuya_z3.c:16134] SUB_DEV | ZB_ADD_GATEWAY | P:0 | zb_gateway_rev_add_cmd | ERR:0 |[ msg:zigbee gateway rev add cmd succ. ]
[11-14 21:58:27:346 TUYA D][tuya_z3_api_tmp.c:7995] uTimeVal = 120.
[11-14 21:58:27:346 TUYA D][tuya_z3_api_tmp.c:8016] join open.
[11-14 21:58:27:346 TUYA D][green-power-server.c:3323] ====== emberAfGreenPowerClusterGpSinkCommissioningModeCallback ======
[11-14 21:58:27:346 TUYA D][green-power-server.c:3352] Enter sink commissioning mode
[11-14 21:58:27:375 TUYA D][green-power-server.c:3444] SinkCommissioningModeCallbacksend returned 0
[11-14 21:58:27:375 TUYA D][network-creator-security.c:295] openNetworkEventControl.status = 0.
[11-14 21:58:27:398 TUYA D][network-creator-security.c:322] openNetworkEventControl.status = 0.
[11-14 21:58:27:404 TUYA D][network-creator-security.c:327] openNetworkEventControl.status = 4.
[11-14 21:58:27:404 TUYA D][z3_slabs.c:1093] tuya permit net status: 1.
[11-14 21:58:27:404 TUYA D][tuya_z3_api_tmp.c:8043] SUB_DEV | ZB_ADD_HOST | P:2 | zb_host_join_open_add | ERR:0 |[ msg:zigbee host rev add cmd . Net open succ.]
[11-14 21:58:27:404 TUYA D][callback-stub.c:2632] Revice Green Power cmd
[11-14 21:58:27:405 TUYA D][tuya_z3_api_tmp.c:5347] Command recevice is green power
[11-14 21:58:27:405 TUYA D][tuya_z3_api_tmp.c:5349] greenpower cmd:0x02, not ZCL_GP_NOTIFICATION_COMMAND_ID
[11-14 21:58:27:405 TUYA D][green-power-client.c:166] Enter comm for sink  0
[11-14 21:58:27:411 TUYA D][af-main-host.c:1120] Ezsp Policy: set Trust Center Policy to "Allow preconfigured key joins": Success set
[11-14 21:58:27:417 TUYA D][af-main-common.c:737] pJoin for 120 sec: 0x0
[11-14 21:58:27:427 TUYA D][network-creator-security.c:406] 0x5579714f8b80: 0x5579714f8c42: 0x0
[11-14 21:58:27:446 TUYA D][tuya_z3.c:16178] g_tyz3Globals.permit:0.
[11-14 21:58:27:446 TUYA D][tuya_z3.c:16191] g_tyz3Globals.permit:1.
[11-14 21:58:27:446 TUYA D][tuya_z3.c:16229] SUB_DEV | ZB_ADD_GATEWAY | P:1 | zb_gateway_to_host_add_cmd | ERR:0 |[ msg:zigbee gateway send add cmd to zigbee host]
[11-14 21:58:27:446 TUYA N][tuya_gw_misc_api.c:109] recv dev add cmd
[11-14 21:58:27:446 TUYA D][user_main.c:275] misc device add callback
[11-14 21:58:27:446 TUYA D][user_main.c:276] permit: 1, timeout: 120
[11-14 21:58:27:446 TUYA D][mqc_app.c:879] Send MQTT Msg.P:201 N:3637 Q:0 Data:{"type":"0"}
[11-14 21:58:28:316 TUYA D][af-main-common.c:970] SUCCESS: tx 0, Nodeid:0xfffd, clusterId:0x0021, num:0, sequence:119.
[11-14 21:58:28:445 TUYA D][af-main-common.c:970] SUCCESS: tx 0, Nodeid:0xfffc, clusterId:0x0036, num:0, sequence:120.
[11-14 21:58:28:911 TUYA D][app_agent.c:1457] new client connect. nums:1 cfd:26 ip:0xc0a80006
[11-14 21:58:28:937 TUYA D][app_agent.c:1538] fd:26, wk_stat = 2, type = 3
[11-14 21:58:28:937 TUYA D][app_agent.c:950] lan version over 3.4
[11-14 21:58:28:937 TUYA D][app_agent.c:959] local_key
[11-14 21:58:28:937 TUYA D][app_agent.c:596] send length:64, id:26, sequence_out:10527
[11-14 21:58:28:970 TUYA D][app_agent.c:1538] fd:26, wk_stat = 2, type = 5
[11-14 21:58:28:970 TUYA D][app_agent.c:950] lan version over 3.4
[11-14 21:58:28:970 TUYA D][app_agent.c:959] local_key
[11-14 21:58:28:998 TUYA D][app_agent.c:1538] fd:26, wk_stat = 2, type = 16
[11-14 21:58:28:998 TUYA D][app_agent.c:950] lan version over 3.4
[11-14 21:58:28:998 TUYA D][app_agent.c:956] session_key
[11-14 21:58:28:998 TUYA D][smart_frame.c:2429] Pack local dp, reset_flow_ctl:0,dpnum:1.
[11-14 21:58:28:998 TUYA D][smart_frame.c:2517] Nothing To Pack
[11-14 21:58:28:998 TUYA D][app_agent.c:1232] nothing to report
[11-14 21:58:28:998 TUYA D][app_agent.c:596] send length:32, id:26, sequence_out:10528
[11-14 21:58:28:999 TUYA D][app_agent.c:1538] fd:26, wk_stat = 2, type = 64
[11-14 21:58:28:999 TUYA D][app_agent.c:950] lan version over 3.4
[11-14 21:58:28:999 TUYA D][app_agent.c:956] session_key
[11-14 21:58:28:999 TUYA D][app_agent.c:1715] reqType:subdev_online_stat_query
[11-14 21:58:28:999 TUYA D][subdev_hb_ol.c:1730] Rev DEV_OL_LAN_QUERY CMD
[11-14 21:58:29:499 TUYA D][subdev_hb_ol.c:1621] lan report end
[11-14 21:58:31:766 TUYA D][device-table-discovery.c:1348] TC Join Callback 291c , decision: 0, status: 1
[11-14 21:58:31:766 TUYA D][device-table-discovery.c:1356] ****** newNodeEui64  a4c138a6eddd80c9  STANDARD_SECURITY_UNSECURED_JOIN ******
[11-14 21:58:31:766 TUYA D][af-trust-center.c:177] Trust Center Join Handler: status = 0x5579714f4cff, decision = 0x5579714f4cb0 (0), shortid 0x291c
[11-14 21:58:39:90 TUYA D][device-table-discovery.c:1348] TC Join Callback 291c , decision: 0, status: 1
[11-14 21:58:39:90 TUYA D][device-table-discovery.c:1356] ****** newNodeEui64  a4c138a6eddd80c9  STANDARD_SECURITY_UNSECURED_JOIN ******
[11-14 21:58:39:90 TUYA D][af-trust-center.c:177] Trust Center Join Handler: status = 0x5579714f4cff, decision = 0x5579714f4cb0 (0), shortid 0x291c
[11-14 21:58:46:427 TUYA D][device-table-discovery.c:1348] TC Join Callback 291c , decision: 0, status: 1
[11-14 21:58:46:427 TUYA D][device-table-discovery.c:1356] ****** newNodeEui64  a4c138a6eddd80c9  STANDARD_SECURITY_UNSECURED_JOIN ******
[11-14 21:58:46:427 TUYA D][af-trust-center.c:177] Trust Center Join Handler: status = 0x5579714f4cff, decision = 0x5579714f4cb0 (0), shortid 0x291c
[11-14 21:58:53:751 TUYA D][device-table-discovery.c:1348] TC Join Callback 291c , decision: 0, status: 1
[11-14 21:58:53:751 TUYA D][device-table-discovery.c:1356] ****** newNodeEui64  a4c138a6eddd80c9  STANDARD_SECURITY_UNSECURED_JOIN ******
[11-14 21:58:53:751 TUYA D][af-trust-center.c:177] Trust Center Join Handler: status = 0x5579714f4cff, decision = 0x5579714f4cb0 (0), shortid 0x291c
[11-14 21:58:54:682 TUYA D][device-table-discovery.c:1435] ZDOMessageReceived node id:0x0000 ,cluster:0x8038 
[11-14 21:58:54:682 TUYA D][device-table-discovery.c:1498] Untracked ZDO 8038
[11-14 21:58:54:682 TUYA D][ias-zone-client.c:630] Incoming ZDO, Cluster: 0x8038
[11-14 21:59:01:91 TUYA D][device-table-discovery.c:1348] TC Join Callback 291c , decision: 0, status: 1
[11-14 21:59:01:91 TUYA D][device-table-discovery.c:1356] ****** newNodeEui64  a4c138a6eddd80c9  STANDARD_SECURITY_UNSECURED_JOIN ******
[11-14 21:59:01:91 TUYA D][af-trust-center.c:177] Trust Center Join Handler: status = 0x5579714f4cff, decision = 0x5579714f4cb0 (0), shortid 0x291c
[11-14 21:59:02:425 TUYA D][mqtt_client.c:203] mqtt_ping -->>
[11-14 21:59:02:425 TUYA D][mqtt_client.c:221] mqtt_ping <<--
[11-14 21:59:02:438 TUYA D][mqtt_client.c:1239] ping respond. update fail_cnt:0
[11-14 21:59:08:423 TUYA D][device-table-discovery.c:1348] TC Join Callback 291c , decision: 0, status: 1
[11-14 21:59:08:423 TUYA D][device-table-discovery.c:1356] ****** newNodeEui64  a4c138a6eddd80c9  STANDARD_SECURITY_UNSECURED_JOIN ******
[11-14 21:59:08:423 TUYA D][af-trust-center.c:177] Trust Center Join Handler: status = 0x5579714f4cff, decision = 0x5579714f4cb0 (0), shortid 0x291c
[11-14 21:59:15:17 TUYA D][tuya_z3_api_tmp.c:6686]  Packet free num: 234.
[11-14 21:59:15:745 TUYA D][device-table-discovery.c:1348] TC Join Callback 291c , decision: 0, status: 1
[11-14 21:59:15:745 TUYA D][device-table-discovery.c:1356] ****** newNodeEui64  a4c138a6eddd80c9  STANDARD_SECURITY_UNSECURED_JOIN ******
[11-14 21:59:15:745 TUYA D][af-trust-center.c:177] Trust Center Join Handler: status = 0x5579714f4cff, decision = 0x5579714f4cb0 (0), shortid 0x291c
[11-14 21:59:23:89 TUYA D][device-table-discovery.c:1348] TC Join Callback 291c , decision: 0, status: 1
[11-14 21:59:23:89 TUYA D][device-table-discovery.c:1356] ****** newNodeEui64  a4c138a6eddd80c9  STANDARD_SECURITY_UNSECURED_JOIN ******
[11-14 21:59:23:89 TUYA D][af-trust-center.c:177] Trust Center Join Handler: status = 0x5579714f4cff, decision = 0x5579714f4cb0 (0), shortid 0x291c
[11-14 21:59:30:414 TUYA D][device-table-discovery.c:1348] TC Join Callback 291c , decision: 0, status: 1
[11-14 21:59:30:414 TUYA D][device-table-discovery.c:1356] ****** newNodeEui64  a4c138a6eddd80c9  STANDARD_SECURITY_UNSECURED_JOIN ******
[11-14 21:59:30:414 TUYA D][af-trust-center.c:177] Trust Center Join Handler: status = 0x5579714f4cff, decision = 0x5579714f4cb0 (0), shortid 0x291c
[11-14 21:59:31:8 TUYA D][mqc_app.c:670] Rev MQTT:{"data":{"ble_safe_v2":true,"time":0,"type":0},"protocol":200,"t":1699970371}
[11-14 21:59:31:8 TUYA D][subdev_mq.c:131] Rev Device Add Cmd
[11-14 21:59:31:8 TUYA D][subdev_mq.c:167] Tell User To Add Device Type:255 Permit:0 Time:0
[11-14 21:59:31:8 TUYA D][tuya_zigbee_mgr.c:436] tp: 255 timeout: 0
[11-14 21:59:31:9 TUYA D][tuya_z3_api_tmp.c:7995] uTimeVal = 0.
[11-14 21:59:31:9 TUYA D][tuya_z3_api_tmp.c:7998] join diable.
[11-14 21:59:31:9 TUYA D][z3_slabs.c:1093] tuya permit net status: 0.
[11-14 21:59:31:9 TUYA D][green-power-server.c:3323] ====== emberAfGreenPowerClusterGpSinkCommissioningModeCallback ======
[11-14 21:59:31:9 TUYA D][green-power-server.c:3418] Exit sink commissioning mode
[11-14 21:59:31:27 TUYA D][green-power-server.c:3444] SinkCommissioningModeCallbacksend returned 0
[11-14 21:59:31:33 TUYA D][af-main-common.c:737] pJoin for 0 sec: 0x0
[11-14 21:59:31:43 TUYA D][callback-stub.c:2632] Revice Green Power cmd
[11-14 21:59:31:43 TUYA D][tuya_z3_api_tmp.c:5347] Command recevice is green power
[11-14 21:59:31:43 TUYA D][tuya_z3_api_tmp.c:5349] greenpower cmd:0x02, not ZCL_GP_NOTIFICATION_COMMAND_ID
[11-14 21:59:31:43 TUYA D][green-power-client.c:98] Exit comm for sink  0
[11-14 21:59:31:109 TUYA D][tuya_z3.c:16201] g_tyz3Globals.permit:1.
[11-14 21:59:31:109 TUYA N][tuya_gw_misc_api.c:109] recv dev add cmd
[11-14 21:59:31:109 TUYA D][user_main.c:275] misc device add callback
[11-14 21:59:31:109 TUYA D][user_main.c:276] permit: 0, timeout: 0
[11-14 21:59:31:109 TUYA D][mqc_app.c:879] Send MQTT Msg.P:201 N:3638 Q:0 Data:{"type":"0"}
[11-14 21:59:31:943 TUYA D][af-main-common.c:948] ERROR: tx 66, Nodeid:0xfffd, clusterId:0x0021, num:0, sequence:131.
[11-14 21:59:32:7 TUYA D][af-main-common.c:948] ERROR: tx 66, Nodeid:0xfffc, clusterId:0x0036, num:1, sequence:132.


Re: 使用ZT5模组配置为低功耗设备,配网一直失败

Posted: 2023年 Nov 16日 11:48
by zeso

您好,设备是否烧录授权过?


Re: 使用ZT5模组配置为低功耗设备,配网一直失败

Posted: 2023年 Nov 16日 23:53
by hzb

烧录过的, 改成router节点配置,是能够正常入网的。
//router节点配置
TAL_ZG_NODE_CFG_T node_config = {
.node_type = ZG_ROUTER,
.tx_power = 11,
.scan_interval = 0,
.scan_duration = ZG_SCAN_DURATION_3,
};
tal_zg_node_config(&node_config);


Re: 使用ZT5模组配置为低功耗设备,配网一直失败

Posted: 2023年 Nov 17日 09:48
by zeso

app_config.json的配置贴一下,如果有条件也附一下配网流程的抓包


Re: 使用ZT5模组配置为低功耗设备,配网一直失败

Posted: 2023年 Nov 19日 19:40
by huanghuan

你好:
1.demo程序我们是经过验证是可以配网成功的,你可以先使用不改动任何程序原始demo进行配网尝试
2.请确认是否经过烧录授权,指的是使用涂鸦产测上位机进行的授权步骤,否则可能会导致新建的pid无法配网成功跳出面板
3.有抓包器的话可以抓下无线包便于我们分析问题,谢谢


Re: 使用ZT5模组配置为低功耗设备,配网一直失败

Posted: 2023年 Nov 20日 14:21
by hzb

应该是烧录过授权的,模组是固件下单烧的是通用固件, 并且我配置成router节点,是能够入网的。
主要目前我手上没dongle工具,暂时抓不了zigbee包,可以看下我上传附近的网关日志 和 tuya_sdk_callback.c帮忙分析下。
另外晚点,我试下demo的pir低功耗例程,看是否能配网


Re: 使用ZT5模组配置为低功耗设备,配网一直失败

Posted: 2023年 Nov 26日 11:03
by hzb

已解决,参考demo的tuyaos_demo_zg_pir_tl例程,并appconfig.json 将"dev_role"设置为"sleep_end_dev" 可以入网,并进入低功耗了