Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT TLS MUTUAL AUTHENTICATION from example project Having Issues ! (CA-341) #226

Open
MahadiHasantauhid opened this issue Jul 3, 2024 · 2 comments

Comments

@MahadiHasantauhid
Copy link

E (916849) coreMQTT: A single byte was not read from the transport: transportStatus=-1. E (916849) coreMQTT: CONNACK recv failed with status = MQTTRecvFailed. E (916859) coreMQTT: MQTT connection failed with status = MQTTRecvFailed. E (916859) coreMQTT: Connection with MQTT broker failed with status MQTTRecvFailed. E (916869) coreMQTT: Connection to the broker failed, all attempts exhausted. E (916879) coreMQTT: Failed to connect to MQTT broker a2ymunmj15xks7-ats.iot.ap-south-1.amazonaws.com.
The issues above I'm not sure what is causing this. I have successfully flash the ESP32-C3-MINI with example project.

@github-actions github-actions bot changed the title MQTT TLS MUTUAL AUTHENTICATION from example project Having Issues ! MQTT TLS MUTUAL AUTHENTICATION from example project Having Issues ! (CA-341) Jul 3, 2024
@MahadiHasantauhid
Copy link
Author

MahadiHasantauhid commented Jul 8, 2024

I think the issues are connected to AWS Policy making. I managed to solve that partially. while having this latest error below
E (4855244) coreMQTT: Call to receiveSingleIteration failed. Status=MQTTRecvFailed E (4855244) coreMQTT: MQTT_ProcessLoop failed to receive ACK packet: Expected ACK Packet ID=2e9, LoopDuration=76, Status=MQTTRecvFailed
In my policy the Resource for Both Publish and Receive are similar arn:aws:iot:ap-south-1:Account Id:topic/example/topic
I would like to know, In the code we all have "example/topic" for both publish and subscribe, then how to set "Policy Resource" for Policy action "iot:Receive"? or should we just deny Receive as policy action to get similar message log mentioned in TLS Mutual Authentication in Readme.md file.
thank you in advance.

@MahadiHasantauhid
Copy link
Author

I found the problem and solved it. The problem in my case was "Client ID" not being set according to "iot:connect" policy action. while creating the policy action "iot:connect" we are also setting the "Client ID". The same ID needs to be used in "idf.py menuconfig".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant