-
Notifications
You must be signed in to change notification settings - Fork 50
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
Attempting MQTT connection...failed, rc=-2 try again in 5 seconds #14
Comments
I ran into this problem myself. Follow the guide here: http://www.fhilitski.com/2016/09/connecting-mqtt-fx-to-aws-iot/ and make sure that you can connect to your IoT cloud using MQTT.fx . (Make sure to set permissions on the certificate properly, and also be sure to activate the certificate) Use the AWS CA1: https://www.amazontrust.com/repository/AmazonRootCA1.pem Then uncomment the line Change the AmazonRootCA1.pem to a DER, then hex. Add it into your code, and you should be good to go. |
hey @reidkersey |
Double check that you are using CA1. Post your code as well. |
hey @reidkersey I have generated .der file from .pem file and check this code(MQTT_x509_DER), also I will share my code soon. Let me verify it once again. I feel that my privatekey.pem is not perfectly converted in key.der so can you help me on that point too |
I can only guarantee that it works with AWS, because that is all that I
have tried it with, and all that I am familiar with. I also haven't
reviewed the code base to see if there is any AWS specific code.
That said, I don't see any obvious reasons why what works with AWS would
not also work with Azure.
…On Fri, Feb 8, 2019, 01:11 CShekhar Suthar ***@***.*** wrote:
hey @reidkersey <https://github.com/reidkersey>
I'm using this code to connect Azure IOT Hub, I just want your
confirmation that Can i connect ? or this code is only for AWS IOT!
I have generated .der file from .pem file and check this
code(MQTT_x509_DER), also
I have generated .der file from .pem file and .hex code from .der file and
check code(MQTT_x509_bin). but found same error.
" Attempting MQTT connection...failed, rc=-2 try again in 5 seconds "
I will share my code soon. Let me verify it once again.
Meanwhile, please review my above sentences.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVzZXuAzBDCfWop6oUc_qgxiR6y8iWg9ks5vLRUBgaJpZM4ZdrNa>
.
|
hello @reidkersey @gunnicus @copercini |
Set the certs like this: The certs should be an array that looks like this: |
Hey @reidkersey but next I get that error " Attempting MQTT connection... ESPnodemcu failed, rc=3 try again in 5 seconds. |
Hey, I'm having the same issues when trying to connect to AWS. Can you share your ESP8266 Configuration? (Upload speed, etc.) I don't see any other problem, I've been trying to do this for quite a while. Thank you |
Board : -> NODEMCU 1.0 (ESP - 12E Module) update back here if you got any path or solution to publish the data |
I have faced the above issue but after using the help from this tutorial finally I am able to sort out all the issues |
Help plz. I'm getting this same "rc=-2" error. I'm using the most recent example, and a set of certs converted to DEM that I've tested, it's connecting to wifi and loading the private key and certs fine, but then showing this error. Here is my code: mqtt_x509_DER.ino.txt And the console log output: log.txt I'm able to test my certs and connection by manually publishing a message on a topic with the same certs using: And I converted the crypto files with: Board = Generic ESP8266 Module Using an ESP-01 with 1MB FLASH |
Hi, I'm using NodeMCU (ESP-12E Module). ESP8266 2.5.0-Beta1, Certificates are copied correctly.
This is the error I'm getting : Attempting MQTT connection...failed, rc=-2 try again in 5 seconds
Here is the output:
SDK:3.0.0-dev(c0f7b44)/Core:2.5.0-beta1=20499901/lwIP:STABLE-2_1_2_RELEASE/glue:1.0-4-gc434c6f/BearSSL:2398cc6
sta config unchangedscandone
wifi evt: 2
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
cnt
connected with OPTUSV943A48, channel 6
dhcp client start...
wifi evt: 0
......ip:192.168.0.12,mask:255.255.255.0,gw:192.168.0.1
wifi evt: 3
.Attempting MQTT connection...[hostByName] request IP for: a234567hlux1-ats.iot.us-east-1.amazonaws.com
[hostByName] Host: a234567hlux1-ats.iot.us-east-1.amazonaws.com IP: 34.206.182.75
:ref 1
BSSL: Connection will fail, no authentication method is setup:wr 250 0
:wrc 250 250 0
:ack 250
:rn 536
:rd 5, 536, 0
:rdi 536, 5
:rd 531, 536, 5
:rdi 531, 531
:c0 531, 536
:rn 1072
:rd 1072, 1072, 0
:rdi 536, 536
:c 536, 536, 1072
:rdi 536, 536
:c0 536, 536
:rn 536
:rd 536, 536, 0
:rdi 536, 536
:c0 536, 536
:rn 1072
:rd 1072, 1072, 0
:rdi 536, 536
:c 536, 536, 1072
:rdi 536, 536
:c0 536, 536
:rn 1072
:rd 1072, 1072, 0
:rdi 536, 536
:c 536, 536, 1072
:rdi 536, 536
:c0 536, 536
:rn 536
:rd 536, 536, 0
:rdi 536, 536
:c0 536, 536
:rn 525
:rd 525, 525, 0
:rdi 525, 525
:c0 525, 525
failed, rc=-2 try again in 5 seconds
The text was updated successfully, but these errors were encountered: