se1exin / ESPBlinds

ESP8266 Controller for automatic roller blinds project
MIT License
115 stars 12 forks source link

MQTT error #7

Closed LapisTomato closed 1 year ago

LapisTomato commented 2 years ago

Attempting MQTT connection...failed, rc=-2 try again in 5 seconds

se1exin commented 2 years ago

It's very hard to know the issue with that little info, but my guess is that it can't find the MQTT server, or it can't authenticate with it

LapisTomato commented 2 years ago

How's do I make the ESP8266 find the MQTT server? Also what information would you need? Should I copy paste the code so that you can cross check it?

se1exin commented 2 years ago

I would make sure that you're ESP8266 is successfully connecting to your Wifi, and that you have the MQTT_SERVER IP address correctly set to the IP address of the computer that is running MQTT.

The MQTT server needs to be on the same network that your ESP8266 is connecting to, and you will need to make sure that the computer running the MQTT server is not blocking any connections - e.g. with a firewall or similar.

What's your MQTT server setup? E.g. what computer OS is it running on, which MQTT server software are you using, and which port is the MQTT server software running on?

LapisTomato commented 2 years ago

@se1exin Sorry for the late reply.

set to the IP address of the computer that is running MQTT.

Do you mean the IPv4, the internet's IP adress?

you will need to make sure that the computer running the MQTT server is not blocking any connections - e.g. with a firewall or similar.

I have all the firewalls turned off

What's your MQTT server setup? E.g. what computer OS is it running on, which MQTT server software are you using, and which port is the MQTT server software running on?

Windows 11 MQTT Explorer 1883