Page 1 of 1

【已解决】【TuyaOS SDK】【x86_64_tuyaos_demo_ipc】如何直接输入token进行设备配对

Posted: 2024年 Jan 4日 11:01
by wink

Hello, 涂鸦的同仁们,有个问题想请教一下。
之前github上的ipc demo(旧版本sdk 5.3.40)可以直接输入设备 pid,uuid,authorkey 和APP上的二维码token,就可以直接配对成功,输出demo流。
但现在运行TuyaOS的x86 demo,输入相关信息都没有进入配对流程:

qxtech@qxtech-virtual-machine:~/Documents/tuya/Projects/X86_64_TuyaOS-3.9.0/software/TuyaOS$ ./output/x86_64_tuyaos_demo_ipc/firmware/tuyaos_demo_ipc -c ./apps/tuyaos_demo_ipc/ -m 2 -t AYPVEWzz0omLW8
[main, 572] Jan 3 2024,15:24:56 token[AYPVEWzz0omLW8] raw_path[/tmp/] cfg_path[./apps/tuyaos_demo_ipc//tuya_device_cfg.json]
detect auto test enviroment, load config from ./apps/tuyaos_demo_ipc//tuya_device_cfg.json
buffer is {
"pid":"xxxxxxxxx",
"uuid": "xxxxxxxxxxxxxxxx",
"authkey": "xxxxxxxxxxxxxxxxx",
"storage": "./",
"media_path": "./",
"sd_path": "/tmp/",
"token": "AYPVEWzz0omLW8",
"upgrade_file": "/tmp/upgrade.file",
"app_version": "1.2.3"
}

s_ipc_pid: rambuyexhc6iibik
s_ipc_uuid: qx06bf340fcdafc70521
s_ipc_authkey: 3UNk2zWTIzrxwO27CdZI6LJuCs0rLEca
s_ipc_storage: ./
s_raw_path: ./
s_ipc_sd_path: /tmp/
s_ipc_upgrade_file: /tmp/upgrade.file
s_app_version: 1.2.3
SDK Version:< TuyaOS V:6.1.0 BS:40.00_PT:2.3_LAN:3.5_CAD:1.0.5_CD:1.0.0 >
< BUILD AT:2023_11_23_17_43_32 BY ci_manage FOR tuyaos-ipc AT x86_64 >
IOT DEFS < WIFI_GW:1 DEBUG:0 KV_FILE:0 LITTLE_END:1 SL:1 OPERATING_SYSTEM:100 RELIABLE_TRANSFER:0 >

MODE:2 LINK_TYPE:2
[01-01 00:00:00 ty I][tal_thread.c:185] thread_create name:sys_timer,stackDepth:4096,totalstackDepth:4096,priority:5
[01-01 00:00:00 ty I][tal_thread.c:185] thread_create name:wq_system,stackDepth:6144,totalstackDepth:10240,priority:3
[01-01 00:00:00 ty I][tal_thread.c:185] thread_create name:wq_highpri,stackDepth:5120,totalstackDepth:15360,priority:4
[01-01 00:00:00 ty I][tal_thread.c:185] thread_create name:health_monitor,stackDepth:1536,totalstackDepth:16896,priority:5
[01-01 00:00:00 ty I][mqc_app.c:429] mqc app init ...
[01-01 00:00:00 ty E][log_seq.c:873] logseq empty
[01-01 00:00:00 ty I][kv_storge.c:45] Init Kvs With File:./
[01-01 00:00:00 ty N][tal_wifi_reconnet.c:208] wifi status changed to 0
[01-01 00:00:00 ty N][tuya_tls.c:852] uni_random_init...
[01-01 00:00:00 ty I][tal_thread.c:185] thread_create name:lan_sock_loop,stackDepth:4096,totalstackDepth:20992,priority:3
[01-01 00:00:00 ty N][tuya_tls.c:279] tuya_tls_rand_init ok!
[01-01 00:00:00 ty N][tuya_wifi_connect.c:289] mf is open need stop fastconnect
[01-01 00:00:00 ty D][tuya_ipc_media_adapter.c:97] media adapter init success. avaliable_res_size:5000
[01-01 00:00:00 ty D][tuya_ipc_media_adapter.c:465] insert media info node success! device:[0] channel:[0]
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:0 Enable:1
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:577] video_bitrate 1024, video_fps 30
[01-01 00:00:00 ty D][tuya_ring_buffer.c:637] Init Ring Buffer. ch0st0tr0 bitrate:1024 fps:30
[01-01 00:00:00 ty D][tuya_ring_buffer.c:660] Ring buffer malloc 1310720 bytes for ch0st0tr0, max frame size 196608
[01-01 00:00:00 ty I][tuya_ring_buffer.c:681] Init Ring Buffer success: ch0st0tr0 size:1310720 nodes:300
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:585] init ring buffer success. channel:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:1 Enable:1
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:577] video_bitrate 512, video_fps 30
[01-01 00:00:00 ty D][tuya_ring_buffer.c:637] Init Ring Buffer. ch0st0tr1 bitrate:512 fps:30
[01-01 00:00:00 ty D][tuya_ring_buffer.c:660] Ring buffer malloc 655360 bytes for ch0st0tr1, max frame size 98304
[01-01 00:00:00 ty I][tuya_ring_buffer.c:681] Init Ring Buffer success: ch0st0tr1 size:655360 nodes:300
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:585] init ring buffer success. channel:1
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:2 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:3 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:4 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:5 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:6 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:7 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:8 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:9 Enable:1
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:568] audio_sample 8000, audio_databits 16, audio_fps 25
[01-01 00:00:00 ty D][tuya_ring_buffer.c:637] Init Ring Buffer. ch0st0tr9 bitrate:125 fps:25
[01-01 00:00:00 ty D][tuya_ring_buffer.c:660] Ring buffer malloc 160000 bytes for ch0st0tr9, max frame size 23936
[01-01 00:00:00 ty I][tuya_ring_buffer.c:681] Init Ring Buffer success: ch0st0tr9 size:160000 nodes:250
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:585] init ring buffer success. channel:9
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:10 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:11 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:12 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:13 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:14 Enable:0
[01-01 00:00:00 ty D][ty_sdk_media_callback.c:559] init ring buffer Channel:0 Stream:15 Enable:0
[01-01 00:00:00 ty D][main.c:339] TJDEBUG ====================================================================== tuya_ipc_app_start:339

