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

port latest aws iot version 1.1.0 #7

Open javadoug opened 8 years ago

javadoug commented 8 years ago

There is a new feature that is really valuable autoReconnect. I would like to port to this version.

If you can provide instructions on how to port, I would be willing to give it a go.

https://github.com/aws/aws-iot-device-sdk-embedded-C/commit/69b322814e8edfac51222a3bc43717fe026c3d76

JasonMTK commented 8 years ago

Hi Doug,

Thanks for the information! I think AWS added this feature to try to reconnect to the MQTT server, if there's something wrong with the connection.

The porting job should be straightforward, add corresponding codes to aws_iot_library. And it should work. Most of the code from aws_iot_library should be same with the original AWS SDK. Only few things were changed to be compatible with LinkitOne API. But I think most parts for this patch should be same.

I would also try to port this feature to SDK after I finish current projects and has more time. If you face any problem during the porting, please let me know it.

Thanks for your help. Jason

ghost commented 6 years ago

Hi @JasonMTK @pablosun

I am using linkit one board and trying to connect with AWS iot using mbedtls.I am getting the following error:

 Connecting to AP...ok
ip address is 0.0.0.0
  . Shadow Init... ok
  . Loading the CA root certificate ...ok
  . Loading the client cert. and key...ok
  . Connecting to server 0.0.0.0/8883...vm_socket error and ret value is -20
Shadow Connection Error
Shadow Register Delta Error
  . mqtt_start finished...ok

Please help me to resolve this error

Thanks, Praveen

lightgao commented 5 years ago

I got same issue with @divum21, using the example code (aws_paho_mqtt) of this repo. Hi, @divum21 any more updates? @JasonMTK any suggestion for this?

ghost commented 5 years ago

@lightgao :

Hi, Please try with the below configuration. I am not sure about the reason. It's perfectly working for me.

Note: This Version support Arduino IDE 1.5.7(And Arduino IDE 1.6.5) and LinkIt SDK 1.1.17 only.

Thanks, Praveen Kumar R

lightgao commented 5 years ago

after add "delay(3000)" before remote call "bearer_open" function, I slove this problem. Seem, DNS resolve function "wifiResolveDomainName" need some time to return valid ip.

Arduino IDE 1.6.6 on windows, LinkIt SDK 1.1.23.

@divum21 Thanks for you reply. :)