Page 1 of 1

Public MQTT Broker not working

Posted: 17 Aug 2018, 12:02
by TommoT1
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

Re: Public MQTT Broker not working

Posted: 17 Aug 2018, 16:55
by oisisi
Try to replace the hostname with the IP address 37.187.106.16 (and change the dropdown accordingly).

Re: Public MQTT Broker not working

Posted: 18 Aug 2018, 00:40
by TommoT1
Thanks!
I forgot to mention, i also did that with no change :-(

Regards
Thomas

Re: Public MQTT Broker not working

Posted: 18 Aug 2018, 09:31
by oisisi
Then I am also out of ideas. Is your issue perhaps related to this topic?

Re: Public MQTT Broker not working

Posted: 19 Aug 2018, 12:26
by TommoT1
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.

Re: Public MQTT Broker not working

Posted: 19 Aug 2018, 20:03
by TD-er
Please check also your network settings on the ESP node.
Do you use DHCP? Is the gateway set right?

Re: Public MQTT Broker not working

Posted: 19 Aug 2018, 23:53
by TommoT1
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.

Re: Public MQTT Broker not working

Posted: 20 Aug 2018, 03:33
by kenkoknz
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

Re: Public MQTT Broker not working

Posted: 20 Aug 2018, 11:26
by TommoT1
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

Re: Public MQTT Broker not working

Posted: 20 Aug 2018, 11:54
by kenkoknz
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

Re: Public MQTT Broker not working

Posted: 20 Aug 2018, 19:15
by TommoT1
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