[01-01 00:00:00 ty D][simplekv.c:1128] read key:gw_bi isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1159] find key:1 gw_bi
[01-01 00:00:00 ty D][simplekv.c:1185] key:gw_bi find value.Len:224
[01-01 00:00:00 ty D][tuya_ws_db.c:651] sync to protected len[223]
[01-01 00:00:00 ty D][ws_db_gw.c:146] gw_bi read ret:0
[01-01 00:00:00 ty D][simplekv.c:1128] read key:gw_wsm isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1159] find key:2 gw_wsm
[01-01 00:00:00 ty D][simplekv.c:1185] key:gw_wsm find value.Len:144
[01-01 00:00:00 ty D][tuya_ws_db.c:651] sync to protected len[140]
[01-01 00:00:00 ty D][ws_db_gw.c:255] gw_wsm read ret:0
[01-01 00:00:00 ty N][tuya_svc_devos.c:494] Last reset reason: 7
[01-01 00:00:00 ty D][simplekv.c:1128] read key:gw_bi isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1159] find key:1 gw_bi
[01-01 00:00:00 ty D][simplekv.c:1185] key:gw_bi find value.Len:224
[01-01 00:00:00 ty D][tuya_ws_db.c:651] sync to protected len[223]
[01-01 00:00:00 ty D][ws_db_gw.c:146] gw_bi read ret:0
[01-01 00:00:00 ty D][simplekv.c:1128] read key:gw_wsm isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1159] find key:2 gw_wsm
[01-01 00:00:00 ty D][simplekv.c:1185] key:gw_wsm find value.Len:144
[01-01 00:00:00 ty D][tuya_ws_db.c:651] sync to protected len[140]
[01-01 00:00:00 ty D][ws_db_gw.c:255] gw_wsm read ret:0
[01-01 00:00:00 ty N][tuya_svc_devos.c:299] gw_cntl->gw_wsm.stat:0
[01-01 00:00:00 ty D][simplekv.c:1128] read key:gw_di isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1159] find key:3 gw_di
[01-01 00:00:00 ty D][simplekv.c:1185] key:gw_di find value.Len:672
[01-01 00:00:00 ty D][ws_db_gw.c:372] gw_di read ret:0
[01-01 00:00:00 ty D][simplekv.c:1128] read key:is_stride isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1156] no key find
[01-01 00:00:00 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[01-01 00:00:00 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[01-01 00:00:00 ty D][tuya_devos_stride.c:55] stride from flash: 0.
[01-01 00:00:00 ty D][tuya_devos_stride.c:62] no actived, no upgrade:0
[01-01 00:00:00 ty N][tuya_svc_devos.c:347] gw_cntl->gw_if.abi:0 input:0
[01-01 00:00:00 ty N][tuya_svc_devos.c:348] gw_cntl->gw_if.product_key:rambuyexhc6iibik, input:rambuyexhc6iibik
[01-01 00:00:00 ty N][tuya_svc_devos.c:349] gw_cntl->gw_if.tp:0, input:0
[01-01 00:00:00 ty D][simplekv.c:1128] read key:gw_ai isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1159] find key:4 gw_ai
[01-01 00:00:00 ty D][simplekv.c:1185] key:gw_ai find value.Len:352
[01-01 00:00:00 ty D][ws_db_gw.c:454] gw_ai read ret:0
[01-01 00:00:00 ty N][tuya_svc_devos.c:523] enter success_proc
WIFI Get MAC 00-0C-29-A7-95-F4
[01-01 00:00:00 ty N][tuya_svc_devos.c:526] serial_no:000c29a795f4
[01-01 00:00:00 ty D][tuya_devos_utils.c:295] timer ID:410012016
[01-01 00:00:00 ty D][tuya_svc_upgrade.c:1291] tuya svc upgrade init success!
[01-01 00:00:00 ty D][simplekv.c:1128] read key:rcs.active isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1156] no key find
[01-01 00:00:00 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[01-01 00:00:00 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[01-01 00:00:00 ty D][tuya_ws_db.c:657] rcs.active not found in kv, read from protected
[01-01 00:00:00 ty D][simplekv.c:1128] read key:rcs.mf isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1156] no key find
[01-01 00:00:00 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[01-01 00:00:00 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[01-01 00:00:00 ty D][tuya_ws_db.c:657] rcs.mf not found in kv, read from protected
[01-01 00:00:00 ty D][tuya_register_center.c:350] use default rcs [-6]
[01-01 00:00:00 ty D][simplekv.c:1128] read key:tls_ca_cnt isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1159] find key:6 tls_ca_cnt
[01-01 00:00:00 ty D][simplekv.c:1185] key:tls_ca_cnt find value.Len:16
[01-01 00:00:00 ty D][tuya_cert_manager.c:467] tls_ca_cnt:1 and parse:1
[01-01 00:00:00 ty D][simplekv.c:1128] read key:tls_ca0 isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1159] find key:5 tls_ca0
[01-01 00:00:00 ty D][simplekv.c:1185] key:tls_ca0 find value.Len:736
[01-01 00:00:00 ty D][tuya_cert_manager.c:497] Parse DER tls_ca0:540 success
[01-01 00:00:00 ty D][tuya_register_center.c:308] def rcs url0:h3.iot-dns.com
[01-01 00:00:00 ty D][tuya_register_center.c:311] def rcs urlx:h6.iot-dns.com
[01-01 00:00:00 ty D][tuya_cert_manager.c:963] psk key was 1.0
[01-01 00:00:00 ty D][tuya_cert_manager.c:1058] cert manager init
[01-01 00:00:00 ty D][simplekv.c:1128] read key:kv.meta.report isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1156] no key find
[01-01 00:00:00 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[01-01 00:00:00 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[01-01 00:00:00 ty D][ty_meta_report.c:97] meta in kv {"metas":{}}
[01-01 00:00:00 ty D][mqc_app.c:103] mq_pro:300 cnt:3
[01-01 00:00:00 ty D][mqc_app.c:103] mq_pro:302 cnt:4
[01-01 00:00:00 ty D][mqc_app.c:103] mq_pro:304 cnt:5
[01-01 00:00:00 ty D][mqc_app.c:103] mq_pro:307 cnt:6
[01-01 00:00:00 ty D][mqc_app.c:103] mq_pro:308 cnt:7
[01-01 00:00:00 ty D][mqc_app.c:103] mq_pro:312 cnt:8
[01-01 00:00:00 ty D][tuya_ipc_mqtt_subscribe.c:292] iot_register_extra_mqt_cb done
[01-01 00:00:00 ty D][tuya_ipc_sdk_init.c:105] sys add timer: 410018736

[01-01 00:00:00 ty D][tuya_ipc_sdk_init.c:111] sys start timer: 410018736

[01-01 00:00:00 ty D][tuya_iot_base_api.c:316] register wired network monitor. interval:1
[01-01 00:00:00 ty D][main.c:348] tuya ipc sdk start is complete

[01-01 00:00:00 ty N][tuya_svc_netmgr_linkage.c:270] default linkage[1] is set
[01-01 00:00:00 ty D][tuya_svc_devos.c:760] state change from 0 to 1
[01-01 00:00:00 ty D][svc_netcfg_qrcode.c:127] start config
[01-01 00:00:00 ty D][main.c:600] connect tuya ipc

[01-01 00:00:00 ty D][tuya_svc_mqtt_direct.c:264] start direct mqtt
[01-01 00:00:00 ty D][uni_network.c:312] set_dns_cache_priority:1
[01-01 00:00:00 ty D][simplekv.c:1248] delete key:tls_ca_cnt isFuzzy:0
[01-01 00:00:00 ty D][simplekv.c:1254] cnt:7 delete bit arr len:1
[01-01 00:00:00 ty D][simplekv.c:1279] delete key find 6
[01-01 00:00:00 ty D][simplekv.c:1311] Delete key:tls_ca_cnt 6 success
[01-01 00:00:00 ty D][simplekv.c:207] update crc 2942921170
[01-01 00:00:00 ty D][simplekv.c:356] write head to normal file success
[01-01 00:00:00 ty D][simplekv.c:1320] Delete success
[01-01 00:00:00 ty D][simplekv.c:1248] delete key:tls_ca isFuzzy:1
[01-01 00:00:00 ty D][simplekv.c:1254] cnt:7 delete bit arr len:1
[01-01 00:00:00 ty D][simplekv.c:1273] fuzzy del find 5 tls_ca0 And set Arr[0]=0x20
[01-01 00:00:00 ty D][simplekv.c:1303] Delete key:5 tls_ca0
[01-01 00:00:00 ty D][simplekv.c:207] update crc 1593735922
[01-01 00:00:00 ty D][simplekv.c:356] write head to normal file success
[01-01 00:00:00 ty D][simplekv.c:1320] Delete success
[01-01 00:00:00 ty D][simplekv.c:1128] read key:tls_ca_cnt isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1156] no key find
[01-01 00:00:00 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[01-01 00:00:00 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[01-01 00:00:00 ty D][tuya_cert_manager.c:463] load tls_ca_cnt fail. no ca in local db
[01-01 00:00:00 ty D][iot_httpc.c:1367] http_iot_dns_get_cloud_url start
[01-01 00:00:00 ty D][iot_httpc.c:1412] http_dns region , send: {"env":"pro","config":[{"key":"httpUrl","need_ca":false},{"key":"mqttUrl","need_ca":false},{"key":"httpsPSKUrl","need_ca":false},{"key":"mqttsPSK3Url","need_ca":false},{"key":"httpsStdUrl","need_ca":true},{"key":"mqttsStdUrl","need_ca":true},{"key":"ghostUrl","need_ca":true}]}
[01-01 00:00:00 ty D][tuya_register_center.c:434] rcs.urlx:h6.iot-dns.com
[01-01 00:00:00 ty D][iot_httpc.c:1416] get url config:https://h6.iot-dns.com/v1/url_config
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
[01-01 00:00:00 ty D][httpc.c:620] Connect: h6.iot-dns.com Port: 443 -->>
[01-01 00:00:00 ty D][uni_network.c:230] unw_gethostbyname h6.iot-dns.com, prio 1
[01-01 00:00:00 ty D][uni_network.c:258] use system dns ip 42.192.31.176 for domain h6.iot-dns.com

[01-01 00:00:00 ty D][uni_network.c:185] cache dns [h6.iot-dns.com]<->[42.192.31.176]
[01-01 00:00:00 ty D][tcp_transporter.c:79] bind ip:c0a80c80 port:0 ok
[01-01 00:00:00 ty D][tuya_tls.c:945] MAX SECURITY_LEVEL:1, TUYA SECURITY_LEVEL:1, mode:1
[01-01 00:00:00 ty D][tuya_tls.c:954] TUYA_TLS Begin Connect h6.iot-dns.com:443
[01-01 00:00:00 ty D][tuya_tls.c:714] mbedtls authmode: MBEDTLS_SSL_VERIFY_REQUIRED
[01-01 00:00:00 ty D][tuya_tls.c:727] load tuya cert.
[01-01 00:00:00 ty D][tuya_cert_manager.c:209] iot-dns url
[01-01 00:00:00 ty D][tuya_tls.c:1036] socket fd is set. set to inner send/recv to handshake
[01-01 00:00:00 ty D][tuya_tls.c:687] mbedtls_cert_pkey_free.
[01-01 00:00:00 ty D][tuya_tls.c:1098] handshake finish for h6.iot-dns.com. set send/recv to user set
[01-01 00:00:00 ty D][tuya_tls.c:1104] TUYA_TLS Success Connect h6.iot-dns.com:443 Suit:TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
[01-01 00:00:00 ty D][httpc.c:622] Connect: h6.iot-dns.com Port: 443 --<< ,r:0
[01-01 00:00:00 ty D][tls_transporter.c:93] tls transporter close socket fd:6
[01-01 00:00:00 ty D][tcp_transporter.c:177] tcp transporter close socket fd:6
[01-01 00:00:00 ty D][tls_transporter.c:101] tls transporter close tls handler:0x7f474c003ae0
[01-01 00:00:00 ty D][tuya_tls.c:1180] TUYA_TLS Disconnect ENTER
[01-01 00:00:00 ty D][tuya_tls.c:1205] TUYA_TLS Disconnect Success
[01-01 00:00:00 ty D][tuya_tls.c:907] tuya_tls_connect_destroy.
[01-01 00:00:00 ty D][iot_httpc.c:1437] httpUrl:[http://a.tuyacn.com/d.json][42.192.25.216]
[01-01 00:00:00 ty D][iot_httpc.c:1442] mqttUrl:[m2.tuyacn.com:1883][121.5.97.151]
[01-01 00:00:00 ty D][iot_httpc.c:1466] httpsStdUrl:[https://a6.tuyacn.com/d.json][81.69.183.170]
[01-01 00:00:00 ty D][iot_httpc.c:1467] mqttsStdUrl:[m6.tuyacn.com:8886][121.5.96.27]
[01-01 00:00:00 ty D][iot_httpc.c:1506] httpsPSKUrl:[https://a3.tuyacn.com/d.json][81.69.183.170]
[01-01 00:00:00 ty D][iot_httpc.c:1507] mqttsPSK3Url:[m3.tuyacn.com:8886][121.5.96.27]
[01-01 00:00:00 ty D][iot_httpc.c:1518] ghostUrl:[baal.tuyacn.com:443][42.192.35.108]
[01-01 00:00:00 ty D][simplekv.c:1248] delete key:tls_ca_cnt isFuzzy:0
[01-01 00:00:00 ty D][simplekv.c:1254] cnt:7 delete bit arr len:1
[01-01 00:00:00 ty D][simplekv.c:1287] key:tls_ca_cnt not find
[01-01 00:00:00 ty D][simplekv.c:1248] delete key:tls_ca isFuzzy:1
[01-01 00:00:00 ty D][simplekv.c:1254] cnt:7 delete bit arr len:1
[01-01 00:00:00 ty D][simplekv.c:1287] key:tls_ca not find
[01-01 00:00:00 ty D][tuya_cert_manager.c:438] tls_ca_name:tls_ca0
[01-01 00:00:00 ty D][simplekv.c:1128] read key:tls_ca0 isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1156] no key find
[01-01 00:00:00 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[01-01 00:00:00 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[01-01 00:00:00 ty D][simplekv.c:369] write key:tls_ca0 And Value Len:736
[01-01 00:00:00 ty D][simplekv.c:401] 5 valid is false AND size old 804 >= new 736
[01-01 00:00:00 ty D][simplekv.c:415] find 5 available space
[01-01 00:00:00 ty D][simplekv.c:452] reuse available space 30512
[01-01 00:00:00 ty D][simplekv.c:207] update crc 4132744942
[01-01 00:00:00 ty D][simplekv.c:356] write head to normal file success
[01-01 00:00:00 ty D][simplekv.c:492] write success
[01-01 00:00:00 ty D][simplekv.c:1128] read key:tls_ca_cnt isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1156] no key find
[01-01 00:00:00 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[01-01 00:00:00 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[01-01 00:00:00 ty D][simplekv.c:369] write key:tls_ca_cnt And Value Len:16
[01-01 00:00:00 ty D][simplekv.c:401] 6 valid is false AND size old 84 >= new 16
[01-01 00:00:00 ty D][simplekv.c:415] find 6 available space
[01-01 00:00:00 ty D][simplekv.c:452] reuse available space 31316
[01-01 00:00:00 ty D][simplekv.c:207] update crc 732864038
[01-01 00:00:00 ty D][simplekv.c:356] write head to normal file success
[01-01 00:00:00 ty D][simplekv.c:492] write success
[01-01 00:00:00 ty D][uni_network.c:185] cache dns [http://a.tuyacn.com/d.json]<->[42.192.25.216]
[01-01 00:00:00 ty D][uni_network.c:185] cache dns [https://a6.tuyacn.com/d.json]<->[81.69.183.170]
[01-01 00:00:00 ty D][uni_network.c:185] cache dns [https://a3.tuyacn.com/d.json]<->[81.69.183.170]
[01-01 00:00:00 ty D][uni_network.c:185] cache dns [m2.tuyacn.com:1883]<->[121.5.97.151]
[01-01 00:00:00 ty D][uni_network.c:185] cache dns [m6.tuyacn.com:8886]<->[121.5.96.27]
[01-01 00:00:00 ty D][uni_network.c:185] cache dns [m3.tuyacn.com:8886]<->[121.5.96.27]
[01-01 00:00:00 ty D][uni_network.c:185] cache dns [baal.tuyacn.com:443]<->[42.192.35.108]
[01-01 00:00:00 ty D][simplekv.c:1128] read key:tls_ca_cnt isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1159] find key:6 tls_ca_cnt
[01-01 00:00:00 ty D][simplekv.c:1185] key:tls_ca_cnt find value.Len:16
[01-01 00:00:00 ty D][tuya_cert_manager.c:467] tls_ca_cnt:1 and parse:1
[01-01 00:00:00 ty D][simplekv.c:1128] read key:tls_ca0 isFuzzy:0 skipCnt:0
[01-01 00:00:00 ty D][simplekv.c:1159] find key:5 tls_ca0
[01-01 00:00:00 ty D][simplekv.c:1185] key:tls_ca0 find value.Len:736
[01-01 00:00:00 ty D][tuya_cert_manager.c:497] Parse DER tls_ca0:540 success
[01-01 00:00:00 ty D][iot_httpc.c:1529] end
[01-01 00:00:00 ty D][uni_network.c:312] set_dns_cache_priority:1
[01-01 00:00:00 ty D][tuya_svc_mqtt_direct.c:179] SECURITY_LEVEL:1 direct connect MQTT URL:m6.tuyacn.com:8886 Port:8883 Sub:d/ai/qx06bf340fcdafc70521 tls:1
[01-01 00:00:00 ty I][tal_thread.c:185] thread_create name:mqtt_thread,stackDepth:9216,totalstackDepth:30208,priority:4
[01-01 00:00:00 ty N][tuya_svc_mqtt_client.c:177] [mqtts://m6.tuyacn.com:8886] mqtt state change 0 -> 1
[01-01 00:00:00 ty D][tal_thread.c:204] Thread:mqtt_thread Exec Start. Set to Running Stat
[01-01 00:00:00 ty N][tuya_svc_mqtt_client.c:836] connect to mqtt broker mqtts://m6.tuyacn.com:8886 port 8886
[01-01 00:00:00 ty D][ty_sdk_status_callback.c:79] status chaged: group[1] status[5]
[01-01 00:00:00 ty D][ty_sdk_status_callback.c:32] __on_netcfg_start, netcfg start. You can start your own netcfg task now.
Set Country Code:0
[01-01 00:00:00 ty D][tuya_wifi_reset.c:559] reset init mthd:0, short timer:0 long timer:0
[01-01 00:00:00 ty D][tuya_wifi_netcfg.c:424] do proxy actived work,mode:5,stat:0,nc_tp:0
Exec Cmd:ifconfig ens33 up
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
[01-01 00:00:00 ty N][tuya_svc_mqtt_client.c:846] mqtt client ip:192.168.12.128
[01-01 00:00:00 ty D][uni_network.c:230] unw_gethostbyname m6.tuyacn.com, prio 1
[01-01 00:00:00 ty D][uni_network.c:246] use dynamic dns ip:121.5.96.27 for domain:m6.tuyacn.com
[01-01 00:00:00 ty D][tcp_transporter.c:79] bind ip:c0a80c80 port:4364 ok
[01-01 00:00:00 ty D][tuya_tls.c:945] MAX SECURITY_LEVEL:1, TUYA SECURITY_LEVEL:1, mode:1
[01-01 00:00:00 ty D][tuya_tls.c:954] TUYA_TLS Begin Connect m6.tuyacn.com:8886
[01-01 00:00:00 ty D][tuya_tls.c:714] mbedtls authmode: MBEDTLS_SSL_VERIFY_REQUIRED
[01-01 00:00:00 ty D][tuya_tls.c:727] load tuya cert.
[01-01 00:00:00 ty D][tuya_cert_manager.c:213] p_url:m6.tuyacn.com:8886, rcs.urlx:h6.iot-dns.com
[01-01 00:00:00 ty D][tuya_cert_manager.c:236] tuya public url
[01-01 00:00:00 ty D][tuya_cert_manager.c:1099] parse crt <0> len <540> ret <0>
[01-01 00:00:00 ty D][tuya_tls.c:1036] socket fd is set. set to inner send/recv to handshake
SIOCSIFFLAGS: Operation not permitted
WIFI Set Mode 0
ens33 no wireless extensions.

[01-01 00:00:00 ty N][tuya_wifi_status.c:168] cur stat:0 0x0 -->>
[01-01 00:00:00 ty N][tuya_wifi_status.c:171] wifi netstat changed to:0 -->>
[01-01 00:00:00 ty N][tuya_svc_devos.c:216] __devos_init_evt success
[01-01 00:00:00 ty D][tuya_iot_base_api.c:298] wired netstat changed to:1 -->>
[01-01 00:00:00 ty D][ty_sdk_status_callback.c:79] status chaged: group[3] status[21]
[01-01 00:00:00 ty D][ty_sdk_status_callback.c:86] status ignore. cb is null.
[01-01 00:00:00 ty D][tuya_iot_base_api.c:300] wired netstat changed to:1 <<--
[01-01 00:00:00 ty D][tuya_svc_netmgr_linkage.c:117] link[1] is_up[1] active_link[2] status[2]
[01-01 00:00:00 ty N][tuya_svc_netmgr_linkage.c:138] default linkage[1] is set, switch is disabled
[01-01 00:00:00 ty D][tuya_tls.c:687] mbedtls_cert_pkey_free.
[01-01 00:00:00 ty D][tuya_tls.c:1098] handshake finish for m6.tuyacn.com. set send/recv to user set
[01-01 00:00:00 ty D][tuya_tls.c:1104] TUYA_TLS Success Connect m6.tuyacn.com:8886 Suit:TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
[01-01 00:00:00 ty N][tuya_svc_mqtt_client.c:883] setup mqtt transporter success
[01-01 00:00:00 ty N][tuya_svc_mqtt_client.c:177] [mqtts://m6.tuyacn.com:8886] mqtt state change 1 -> 2
[01-01 00:00:00 ty N][tuya_svc_mqtt_client.c:908] send mqtt connect success
[01-01 00:00:00 ty N][tuya_svc_mqtt_client.c:177] [mqtts://m6.tuyacn.com:8886] mqtt state change 2 -> 3
[01-01 00:00:00 ty E][tuya_svc_mqtt_client.c:928] host[mqtts://m6.tuyacn.com:8886] mqtt connect resp err:5
[01-01 00:00:00 ty D][tuya_svc_mqtt_direct.c:132] mqtt connect deny:1
[01-01 00:00:00 ty N][svc_netcfg_qrcode.c:89] direct mqtt disconnected
[01-01 00:00:00 ty N][tuya_svc_mqtt_client.c:665] mqtt close
[01-01 00:00:00 ty D][tls_transporter.c:93] tls transporter close socket fd:6
[01-01 00:00:00 ty D][tcp_transporter.c:177] tcp transporter close socket fd:6
[01-01 00:00:00 ty D][tls_transporter.c:101] tls transporter close tls handler:0x7f4744001250
[01-01 00:00:00 ty D][tuya_tls.c:1180] TUYA_TLS Disconnect ENTER
[01-01 00:00:00 ty D][tuya_tls.c:1205] TUYA_TLS Disconnect Success
[01-01 00:00:00 ty D][tuya_tls.c:907] tuya_tls_connect_destroy.
[01-01 00:00:00 ty N][tuya_svc_mqtt_client.c:177] [mqtts://m6.tuyacn.com:8886] mqtt state change 3 -> 1
[01-01 00:00:00 ty D][tuya_svc_mqtt_direct.c:124] mqtt disconnected
[01-01 00:00:00 ty N][svc_netcfg_qrcode.c:89] direct mqtt disconnected
[01-01 00:00:00 ty D][tuya_svc_mqtt_client.c:717] mqtt fail_cnt:1, sleeptime:5001 ms
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
[01-01 00:00:01 ty N][tuya_svc_lan.c:713] Not actived, use linkage addr[192.168.12.128][c0a80c80]
[01-01 00:00:01 ty D][tuya_lan_sock.c:331] reg post queue 6
[01-01 00:00:01 ty D][tuya_lan_sock.c:331] reg post queue 7
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
[01-01 00:00:02 ty D][tuya_lan_sock.c:127] reg lan sock 6,read:0x5613184120c0
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
[01-01 00:00:03 ty D][tuya_lan_sock.c:127] reg lan sock 7,read:0x561318415cb0
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
[01-01 00:00:05 ty D][tuya_devos_health.c:68] feed watchdog
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
[01-01 00:00:05 ty N][tuya_svc_mqtt_client.c:836] connect to mqtt broker mqtts://m6.tuyacn.com:8886 port 8886
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
[01-01 00:00:05 ty N][tuya_svc_mqtt_client.c:846] mqtt client ip:192.168.12.128
[01-01 00:00:05 ty D][uni_network.c:230] unw_gethostbyname m6.tuyacn.com, prio 1
[01-01 00:00:05 ty D][uni_network.c:258] use system dns ip 121.5.96.27 for domain m6.tuyacn.com

[01-01 00:00:05 ty D][uni_network.c:185] cache dns [m6.tuyacn.com]<->[121.5.96.27]
[01-01 00:00:05 ty D][tcp_transporter.c:79] bind ip:c0a80c80 port:25110 ok
[01-01 00:00:05 ty D][tuya_tls.c:945] MAX SECURITY_LEVEL:1, TUYA SECURITY_LEVEL:1, mode:1
[01-01 00:00:05 ty D][tuya_tls.c:954] TUYA_TLS Begin Connect m6.tuyacn.com:8886
[01-01 00:00:05 ty D][tuya_tls.c:714] mbedtls authmode: MBEDTLS_SSL_VERIFY_REQUIRED
[01-01 00:00:05 ty D][tuya_tls.c:727] load tuya cert.
[01-01 00:00:05 ty D][tuya_cert_manager.c:213] p_url:m6.tuyacn.com:8886, rcs.urlx:h6.iot-dns.com
[01-01 00:00:05 ty D][tuya_cert_manager.c:236] tuya public url
[01-01 00:00:05 ty D][tuya_cert_manager.c:1099] parse crt <0> len <540> ret <0>
[01-01 00:00:05 ty D][tuya_tls.c:1036] socket fd is set. set to inner send/recv to handshake
[01-01 00:00:05 ty D][tuya_tls.c:687] mbedtls_cert_pkey_free.
[01-01 00:00:05 ty D][tuya_tls.c:1098] handshake finish for m6.tuyacn.com. set send/recv to user set
[01-01 00:00:05 ty D][tuya_tls.c:1104] TUYA_TLS Success Connect m6.tuyacn.com:8886 Suit:TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
[01-01 00:00:05 ty N][tuya_svc_mqtt_client.c:883] setup mqtt transporter success
[01-01 00:00:05 ty N][tuya_svc_mqtt_client.c:177] [mqtts://m6.tuyacn.com:8886] mqtt state change 1 -> 2
[01-01 00:00:05 ty N][tuya_svc_mqtt_client.c:908] send mqtt connect success
[01-01 00:00:05 ty N][tuya_svc_mqtt_client.c:177] [mqtts://m6.tuyacn.com:8886] mqtt state change 2 -> 3
[01-01 00:00:05 ty E][tuya_svc_mqtt_client.c:928] host[mqtts://m6.tuyacn.com:8886] mqtt connect resp err:5
[01-01 00:00:05 ty D][tuya_svc_mqtt_direct.c:132] mqtt connect deny:2
[01-01 00:00:05 ty N][svc_netcfg_qrcode.c:89] direct mqtt disconnected
[01-01 00:00:05 ty N][tuya_svc_mqtt_client.c:665] mqtt close
[01-01 00:00:05 ty D][tls_transporter.c:93] tls transporter close socket fd:9
[01-01 00:00:05 ty D][tcp_transporter.c:177] tcp transporter close socket fd:9
[01-01 00:00:05 ty D][tls_transporter.c:101] tls transporter close tls handler:0x7f4744001250
[01-01 00:00:05 ty D][tuya_tls.c:1180] TUYA_TLS Disconnect ENTER
[01-01 00:00:05 ty D][tuya_tls.c:1205] TUYA_TLS Disconnect Success
[01-01 00:00:05 ty D][tuya_tls.c:907] tuya_tls_connect_destroy.
[01-01 00:00:05 ty N][tuya_svc_mqtt_client.c:177] [mqtts://m6.tuyacn.com:8886] mqtt state change 3 -> 1
[01-01 00:00:05 ty D][tuya_svc_mqtt_direct.c:124] mqtt disconnected
[01-01 00:00:05 ty N][svc_netcfg_qrcode.c:89] direct mqtt disconnected
[01-01 00:00:05 ty D][tuya_svc_mqtt_client.c:717] mqtt fail_cnt:2, sleeptime:7663 ms
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
[01-01 00:00:10 ty D][tuya_devos_health.c:68] feed watchdog
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
tkl_wired_get_ip 317: ifname=ens33
get ip = 192.168.12.128
C[signal_handle, 59] get signal(2) name(tuyaos_demo_ipc)

请问我应该如何修改代码,返回正确的状态信息到sdk让sdk进入配对流程?


Re: 【求助】【TuyaOS SDK】【x86_64_tuyaos_demo_ipc】如何直接输入token进行设备配对

Posted: 2024年 Jan 4日 15:45
by wink

已经解决了,只要在连接模式下增加TUYA_IPC_LINK_WIFI即可使用token在x86 demo中配网。

Code: Select all

TUYA_IPC_LINK_TYPE_E link_type = TUYA_IPC_LINK_WIFI | TUYA_IPC_LINK_WIRE;

Re: 【求助】【TuyaOS SDK】【x86_64_tuyaos_demo_ipc】如何直接输入token进行设备配对

Posted: 2024年 Jan 4日 15:50
by pippin-bobo

点赞
我们也同步分析下设置wired模式为什么没有进入到激活流程,请问tkl_wired部分,tkl_wired_set_status_cb状态回调适配了的哈?


Re: 【求助】【TuyaOS SDK】【x86_64_tuyaos_demo_ipc】如何直接输入token进行设备配对

Posted: 2024年 Jan 4日 16:59
by 郭老庄
wink 2024年 Jan 4日 15:45

已经解决了,只要在连接模式下增加TUYA_IPC_LINK_WIFI即可使用token在x86 demo中配网。

Code: Select all

TUYA_IPC_LINK_TYPE_E link_type = TUYA_IPC_LINK_WIFI | TUYA_IPC_LINK_WIRE;

你好,debug模式配网的前提是 连接模式要包含TUYA_IPC_LINK_WIFI。