Duo, aws_iot, SDK 4.0.1?


#1

I am trying to test out the AWS IoT platform, along with the RedBear Duo (plus RBLink) board that I have.

Unfortunately, the demo is not working, and it fails at the MQTT connection step after the standard 3 retries.
As far as I can tell, wiced_mqtt_connect() is returning WICED_ERROR_UNEXPECTED_MESSAGE (from the TLS group)

I just grabbed the latest version of the SDK. I notice that in the github repo, there is a patch associated with the aws_iot demo ; is this patch still needed for the latest version of the SDK? Or only the older 3.5.2?

If it is expected to work with 4.0.1 , then it is likely something wrong with the setup. It looks like AWS IoT no longer has an automatic configuration for an embedded C target, and there is fairly incomplete documentation along with the WICED SDK itself.
Has anyone gotten this to work? I’m trying to debug and figure out the right combination of thing name and resitration, private key, thing key, root CA key, policy, certificates, attachments, client ID, username and password, etc … it is fairly dizzying.
If someone has gotten this to work, please let me know your steps!


#2

hi @apullin:

I just tested the aws function and it worked well.
First,make sure you follow the guide of Avnet BCM4343W IoT Starter Kit
Second,you should confirm the “conninfo.peer_cn” (in aws_mqtt_conn_open() function ,aws_common.c file) is suitable for the region you set.


#3

Thanks for the quick response. The peer_cn was the likely one cause of the failed connection, I switched it to “data.iot.us-west-2.amazonaws.com” to make the publisher demo work.

At the same time, I used AWS’s “Connect a Device” auto config to generate a python device connector package (which does all the creation & association inside AWS automatically) and copying the 3 certificates over from there, and also set the port_number to 8883.

And I thought firmware code was hard enough, now there is all this AWS craziness to deal with, too!