郭老庄 2024年 Feb 28日 14:00
- app预计4月底发布
- 崩溃的问题,你可以先不调用tuya_ble_set_startup_attr(TUYA_BLE_ABILITY_NETCFG); 等你想stack deinit的时候,调tuya_ble_set_serv_switch(0);试试
- sdk里默认mtu是247
- 有些api demo调用,但sdk没调是正常的,demo主要起验证的作用
2实测在不调用tuya_ble_set_startup_attr(TUYA_BLE_ABILITY_NETCFG)前提下,在__on_status_online函数中执行tuya_ble_set_serv_switch(0);,还是会挂死。
[02-28 20:01:17 ty I][ty_sdk_status_callback.c:58] online: network status MQTT connected
执行语句tuya_ble_set_serv_switch(0)
[02-28 20:01:17 ty D][tuya_ipc_sdk_info.c:330] ipc sdk info: mqstat change to :1
[02-28 20:01:17 ty N][tuya_wifi_status.c:168] cur stat:7 0x4f96f0 -->>
[02-28 20:01:17 ty N][tuya_wifi_status.c:171] wifi netstat changed to:7 -->>
[02-28 20:01:17 ty N][tuya_wifi_status.c:175] report wifi netstat[7] to callback -->>
[02-28 20:01:17 ty D][tuya_iot_base_api.c:298] wired netstat changed to:2 -->>
[02-28 20:01:17 ty D][tuya_iot_base_api.c:300] wired netstat changed to:2 <<--
[02-28 20:01:17 ty N][tuya_ble_svc.c:1580] BT Serv closing...
[02-28 20:01:17 ty D][tuya_ble_svc.c:1349] ble monitor delete
tkl_ble_stack_deinit 47 role 3
[02-28 20:01:17 ty D][simplekv.c:1128] read key:em_sys_env isFuzzy:0 skipCnt:0
[02-28 20:01:17 ty D][simplekv.c:1156] no key find
[02-28 20:01:17 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[02-28 20:01:17 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[02-28 20:01:17 ty E][svc_online_log_db.c:25] ret:-6
[02-28 20:01:17 ty D][tuya_svc_online_log.c:154] load env fail. maybe not exist.
[02-28 20:01:17 ty D][tuya_svc_online_log.c:159] update property:{"value":"{\"embed_sys_env\":\"T31_uclibc\"}"}
[02-28 20:01:17 ty D][iot_httpc.c:963] Post Data: {"value":"{\"embed_sys_env\":\"T31_uclibc\"}","t":1709121677}
[02-28 20:01:17 ty D][iot_httpc.c:975] Post URL: https://a6.tuyacn.com/d.json?a=tuya.dev ... 2b283c4a39
[02-28 20:01:17 ty D][simplekv.c:1128] read key:ap_info_v2 isFuzzy:0 skipCnt:0
[02-28 20:01:17 ty D][simplekv.c:1156] no key find
[02-28 20:01:17 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[02-28 20:01:17 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[02-28 20:01:17 ty E][tuya_wifi_connect.c:80] ap_info_v2 read fail:-6
[02-28 20:01:17 ty E][tuya_wifi_connect.c:131] ws_db_connect_ap_info_read fail:-6
[02-28 20:01:17 ty E][tuya_wifi_connect.c:48] para null
[02-28 20:01:17 ty E][tuya_wifi_connect.c:134] ws_db_connect_ap_info_v2_write fail:-2
[02-28 20:01:17 ty D][httpc.c:620] Connect: a6.tuyacn.com Port: 443 -->>
[02-28 20:01:17 ty D][uni_network.c:230] unw_gethostbyname a6.tuyacn.com, prio 1
[02-28 20:01:17 ty D][uni_network.c:246] use dynamic dns ip:81.69.183.170 for domain:a6.tuyacn.com
[02-28 20:01:17 ty D][tcp_transporter.c:79] bind ip:c0a864a0 port:0 ok
[02-28 20:01:17 ty D][tuya_tls.c:945] MAX SECURITY_LEVEL:1, TUYA SECURITY_LEVEL:1, mode:1
[02-28 20:01:17 ty D][tuya_tls.c:954] TUYA_TLS Begin Connect a6.tuyacn.com:443
[02-28 20:01:17 ty D][tuya_tls.c:714] mbedtls authmode: MBEDTLS_SSL_VERIFY_REQUIRED
[02-28 20:01:17 ty D][tuya_tls.c:727] load tuya cert.
[02-28 20:01:17 ty D][tuya_cert_manager.c:213] p_url:a6.tuyacn.com, rcs.urlx:h6-ay.iot-dns.com
[02-28 20:01:17 ty D][tuya_cert_manager.c:236] tuya public url
[02-28 20:01:17 ty D][tuya_cert_manager.c:1099] parse crt <0> len <540> ret <0>
[02-28 20:01:17 ty D][tuya_tls.c:1036] socket fd is set. set to inner send/recv to handshake
[02-28 20:01:17 ty D][pps_tuya_ipc_sdk_6.c:645] tuya_ipc_sdk_mqtt_online_proc is start run
[02-28 20:01:17 ty D][tuya_ipc_sdk_info.c:130] ipc get service time 1709121677 28800
[02-28 20:01:17 ty D][tuya_ipc_sdk_info.c:161] got service time 1709121677 28800
[12:02:04.049 ERR pps_tuya_ipc_sdk_6.c:660] TUYA_IPC_Media_Stream_Init
[02-28 20:01:17 ty D][simplekv.c:1128] read key:media_log_info isFuzzy:0 skipCnt:0
[02-28 20:01:17 ty D][simplekv.c:1156] no key find
[02-28 20:01:17 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[02-28 20:01:17 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[02-28 20:01:17 ty E][tuya_imm_service_log.c:490] read media_log_info fails, ret[-6]
[02-28 20:01:17 ty D][tuya_imm_service_log.c:502] LOAD log server: level[2],server[/av/moto/log]
[02-28 20:01:17 ty I][tuya_imm_service_log.c:338] use mqtt uploader
[02-28 20:01:17 ty I][tuya_imm_service_log.c:372] init uploader[0] OK.
[02-28 20:01:17 ty D][tuya_ipc_mqtt_subscribe.c:84] __mqtt_subscribe_init
[02-28 20:01:17 ty D][tuya_imm_service_log.c:614] send mqtt msg to topic[/av/moto/log/d/6ce3bfcf6309b01e00xfvp][{"header":{"from":"6ce3bfcf6309b01e00xfvp","type":"getLogToken","tid":"00ec354b89c7e1d951fc3dc4fe457852"}}]
[02-28 20:01:17 ty D][mqc_app.c:891] Send MQTT Msg.P:312 N:47552 Q:0
[02-28 20:01:17 ty D][tuya_svc_mqtt_client.c:427] packet id: 3
[02-28 20:01:17 ty I][tuya_imm_service_log.c:674] init ok
[02-28 20:01:17 ty D][tuya_ring_buffer.c:767] ch0st0tr9 open with type 1
[02-28 20:01:17 ty D][tuya_ring_buffer.c:767] ch0st0tr0 open with type 1
[02-28 20:01:17 ty D][tuya_ring_buffer.c:767] ch0st0tr1 open with type 1
[02-28 20:01:17 ty D][mqc_app.c:336] Rev MQTT:{"protocol":312,"pv":"2.3","t":1709121677,"data":{"header":{"type":"setLogToken","to":"6ce3bfcf6309b01e00xfvp","tid":"00ec354b89c7e1d951fc3dc4fe457852"},"msg":{"mode":"log","log":{"level":2,"size":1024,"interval":60,"topic":"/av/moto/log","api":"thing.m.rtc.log","tcp":{"domain":"wework-2-cn.stream.iot-11.com","address":"1.117.192.37","port":9092,"key":"6e9d446e4a2d2cdc"}}}}}
[02-28 20:01:17 ty D][tuya_ipc_mqtt_subscribe.c:213] recv mq: protocol 312
[02-28 20:01:17 ty D][simplekv.c:1128] read key:media_log_info isFuzzy:0 skipCnt:0
[02-28 20:01:17 ty D][simplekv.c:1156] no key find
[02-28 20:01:17 ty D][simplekv.c:1198] __read_kv_raw fail. -3
[02-28 20:01:17 ty D][simplekv.c:1236] __read_kv_with_decode fail. -3
[02-28 20:01:17 ty D][simplekv.c:369] write key:media_log_info And Value Len:96
[02-28 20:01:17 ty D][simplekv.c:401] 4 valid is false AND size old 420 >= new 96
[02-28 20:01:17 ty D][simplekv.c:415] find 4 available space
[02-28 20:01:17 ty D][simplekv.c:452] reuse available space 30092
[02-28 20:01:17 ty D][simplekv.c:207] update crc 3238666639
[02-28 20:01:17 ty D][tuya_ipc_media_stream.c:65] P2P API Version: 244.3.4.120
[02-28 20:01:17 ty D][tuya_ipc_media_stream.c:397] gw actived
tuya liteos uv
[02-28 20:01:17 ty D][simplekv.c:356] write head to normal file success
[02-28 20:01:17 ty D][simplekv.c:492] write success
[02-28 20:01:17 ty D][tuya_imm_service_log.c:596] Set log server:[/av/moto/log]
[02-28 20:01:17 ty D][simplekv.c:1128] read key:tuya_seed isFuzzy:0 skipCnt:0
[02-28 20:01:17 ty D][simplekv.c:1159] find key:0 tuya_seed
[02-28 20:01:17 ty D][simplekv.c:1185] key:tuya_seed find value.Len:80
[02-28 20:01:17 ty D][simplekv.c:1128] read key:tuya_seed isFuzzy:0 skipCnt:0
[02-28 20:01:17 ty D][simplekv.c:1159] find key:0 tuya_seed
[02-28 20:01:17 ty D][simplekv.c:1185] key:tuya_seed find value.Len:80
[02-28 20:01:17 ty D][simplekv.c:369] write key:tuya_seed And Value Len:80
[02-28 20:01:17 ty D][simplekv.c:387] 0 key same AND size old 148 >= new 80
[02-28 20:01:17 ty D][simplekv.c:415] find 0 available space
[02-28 20:01:17 ty D][simplekv.c:452] reuse available space 28700
[02-28 20:01:17 ty D][simplekv.c:207] update crc 2751757715
*status 0
[02-28 20:01:18 ty D][tuya_lan_sock.c:149] unreg lan sock 31 and close it
[02-28 20:01:18 ty D][simplekv.c:356] write head to normal file success
[02-28 20:01:18 ty D][simplekv.c:492] write success
[02-28 20:01:18 ty D][simplekv.c:1128] read key:tuya_seed isFuzzy:0 skipCnt:0
[02-28 20:01:18 ty D][simplekv.c:1159] find key:0 tuya_seed
[02-28 20:01:18 ty D][simplekv.c:1185] key:tuya_seed find value.Len:80
[02-28 20:01:18 ty D][simplekv.c:1128] read key:tuya_seed isFuzzy:0 skipCnt:0
[02-28 20:01:18 ty D][simplekv.c:1159] find key:0 tuya_seed
[02-28 20:01:18 ty D][simplekv.c:1185] key:tuya_seed find value.Len:80
[02-28 20:01:18 ty D][simplekv.c:1128] read key:tuya_seed isFuzzy:0 skipCnt:0
[02-28 20:01:18 ty D][simplekv.c:1159] find key:0 tuya_seed
[02-28 20:01:18 ty D][simplekv.c:1185] key:tuya_seed find value.Len:80
[02-28 20:01:18 ty D][simplekv.c:369] write key:tuya_seed And Value Len:80
[02-28 20:01:18 ty D][simplekv.c:387] 0 key same AND size old 148 >= new 80
[02-28 20:01:18 ty D][simplekv.c:415] find 0 available space
[02-28 20:01:18 ty D][simplekv.c:452] reuse available space 28700
[02-28 20:01:18 ty D][simplekv.c:207] update crc 1681751062
[02-28 20:01:18 ty D][tuya_ble_svc.c:888] rev ble event 14
[02-28 20:01:18 ty D][tuya_ble_svc.c:849] Dev Rev BT Package
[02-28 20:01:18 ty D][tuya_ble_svc.c:97] bt_rev_raw 36 <0x68405c00>
00 21 46 05 34 48 43 4e 4d 54 31 47 33 4d 4d 4e 4f 46 44 44 cc 24 0f f7 e1 07 ce 2a 3a ab 90 23 28 bb c0 1f
[02-28 20:01:18 ty D][tuya_ble_data_handler.c:139] recive sub_pkg desc:3, no:1, pack_len:33, total_len:33
[02-28 20:01:18 ty D][tuya_ble_svc.c:97] ble rev data 33 <0x1088794>
05 34 48 43 4e 4d 54 31 47 33 4d 4d 4e 4f 46 44 44 cc 24 0f f7 e1 07 ce 2a 3a ab 90 23 28 bb c0 1f
这里就挂了。