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

Failed to connect to MQTT Server! #9

Closed
rikochet opened this issue Mar 13, 2018 · 2 comments
Closed

Failed to connect to MQTT Server! #9

rikochet opened this issue Mar 13, 2018 · 2 comments

Comments

@rikochet
Copy link

Hi,

The library looks great, I'm keen to start using it however I am unable to connect to an MQTT server.

I am trying to connect to;
host: broker.mqtt-dashboard.com
port: 1883

I've tried connecting to a few different servers but they all result in a loop of the following error.
[INFO 2018-02-12 22:52:31] Attempting to Connect to MQTT Server
[ERROR 2018-02-12 22:52:31] Failed to connect to MQTT Server!
[INFO 2018-02-12 22:52:31] Failed too many times to establish a MQTT connection. Restarting Device.

I've tried using the GarageDoorOpener, Coogle Feeder and Coogle Switch in case I was missing something in my code but they all have the same result.

If I use the PubSubClient sketch (https://github.com/knolleary/pubsubclient/blob/master/examples/mqtt_esp8266/mqtt_esp8266.ino) then I can connect to an MQTT server without issue.

Do you have any suggestions as to how I can get a more verbose error message?

Thanks in advance.

@coogle
Copy link
Collaborator

coogle commented Mar 19, 2018

Hmm, Are you showing that you connected to the WiFi prior to connecting to the MQTT server? Also are you using credentials trying to connect to the MQTT or just a straight connection without auth?

Under the hood CoogleIOT uses PubSubClient, so if you can connect with one you can connect with the other in theory.

@coogle
Copy link
Collaborator

coogle commented May 3, 2018

Try version 1.3.1+ of the library (latest release) which adds improved MQTT error reporting so hopefully that will help you debug your issue!

@coogle coogle closed this as completed May 3, 2018
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

2 participants