MediaTek-Labs / aws_mbedtls_mqtt

The source code to use mbedTLS library to connect to AWS mqtt IOT server.
62 stars 34 forks source link

vm_socket error Issue #12

Open hengbenkeji opened 7 years ago

hengbenkeji commented 7 years ago

Sir, thank you for your library.

I have registered a user account in AWS and deployed my website there. I first wanted to use Firebase, yet I have difficulty in tranferring data from the LinkIt ONE to the Firebase which is using TLS 1.2 now.

I am referred to study this AWS library first. I tried for several days. I have managed to install the root CA, as well as certificate and private key for my IoT. Yet, I got stuck when I repeated received the vm_socket error, even after I had tried to change my location for several times. The reported errors by the Serail facility are as follows. Could you give me some hint? BTW, Ilive in Jinan, China, and I can have access to the site 54.209.1.110. And I also have gone through the MediaTek forum at this thread (http://labs.mediatek.com/forums/posts/list/3394.page#p6473). I also found the PING command return 52.207.46.254, but the aws_mbedtls_mqtt return 54.209.1.110. I also hard-coded the two IP address to CONNECT_IP_ADDRESS in the function of wifiResolveCallback(); however, neither of the two addresses works. The error code returned is -20, which is different from the thread reported in the MediaTek forum (http://labs.mediatek.com/forums/posts/list/3394.page#p6473).

  Serial Output:
  . Connecting to AP...ok
  . Loading the CA root certificate ...ok
  . Loading the client cert. and key...ok
  . Connecting to server 54.209.1.110/8883...vm_socket error and ret value is -20
Error in connecting...
Subscribing...failed in iot_mqtt_subscribe.
Ok
The output of my PING command
正在 Ping 54.209.1.110 具有 32 字节的数据:
来自 54.209.1.110 的回复: 字节=32 时间=315ms TTL=36
来自 54.209.1.110 的回复: 字节=32 时间=326ms TTL=36
来自 54.209.1.110 的回复: 字节=32 时间=318ms TTL=36
来自 54.209.1.110 的回复: 字节=32 时间=316ms TTL=36

54.209.1.110 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 315ms,最长 = 326ms,平均 = 318ms
hengbenkeji commented 7 years ago

Hi, Jason, I tried to replace the platform.txt. Yet, after I changed the file, LinkIt One got stuck during setup.

ghost commented 6 years ago

Hi @JasonMTK

Even i am facing the same error.

. Connecting to AP...ok
ip address is 0.0.0.0
  . Loading the CA root certificate ...ok
  . Loading the client cert. and key...ok
  . Connecting to server 52.201.207.5/8883...vm_socket error and ret value is -20
Error in connecting...
Subscribing...failed in iot_mqtt_subscribe.

Thanks, Praveen