MQT: Connect failed to server <SERVER>:1882, rc -2 #22831
Replies: 7 comments 4 replies
-
As return code -2 indeed means "network connection failed", whatever can cause that would be outside of Tasmota, including but not limited to if you did not specify the right host/IP for your broker. Hence there would not be useful info available for Tasmota to log. It being "quite remote" sounds like a use case for encrypted MQTT-TLS, which requires a special build and configuration, usually not compatible with using port 1883. In case of the bad practice of trying to use unencrypted MQTT via the open Internet, there is also the risk of an ISP messing with certain types of traffic (using a different port number does not check this), for protection purposes. If the issue was about credentials, you'd get a different return code than -2. |
Beta Was this translation helpful? Give feedback.
-
This must definitely be a regression type bug in Tasmota. I downgraded to version 8.5.1, and - without changing any settings at all - it immediatly connected to the same MQTT server and is working now. |
Beta Was this translation helpful? Give feedback.
-
If you jumped from 8.5.1 to 14.x, and using TLS, indeed there were quite some changes I'm not sure exactly what have been done but I remember a recent discussion about preventing to use TLS over 1883 (or was that preventin,g using non-TLS over 8883) ? Making big jump in version number is definitively taking a risk of breaking changes that would have been smoothed regularly following the releases |
Beta Was this translation helpful? Give feedback.
-
Can you provide logs please? |
Beta Was this translation helpful? Give feedback.
-
If not using TLS, this error message often appears when the power supply is border line. |
Beta Was this translation helpful? Give feedback.
-
Same problem here. |
Beta Was this translation helpful? Give feedback.
-
I can access the Mosquitto broker installed on my personal PC (same network) through Tasmota, but I can't access any free broker on the internet. I can access it using any MQTT client. Only Tasmota can't access it and the error is RC -2. I found other people on the internet with a similar problem. With a rollback to a previous version they were able to connect again. In any case, I'll keep trying to connect, maybe it's my own error. |
Beta Was this translation helpful? Give feedback.
-
PROBLEM DESCRIPTION
I am going mad, I fear.
No matter what I do, some Sonoff devices I just flashed with Tasmota-sensors 14.4.1.3 (ddcdc85-sensors).
They just refuse to connect to my (mosquitto) MQTT server with the error "rc -2".
These devices are quite remote. I have exactly the same device (Sonoff POW R2) here, running exactly the same firmware, and it works fine here!
I have tried a lot of things, but nothing works:
So:
Is there any way to debug this in a more detailed way than jut 'RC -2'? I am aware that RC -2 indicated network issues, so I have turned on logging in Tasmota, and right before the failed MQTT connection I just get a successful DNS request line.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:Status 0
:weblog
to 4 and then, when you experience your issue, provide the output of the Console log:TO REPRODUCE
Just run Tasmota
EXPECTED BEHAVIOUR
Succesful connection to MQTT server
SCREENSHOTS
N/A
ADDITIONAL CONTEXT
N/A
(Please, remember to close the issue when the problem has been addressed)
Beta Was this translation helpful? Give feedback.
All reactions