espressif / esp-ali-smartliving

阿里云生活物联网平台 & 天猫精灵 IoT 开放平台
79 stars 34 forks source link

移植 生活物联网平台SDK(V1.6.6) mqtt连接失败,云智能公版APP添加不了设备 #15

Open kust336 opened 3 years ago

kust336 commented 3 years ago

1. 开发环境

2. 问题描述

移植 生活物联网平台SDK(V1.6.6) mqtt连接失败,云智能公版APP添加不了设备. I (55977) app main: IOTX_AWSS_GOT_SSID_PASSWD [crt] ready connect ap 'HUAWEI-E5573-87EA'

inf do_connect_ap(817): dev ap: wait switchap resp ack,cnt = 1 inf do_connect_ap(817): dev ap: wait switchap resp ack,cnt = 2 inf do_connect_ap(817): dev ap: wait switchap resp ack,cnt = 3 I (56727) awss: ssid: adh_unusable I (60988) app main: IOTX_AWSS_CONNECT_ROUTER I (60991) awss: ssid: HUAWEI-E5573-87EA, password: **, channel: 0 I (60999) awss: Connecting AP I (62640) wifi:state: 0 -> 2 (b0) I (62642) wifi:state: 2 -> 3 (0) I (62646) wifi:state: 3 -> 5 (10) I (62647) awss: Connecting AP I (62659) wifi:connected with HUAWEI-E5573-87EA, aid = 3, channel 4, HT20, bssid = d0:16:b4:2a:87:ea I (63146) awss: Connecting AP I (63646) awss: Connecting AP I (64146) awss: Connecting AP E (64390) udp: sendto err CoAPMessage_send(552): CoAP transport write failed, send message 46133 return 0 I (64646) awss: Connecting AP I (65146) awss: Connecting AP I (65649) awss: Connecting AP I (66139) tcpip_adapter: sta ip: 192.168.0.103, mask: 255.255.255.0, gw: 192.168.0.1 E (66144) wrapper_kv: Set stassid blob value E (66150) wrapper_kv: Set pswd blob value I (66156) conn_mgr: SNTP get time failed (0), retry after 1000 ms  I (66161) awss: AP connected I (66163) app main: IOTX_AWSS_GOT_IP [crt] connect 'HUAWEI-E5573-87EA' success

