Problems with AwsSendDataOverMQTT
Answer
8/14/19 12:11 PM

Hello, everyone!

I keep getting the same error (RETCODE_MQTT_CONNECT_FAILED, picture 1) with AwsSendDataOverMQTT, spent all day, tried multiple times to create new things in AWS IoT, but still didn't achieve anything. I followed up this guideline: 

http://amz-secrets.de/html/_x_d_k__a_w_s__s_e_n_d__d_a_t_a__o_v_e_r__m_q_t_t__u_s_e_r__g_u_i_d_e.html

Also tried adding a policy to a certificate, but this also made no difference. 

I know that there were many threads about this example, but I did not find out anything amongst all of them, that could fix my issue.

Things I've done:

1) Created a thing in AWS IoT

2) Changed config.txt (part of mqtt is in picture 2) and copied it to SD card

3) Using openssl converted the private key and the certificates (root CA and the thing certificate) and copied them to SD card

Maybe I am missing something?

0 (0 Votes)
RE: Problems with AwsSendDataOverMQTT
Answer
8/15/19 10:55 AM as a reply to Temirlan Amangeldin.

Hi 

Try the Server Url without the "-ats". 

 

Regards

0 (0 Votes)
RE: Problems with AwsSendDataOverMQTT
Answer
8/15/19 11:53 AM as a reply to Silvan Joos.

Hello,

Thank you for your answer, but it did not help in my case, still having the same error :(

I tried also removing "-ats" from clientId and keeping it, still the same result.

+1 (1 Vote)
RE: Problems with AwsSendDataOverMQTT
Answer
8/15/19 12:08 PM as a reply to Temirlan Amangeldin.

Hi 

 

Here is my config Maybe it helps. Did you download the correct certificate of Aws?

"mqtt":
	{
		"clientid": "XDK110-17-05618",
		"brokerurl": "77777777bu.iot.eu-central-1.amazonaws.com",
		"brokerport": 8883,
		"topic": "XDK110/17-05618",
		"intervall": 10000

 

0 (0 Votes)
RE: Problems with AwsSendDataOverMQTT
Answer
8/15/19 12:25 PM as a reply to Silvan Joos.

Hi,

I have downloaded:

1) Private key -- 65f656cd6e-private.pem.key

2) Certificate of a thing -- 65f656cd6e-certificate.pem.crt

3) VeriSign RootCA -- Amazon_VeriSign.pem

After that, I used the followings in terminal to convert them into .der formats:

1) openssl rsa -outform der -in 65f656cd6e-private.pem.key -out xdk-priv.der

2) openssl x509 -outform der -in 65f656cd6e-certificate.pem.crt -out xdk-cert.der

3) openssl x509 -outform der -in Amazon_VeriSign.pem -out rootCA.der

Then, I moved these files into SD card with config.txt. Did I do everything correct?

0 (0 Votes)
RE: Problems with AwsSendDataOverMQTT
Answer
8/15/19 1:29 PM as a reply to Temirlan Amangeldin.

Hi 
Yeah, I sort of solved that right away. 
Did you activate the certificate on the aws? 

and what does your corresponding policy say in the aws? 

 

Regards

0 (0 Votes)
RE: Problems with AwsSendDataOverMQTT
Answer
8/15/19 1:49 PM as a reply to Silvan Joos.

Hello,

I was testing your suggestion about removing "-ats" from URL only for a thing without any policies, now I have tested for another thing that has a policy, and now everything works.

Thank you very much for your help! 

+1 (1 Vote)