AWS iot MQTT connection timeout error

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
AaMo_3399246
Level 1
Level 1
First question asked First reply posted First like given

Hi guys,

I have been trying to get my CY8CPROTO-062-4343W board to AWS but currently failing at the MQTT connection stage.

I have followed a couple of different guides:

1. "Getting Started with PSoC 62 + 43xxx" and then

2. some start up guide on AWS: https://docs.aws.amazon.com/freertos/latest/userguide/freertos-prereqs.html

Neither have worked.

As required, MQTT endpoint, thing name, certificate and key have been updated in relevant files. In AWS console, i have added a policy and thing, as instructed.

Anything guidance with this issue would be greatly appreciated!

Cheers,

Aaron

0 Likes
7 Replies
lock attach
Attachments are accessible only for community members.
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Please check if the the endpoint address, certificate have been added correctly. I have attached a sample file for reference just to make sure things are in order.

Check if the internet connection is working on the Access Point (AP).

Also, are there any modifications to the code?

Regards,

Dheeraj

Thanks for the info. I have gone through again, and the only thing different was the Just In Time Registration (JITR) certificate.

The endpoint seems OK and also the WiFI/internet connection, as i do see "successful connections" in my aws iot interface.

I havent done any other modifications to the code. Is there something else i need to do on the aws iot end that might be causing this.

Btw i originally created the aws_clientcredential_keys.h file using this: tools/certificate_configuration/CertificateConfigurator.html

After seeing that i didnt have the JITR certificate in my file, i downloaded a root CA from here: https://docs.aws.amazon.com/iot/latest/developerguide/server-authentication.html#server-authenticati...  and included it in the keys file.

Is this correct?

Thanks for your help!

Aaron.

0 Likes
lock attach
Attachments are accessible only for community members.

BTW i did realise this additional "warning" in the serial log:

"5 7346 [Tmr Svc] Warning: no persistent storage is available for the JITP certificate. The certific..."

0 Likes

Hello Aaron,

Yes you are right. The CertifcateConfigurator tool takes only the privateKey and the certificate pem files. So, you should add the Root CA Certificate from the link you mentioned and add it to the file.

Click on your IoT Thing > Security and click on your certificate. Select the Policies tab and click the policy as shown below:.

aws2.PNG

Check if the policy has all the priviliges enabled for IoT. My policy document is as shown below:

{

  "Version": "2012-10-17",

  "Statement": [

  {

  "Effect": "Allow",

  "Action": "iot:*",

  "Resource": "*"

  }

  ]

}

Save your changes and now go back to the main page on AWS IoT. Run the MQTT Client by clicking Test tab in the left side panel. Add your MQTT topic and subscribe to it.

aws.PNG

Now check if you are able to connect to the MQTT endpoint and receive any data in the console.

Regards,

Dheeraj

Thanks Dheeraj for all the info - i really appreciate it!

I have gone through and made sure everything is similar to yours. here are my details...

pastedImage_3.png

from "iot_demo_mqtt.c" - this is something i actually modified...

pastedImage_5.png

MQTT client, but still comes back with same error... and no response here.

pastedImage_4.png

and still have "successful connections". So what does this mean? what parts are definitely working? and which ones are not?

pastedImage_7.png

thanks for your help!

Aaron.

0 Likes

Sorry guys, i just realized that the "successful connections" were most likely not from my device, but from the MQTT client test window in AWS.

So just going back a couple of steps: the device is connected to an AP with internet, because my PC is connected to the same AP and internet is working

My AP's admin panel is showing that the device (based on MAC and IP address) is connected to the AP.

So at this stage, still no luck. Will keep you updated.

Cheers,

Aaron

0 Likes

Hello Aaron,

Please check this thread: MQTT connection timeout error on CY8PROTO-062-4343W PSoC 6 Amazon FreeRTOS

MQTT connection timeout error on CY8PROTO-062-4343W PSoC 6 Amazon FreeRTOS

This may be the solution to your issue as well.

Regards,

Dheeraj