Iot Core: problem to connect my device

0

Hello, I am starting with AWS Iot Core. I use the MQTT protocol.

I did create my Device on the account, as well as its shadow and embedded the 3 certificates: AmazonRootCA1.pem, <MyDeviceName>.cert.pem, and <MyDeviceName>.private.key

When I try to connect, each of these certificates seems to be well recognized by my API functions, (I'm not using the AWS SDK, I'm using the Azure RTOS APIs... provided by my device's microcontroller manufacturer)

However the TLS session seems to start correctly, the "ClientHello" transaction seems to start well with a successful first handshake, but the connection breaks without me being able to find the reason.

Namely, my code was adapted for AWS IOT Core, because it originally worked for Azure IT Hub...

I hope someone here can help me?

Thanks in advance,

Best Regards, Eric F.

已提問 1 年前檢視次數 537 次
3 個答案
2
已接受的答案

You need to check whether the policy attached to that certificate allows the device to perform the operation your code is doing on the necessary resources. Assuming you're publishing into a specific topic, the policy needs to allow an iot:Publish action on that topic (or covered by a wildcard).

profile pictureAWS
專家
Tasio
已回答 1 年前
profile pictureAWS
專家
已審閱 1 年前
1

Hello Eric,

you should enable logging for IoT Core. Then you might find information about what happens in CloudWatch logs.

You should also validate the IoT policy attached to your device certificate. If the MQTT client violates this policy, for example by sending a not permitted client ID it will be disconnected.

Cheers,
Philipp

AWS
專家
已回答 1 年前
0

Thank you both for your quick answers. I had not actually attached my certificates to the policy I created... Regards, Eric

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南