I (66370) app main: IOTX_AWSS_SUC_NOTIFY inf awss_notify_dev_info(232): topic:/sys/awss/event/connectap/notify inf awss_notify_dev_info(236): coap send notify success inf awss_notify_dev_info(232): topic:/sys/awss/event/connectap/notify inf awss_notify_dev_info(236): coap send notify success I (67156) conn_mgr: SNTP get time failed (1), retry after 1000 ms  I (68156) conn_mgr: SNTP get time failed (2), retry after 1000 ms  I (69156) conn_mgr: SNTP get time failed (3), retry after 1000 ms  I (70156) conn_mgr: SNTP get time failed (4), retry after 1000 ms  I (71157) conn_mgr: SNTP get time success  inf iotx_alcs_construct(465): iotx_alcs_construct enter inf iotx_alcs_adapter_init(271): iotx_alcs_adapter_init inf CoAPServer_init(176): The CoAP Server already init inf alcs_context_init(275): CoAPServer_init return :0x40107fb8 inf iotx_alcs_register_resource(817): alcs register resource, uri:/dev/a1dOsU2Wgyv/vMAdO0I8xxdIsP4Rjmo7/core/service/setup inf alcs_resource_register_secure(750): alcs_resource_register_secure W (71217) wrapper_kv: nvs get blob ALCS_KEY failed with 1102 wrn __alcs_localsetup_kv_get(45): HAL_Kv_Get('ALCS_KEY') = 4354 (!= 0), return 1 wrn alcs_localsetup_ac_as_load(156): ALCS KV Get local Prefix And Secret Fail inf alcs_add_svr_key(297): alcs_add_svr_key, priority=0 inf add_svr_key(247): add_svr_key, key:Xtau@iot inf add_svr_key(253): add_svr_key 1 inf alcs_remove_low_priority_key(225): alcs_remove_low_priority_key 2_0: 0x3ffeb398:0x3ffeb398 inf alcs_remove_low_priority_key(238): alcs_remove_low_priority_key 3 inf add_svr_key(255): add_svr_key 2 inf add_svr_key(265): add_svr_key 3 inf add_svr_key(271): add_svr_key 4 inf add_svr_key(279): add_svr_key 5 inf add_svr_key(285): add_svr_key 6 inf add_svr_key(291): finish add svr key inf CoAPServer_init(176): The CoAP Server already init inf _dm_server_dev_notify(50): notify path:/dev/core/service/dev/notify; payload = {"id":"0","version":"1.0","params":{"devices":{"addr":"192.168.0.103","port":5683,"pal":"linkkit-ica","profile":[{"productKey":"a1dOsU2Wgyv","deviceName":"vMAdO0I8xxdIsP4Rjmo7"}]}},"method":"core.service ... inf dm_client_open(37): CM Fd: 0 inf iotx_alcs_register_resource(817): alcs register resource, uri:/sys/a1dOsU2Wgyv/vMAdO0I8xxdIsP4Rjmo7/thing/service/property/set inf alcs_resource_register_secure(750): alcs_resource_register_secure inf dm_server_subscribe(160): Register Resource Result: 0 inf iotx_alcs_register_resource(817): alcs register resource, uri:/sys/a1dOsU2Wgyv/vMAdO0I8xxdIsP4Rjmo7/thing/service/property/get inf alcs_resource_register_secure(750): alcs_resource_register_secure inf dm_server_subscribe(160): Register Resource Result: 0 inf iotx_alcs_register_resource(817): alcs register resource, uri:/sys/a1dOsU2Wgyv/vMAdO0I8xxdIsP4Rjmo7/thing/event/property/post inf alcs_resource_register_secure(750): alcs_resource_register_secure inf dm_server_subscribe(160): Register Resource Result: 0 inf iotx_alcs_register_resource(817): alcs register resource, uri:/sys/a1dOsU2Wgyv/vMAdO0I8xxdIsP4Rjmo7/thing/service/# inf alcs_resource_register_secure(750): alcs_resource_register_secure inf dm_server_subscribe(160): Register Resource Result: 0 inf iotx_alcs_register_resource(817): alcs register resource, uri:/dev/core/service/dev inf dm_server_subscribe(160): Register Resource Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf dm_client_subscribe(150): Subscribe Result: 0 inf iotx_dm_subscribe(238): Devid 0 Sub Completed I (71561) app main: IOTX_CONN_CLOUD inf iotx_guider_get_kv_env(176): guider set env:3 inf iotx_guider_authenticate(1290): dyna url:a1dOsU2Wgyv.iot-as-mqtt.cn-shanghai.aliyuncs.com count:1 ................................. PK : a1dOsU2Wgyv DN : vMAdO0I8xxdIsP4Rjmo7 DS : 5c3d814b66 PID : espressif MID : wroom SM : TLS + Direct TS : 2524608000000 ................................. W (71611) wrapper_kv: nvs get blob awss.rst failed with 1102 ................................. Host : a1dOsU2Wgyv.iot-as-mqtt.cn-shanghai.aliyuncs.com Port : 443 ClientID : a1dOsU2Wgyv.vMAdO0I8xxdIsP4Rjmo7|securemode=2,tokenType=1,token=B1F9DD8EFDE92D7CEF5EC525F13FC200,_v=sdk-c-2.3.0_FY_1.6.6,timestamp=2524608000000,signmethod=hmacsha1,lan=C,pid=espressif,mid=wroom,authtype=custom-ilop,_fy=1.6.6,_ss=1| CA : ('... HMUfpIBvFSDJ3gyI ...') ................................. inf iotx_mc_init(2349): MQTT init success! inf recv_msg_handler(135): recv_msg_handler call callback inf _dm_server_malloc_context(27): alcs_context->ip: 192.168.0.100 inf _dm_server_malloc_context(28): alcs_context->port: 5683 inf dm_msg_proc_thing_dev_core_service_dev(1069): /dev/core/service/dev inf dm_msg_response(268): Send URI: /dev/core/service/dev, Payload: {"id":"14","code":200,"data":{"devices":{"addr":"192.168.0.103","port":5683,"pal":"linkkit-ica","profile":[{"productKey":"a1dOsU2Wgyv","deviceName":"vMAdO0I8xxdIsP4Rjmo7"}]}}} inf dm_server_send(137): Send Response Result 0 inf recv_msg_handler(135): recv_msg_handler call callback inf _dm_server_malloc_context(27): alcs_context->ip: 192.168.0.100 inf _dm_server_malloc_context(28): alcs_context->port: 5683 inf dm_msg_proc_thing_dev_core_service_dev(1069): /dev/core/service/dev inf dm_msg_response(268): Send URI: /dev/core/service/dev, Payload: {"id":"15","code":200,"data":{"devices":{"addr":"192.168.0.103","port":5683,"pal":"linkkit-ica","profile":[{"productKey":"a1dOsU2Wgyv","deviceName":"vMAdO0I8xxdIsP4Rjmo7"}]}}} inf dm_server_send(137): Send Response Result 0 err iotx_mc_wait_CONNACK(1803): recvConnackProc error,result = -35 err iotx_mc_connect(2746): wait connect ACK timeout, or receive a ACK indicating error! err IOT_MQTT_Construct(3148): iotx_mc_connect failed inf iotx_mc_disconnect(2871): mqtt disconnect! inf recv_msg_handler(135): recv_msg_handler call callback inf _dm_server_malloc_context(27): alcs_context->ip: 192.168.0.100 inf _dm_server_malloc_context(28): alcs_context->port: 5683 inf dm_msg_proc_thing_dev_core_service_dev(1069): /dev/core/service/dev inf dm_msg_response(268): Send URI: /dev/core/service/dev, Payload: {"id":"16","code":200,"data":{"devices":{"addr":"192.168.0.103","port":5683,"pal":"linkkit-ica","profile":[{"productKey":"a1dOsU2Wgyv","deviceName":"vMAdO0I8xxdIsP4Rjmo7"}]}}} inf iotx_mc_release(2964): mqtt release! inf dm_server_send(137): Send Response Result 0 inf iotx_guider_authenticate(1290): dyna url:a1dOsU2Wgyv.iot-as-mqtt.cn-shanghai.aliyuncs.com count:2 ................................. PK : a1dOsU2Wgyv DN : vMAdO0I8xxdIsP4Rjmo7 DS : 5c3d814b66 PID : espressif MID : wroom SM : TLS + Direct TS : 2524608000000 ................................. W (71611) wrapper_kv: nvs get blob awss.rst failed with 1102 ................................. Host : a1dOsU2Wgyv.iot-as-mqtt.cn-shanghai.aliyuncs.com Port : 443 ClientID : a1dOsU2Wgyv.vMAdO0I8xxdIsP4Rjmo7|securemode=2,tokenType=1,token=B1F9DD8EFDE92D7CEF5EC525F13FC200,_v=sdk-c-2.3.0_FY_1.6.6,timestamp=2524608000000,signmethod=hmacsha1,lan=C,pid=espressif,mid=wroom,authtype=custom-ilop,_fy=1.6.6,_ss=1| CA : ('... HMUfpIBvFSDJ3gyI ...') ................................. inf iotx_mc_init(2349): MQTT init success! inf recv_msg_handler(135): recv_msg_handler call callback inf _dm_server_malloc_context(27): alcs_context->ip: 192.168.0.100 inf _dm_server_malloc_context(28): alcs_context->port: 5683 inf dm_msg_proc_thing_dev_core_service_dev(1069): /dev/core/service/dev inf dm_msg_response(268): Send URI: /dev/core/service/dev, Payload: {"id":"14","code":200,"data":{"devices":{"addr":"192.168.0.103","port":5683,"pal":"linkkit-ica","profile":[{"productKey":"a1dOsU2Wgyv","deviceName":"vMAdO0I8xxdIsP4Rjmo7"}]}}} inf dm_server_send(137): Send Response Result 0 inf recv_msg_handler(135): recv_msg_handler call callback inf _dm_server_malloc_context(27): alcs_context->ip: 192.168.0.100 inf _dm_server_malloc_context(28): alcs_context->port: 5683 inf dm_msg_proc_thing_dev_core_service_dev(1069): /dev/core/service/dev inf dm_msg_response(268): Send URI: /dev/core/service/dev, Payload: {"id":"15","code":200,"data":{"devices":{"addr":"192.168.0.103","port":5683,"pal":"linkkit-ica","profile":[{"productKey":"a1dOsU2Wgyv","deviceName":"vMAdO0I8xxdIsP4Rjmo7"}]}}} inf dm_server_send(137): Send Response Result 0 err iotx_mc_wait_CONNACK(1803): recvConnackProc error,result = -35 err iotx_mc_connect(2746): wait connect ACK timeout, or receive a ACK indicating error! err IOT_MQTT_Construct(3148): iotx_mc_connect failed inf iotx_mc_disconnect(2871): mqtt disconnect! inf recv_msg_handler(135): recv_msg_handler call callback inf _dm_server_malloc_context(27): alcs_context->ip: 192.168.0.100 inf _dm_server_malloc_context(28): alcs_context->port: 5683 inf dm_msg_proc_thing_dev_core_service_dev(1069): /dev/core/service/dev inf dm_msg_response(268): Send URI: /dev/core/service/dev, Payload: {"id":"16","code":200,"data":{"devices":{"addr":"192.168.0.103","port":5683,"pal":"linkkit-ica","profile":[{"productKey":"a1dOsU2Wgyv","deviceName":"vMAdO0I8xxdIsP4Rjmo7"}]}}} inf iotx_mc_release(2964): mqtt release! inf dm_server_send(137): Send Response Result 0 inf iotx_guider_authenticate(1290): dyna url:a1dOsU2Wgyv.iot-as-mqtt.cn-shanghai.aliyuncs.com count:2 ................................. PK : a1dOsU2Wgyv DN : vMAdO0I8xxdIsP4Rjmo7 DS : 5c3d814b66 PID : espressif MID : wroom SM : TLS + Direct TS : 2524608000000 ................................. W (78408) wrapper_kv: nvs get blob awss.rst failed with 1102 ................................. Host : a1dOsU2Wgyv.iot-as-mqtt.cn-shanghai.aliyuncs.com Port : 443 ClientID : a1dOsU2Wgyv.vMAdO0I8xxdIsP4Rjmo7|securemode=2,tokenType=1,token=B1F9DD8EFDE92D7CEF5EC525F13FC200,_v=sdk-c-2.3.0_FY_1.6.6,timestamp=2524608000000,signmethod=hmacsha1,lan=C,pid=espressif,mid=wroom,authtype=custom-ilop,_fy=1.6.6,_ss=1| CA : ('... HMUfpIBvFSDJ3gyI ...') .................................

一直在三个 PK : a1dOsU2Wgyv 之间循环直到APP添加设备超时: 失败原因:getTokenTimeout. 请问是在移植的时候有哪些没修改的吗?

yuanjianmin commented 3 years ago

看着像是服务器拒绝了mqtt的连接,请确认四元组信息有没有写对。