Public MQTT Broker not working

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
TommoT1
Normal user
Posts: 15
Joined: 17 Aug 2018, 11:46

Public MQTT Broker not working

#1 Post by TommoT1 » 17 Aug 2018, 12:02

Hi there I'm quite new to espEasy and unable to solve my problem.

I use the v2.0-20180322 Version on an SonOff S20 and on an ESP-01.
When I try to connect to test.mosquitto.org on Port 1883 I get :

269857394 : MQTT : Intentional reconnect
269857474 : MQTT : Failed to connect to broker
269859394 : MQTT : Intentional reconnect
269859478 : MQTT : Failed to connect to broker
269861394 : MQTT : Intentional reconnect
all the time.

Use Hostname: test.mosquitto.org
Port 1883
Username and Password: blank
Controller Subscribe:/OWNSUBJECT/#
Controller Publish:/OWNSUBJECT/Status

I tried the Domoticz MQTT
the OpenHAB MQTT
and PiDome MQTT.
all the same.

When I set up a local MQTT Broker just in its basic config it works out of the box (with IP adress instead of Hostname).
I also tried the latest ESP_Easy_mega-20180809_normal_ESP8266_1024.bin, same behaviour.
I also made a test account on www.cloudmqtt.com, same same.
Does anybody has a hint for me to get it working?

Regards
Tom

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: Public MQTT Broker not working

#2 Post by oisisi » 17 Aug 2018, 16:55

Try to replace the hostname with the IP address 37.187.106.16 (and change the dropdown accordingly).

TommoT1
Normal user
Posts: 15
Joined: 17 Aug 2018, 11:46

Re: Public MQTT Broker not working

#3 Post by TommoT1 » 18 Aug 2018, 00:40

Thanks!
I forgot to mention, i also did that with no change :-(

Regards
Thomas

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: Public MQTT Broker not working

#4 Post by oisisi » 18 Aug 2018, 09:31

Then I am also out of ideas. Is your issue perhaps related to this topic?

TommoT1
Normal user
Posts: 15
Joined: 17 Aug 2018, 11:46

Re: Public MQTT Broker not working

#5 Post by TommoT1 » 19 Aug 2018, 12:26

Yes, might be.
I'm running out of ideas, testet ESPURNA and TASMOTA just for the MQTT part.
Both work flawlessly with public brokers.
But configurability of espeasy ist way better.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Public MQTT Broker not working

#6 Post by TD-er » 19 Aug 2018, 20:03

Please check also your network settings on the ESP node.
Do you use DHCP? Is the gateway set right?

TommoT1
Normal user
Posts: 15
Joined: 17 Aug 2018, 11:46

Re: Public MQTT Broker not working

#7 Post by TommoT1 » 19 Aug 2018, 23:53

Hi TD-er,
Yes I use DHCP, also tried fixed IP with correct gateway, no change.
I also tried setting up a local mosquitto -> works.
Then I forwarded a port from my router to my local broker and told espeasy my dyndns address (and trie the same with current IP Address) with the open port -> failed to connect to broker,
the same as with test.mosquitto.org
By the way, NTP works, so there shouldn' t be a gateway problem.

kenkoknz
Normal user
Posts: 64
Joined: 03 Jul 2018, 23:46
Location: New Zealand

Re: Public MQTT Broker not working

#8 Post by kenkoknz » 20 Aug 2018, 03:33

Looks like you tried just about everything. Probably this may not be your solution, but just on the off chance, try changing the subscribe and publish topic to without the leading slashes ie:

Controller Subscribe:OWNSUBJECT/#
Controller Publish:OWNSUBJECT/Status

try on a fresh esp.

Cheers,
Ken

TommoT1
Normal user
Posts: 15
Joined: 17 Aug 2018, 11:46

Re: Public MQTT Broker not working

#9 Post by TommoT1 » 20 Aug 2018, 11:26

Hi Ken!
During all the testing I tried this too and at the moment it runs without the leading slashes,
but only connects to my local broker.

I everybody else capable to establish a connection to (for example) test.mosquitto.org ?


Regards
Thomas

kenkoknz
Normal user
Posts: 64
Joined: 03 Jul 2018, 23:46
Location: New Zealand

Re: Public MQTT Broker not working

#10 Post by kenkoknz » 20 Aug 2018, 11:54

Have you try broker.hivemq? I use hivemq and it works good without any problems. I also tried adafruit.io and that also works.
Ken

TommoT1
Normal user
Posts: 15
Joined: 17 Aug 2018, 11:46

Re: Public MQTT Broker not working

#11 Post by TommoT1 » 20 Aug 2018, 19:15

Hey Ken!

Thanks, I tried broker.hivemq.com and it worked instantaneously!

Great tip, thank you!
But still wondering why the mosquitto broker won't work when outside its local network....

Regards
Thomas

Post Reply

Who is online

Users browsing this forum: Jieffe and 31 guests