ARMmbed/mbed-os-example-for-aws

Error in MQTT Connection

Martin-Biomed opened this issue · 2 comments

Hi everyone,

I'm having an issue where my MQTT connection to AWS is failing to connect.

image

I'm a complete noob to both mbed and AWS, but I've modified the mbed_app.json file according to the README instructions. I haven't been able to connect to MQTT yet, and this is after trying different variables for "aws-mqtt-topic", I'm not sure what else I can do.

image

I've also attached some screenshots of how I've configured my IoT AWS Thing in the AWS IoT GUI:

image

image

I did notice that there aren't instructions on how to set the MQTT Broker Port to use 8883.

Really, I don't have a lot of ideas, does anyone have a suggestion (or even better, a solution) to this issue? or has anyone had a similar issue in the past?

Thanks in advance

Hi,

I've been doing a bit more digging on this problem. I went back to look at the github page for the AWSClient for mbed:
https://github.com/ARMmbed/mbed-client-for-aws/blob/master/source/AWSClient.cpp

I have been able to see that the message that pops up in the terminal is linked to this section of the code (part of the AWSClient::connect function):

image

I've gone back to see if the "Thing Name" I created in AWS matches up with what I wrote on the JSON file:

image

This left me confused, as it looks like the "aws-client-identifier" value in the mbed_app.json is exactly the same as the Thing Name in AWS. All security certificates for this "Thing" are active (as shown in the previous post).

I'm even using the wildcard option for the MQTT topic (after trying to subscribe to a specific topic). So I still don't know what could be going wrong:

image

NVM, I solved it, please refer to this link for the resolution: https://forums.mbed.com/t/mqtt-connection-error-for-aws-example-project/16707/7