MQTT : Failed to connected to broker
Moderators: grovkillen, Stuntteam, TD-er
MQTT : Failed to connected to broker
After changed protocol to mqtt domoticz I noticed that all my nodemcu (v2 i v3) have some problem with broker (mosquitto) connection.
From time to time (1 hour) I see something as:
1455311799: Client ESPClient1 has exceeded timeout, disconnecting.
1455311799: Socket error on client ESPClient1, disconnecting.
or
1455311700: New client connected from 192.168.10.118 as ESPClient2 (c1, k15, u'b2').
1455311715: Socket error on client ESPClient2, disconnecting.
Further investigation showed some problem with esp wifi:
{"idx":8,"nvalue":0,"svalue":"29.46;0;0;999.07;0"}
bcn_timout,ap_probe_send_start
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
pm close 7
f r-40, MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
WD : Uptime 109 ConnectFailures 4 FreeMem 29048
MQTT : Connection lost
MQTT : Failed to connected to broker
scandone
no Qlin found, reconnect after 1s
reconnect
f 0, MQTT : Failed to connected to broker
10 ps:336 uS 1 ps:164 uS
10 ps:249 uS 1 ps:220 uS
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt
connected with Qlin, channel 1
dhcp client start...
chg_B1:-40
Other mqtt clients working to this broker without problems.
I tested esp easy R60 - R78
Any help is greatly appreciated(;
From time to time (1 hour) I see something as:
1455311799: Client ESPClient1 has exceeded timeout, disconnecting.
1455311799: Socket error on client ESPClient1, disconnecting.
or
1455311700: New client connected from 192.168.10.118 as ESPClient2 (c1, k15, u'b2').
1455311715: Socket error on client ESPClient2, disconnecting.
Further investigation showed some problem with esp wifi:
{"idx":8,"nvalue":0,"svalue":"29.46;0;0;999.07;0"}
bcn_timout,ap_probe_send_start
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
pm close 7
f r-40, MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
WD : Uptime 109 ConnectFailures 4 FreeMem 29048
MQTT : Connection lost
MQTT : Failed to connected to broker
scandone
no Qlin found, reconnect after 1s
reconnect
f 0, MQTT : Failed to connected to broker
10 ps:336 uS 1 ps:164 uS
10 ps:249 uS 1 ps:220 uS
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt
connected with Qlin, channel 1
dhcp client start...
chg_B1:-40
Other mqtt clients working to this broker without problems.
I tested esp easy R60 - R78
Any help is greatly appreciated(;
Re: MQTT : Failed to connected to broker
I am having the same problem. Rel 78 using mossquito broker. I am at a loss as to what the problem is and how to troubleshoot
INIT : Booting Build nr:78
WIFI : Connecting... 1
WIFI : Connected!
INIT : I2C
MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
INIT : Boot OK
INIT : Normal boot
WD : Uptime 0 ConnectFailures 0 FreeMem 26424
MQTT : Connection lost
MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
WD : Uptime 1 ConnectFailures 2 FreeMem 26336
MQTT : Connection lost
MQTT : Failed to connected to broker
INIT : Booting Build nr:78
WIFI : Connecting... 1
WIFI : Connected!
INIT : I2C
MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
INIT : Boot OK
INIT : Normal boot
WD : Uptime 0 ConnectFailures 0 FreeMem 26424
MQTT : Connection lost
MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
WD : Uptime 1 ConnectFailures 2 FreeMem 26336
MQTT : Connection lost
MQTT : Failed to connected to broker
-
- Normal user
- Posts: 31
- Joined: 09 Feb 2016, 22:16
Re: MQTT : Failed to connected to broker
Do the mosquitto logs say anything about the connectionattempts?MarkIngle wrote:I am having the same problem. Rel 78 using mossquito broker. I am at a loss as to what the problem is and how to troubleshoot
INIT : Booting Build nr:78
WIFI : Connecting... 1
WIFI : Connected!
INIT : I2C
MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
INIT : Boot OK
INIT : Normal boot
WD : Uptime 0 ConnectFailures 0 FreeMem 26424
MQTT : Connection lost
MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
WD : Uptime 1 ConnectFailures 2 FreeMem 26336
MQTT : Connection lost
MQTT : Failed to connected to broker
Re: MQTT : Failed to connected to broker
That's a problem too. I cannot figure out where the logs are located or even if logging is enabled. I'm running the broker on Windows 7
Re: MQTT : Failed to connected to broker
windows firewall blocking?
may disable the windows firewall in the services for testing?
may disable the windows firewall in the services for testing?
Re: MQTT : Failed to connected to broker
I finally figured out how to get the mosquitto log files created. At this point I am only get a service startup message.
My lab in environment is really simple I have the broker service running on my laptop. The laptop and ESP are on the same wifi network and I can ping the ESP.
I will do more testing and post results here.
Mark
My lab in environment is really simple I have the broker service running on my laptop. The laptop and ESP are on the same wifi network and I can ping the ESP.
I will do more testing and post results here.
Mark
-
- Normal user
- Posts: 31
- Joined: 09 Feb 2016, 22:16
Re: MQTT : Failed to connected to broker
Here are some guides on how to eneable logging in windows.
https://www.google.no/search?q=mosquitt ... ndows+logs
https://www.google.no/search?q=mosquitt ... ndows+logs
Re: MQTT : Failed to connected to broker
I have logging tuned on but nothing is being posted to the log file. I also have the ESP DEbug level set to 4.
Here is the log info from the ESP....hopefully someone will see something. At this point I dont whatelse to check
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld
ªU
INIT : Booting Build nr:78
bcn 0
del if1
usl
sul 0 0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
bcn 0
del if1
usl
sul 0 0
mode : sta(5c:cf:7f:06:25:4f)
add if0
WIFI : Connecting... 1
f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
pm open phy_2,type:2 0 0
cnt
connected with TheIngles_APE, channel 11
dhcp client start...
ip:10.0.1.37,mask:255.255.255.0,gw:10.0.1.1
WIFI : Connected!
INIT : I2C
MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
INIT : Boot OK
INIT : Normal boot
Here is the log info from the ESP....hopefully someone will see something. At this point I dont whatelse to check
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld
ªU
INIT : Booting Build nr:78
bcn 0
del if1
usl
sul 0 0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
bcn 0
del if1
usl
sul 0 0
mode : sta(5c:cf:7f:06:25:4f)
add if0
WIFI : Connecting... 1
f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
pm open phy_2,type:2 0 0
cnt
connected with TheIngles_APE, channel 11
dhcp client start...
ip:10.0.1.37,mask:255.255.255.0,gw:10.0.1.1
WIFI : Connected!
INIT : I2C
MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
INIT : Boot OK
INIT : Normal boot
Re: MQTT : Failed to connected to broker
After working through my firewall issues I was able to get some logging. I decided to move my troubleshooting to my Mac mini and it paid in getting more information. Below is a log file showing a successful connection between a mosquito_sub client(10.0.1.6) connected to the mosquito broker service on the Mac Mini.
1455424480: Socket read error on client mosqsub/5332-Multirotor, disconnecting.
1455424576: Client mosqsub/65242-Mac-mini. has exceeded timeout, disconnecting.
1455425246: New connection from 10.0.1.6.
1455425246: New client connected from 10.0.1.6 as mosqsub/1032-Multirotor.
1455425384: New connection from 10.0.1.2.
1455425384: Invalid protocol "MQTT" in CONNECT from 10.0.1.2.
1455425384: Socket read error on client (null), disconnecting.
1455425399: New connection from 10.0.1.2.
1455425399: Invalid protocol "MQTT" in CONNECT from 10.0.1.2.
1455425399: Socket read error on client (null), disconnecting.
1455425416: New connection from 10.0.1.2.
1455425416: Invalid protocol "MQTT" in CONNECT from 10.0.1.2.
Below you see the "invalid protocol..." coming from the ESP device (10.0.1.2). This error msg keeps repeating so the firmware on the ESP keeps trying.
Any ideas where I should be looking to correct this?
Why would MQTT be the wrong protocol?
#confusedonthisone!!!
1455424480: Socket read error on client mosqsub/5332-Multirotor, disconnecting.
1455424576: Client mosqsub/65242-Mac-mini. has exceeded timeout, disconnecting.
1455425246: New connection from 10.0.1.6.
1455425246: New client connected from 10.0.1.6 as mosqsub/1032-Multirotor.
1455425384: New connection from 10.0.1.2.
1455425384: Invalid protocol "MQTT" in CONNECT from 10.0.1.2.
1455425384: Socket read error on client (null), disconnecting.
1455425399: New connection from 10.0.1.2.
1455425399: Invalid protocol "MQTT" in CONNECT from 10.0.1.2.
1455425399: Socket read error on client (null), disconnecting.
1455425416: New connection from 10.0.1.2.
1455425416: Invalid protocol "MQTT" in CONNECT from 10.0.1.2.
Below you see the "invalid protocol..." coming from the ESP device (10.0.1.2). This error msg keeps repeating so the firmware on the ESP keeps trying.
Any ideas where I should be looking to correct this?
Why would MQTT be the wrong protocol?
#confusedonthisone!!!
Re: MQTT : Failed to connected to broker
can only give a guess:
maybe the ususal linux MOSQUITO-MQTT implementation as Broker for the ESP-clients is _not_
identical with your mac-MQTT implementation?
something for the devs to dig in? do you have more details of your mac MQTT software?
maybe the ususal linux MOSQUITO-MQTT implementation as Broker for the ESP-clients is _not_
identical with your mac-MQTT implementation?
something for the devs to dig in? do you have more details of your mac MQTT software?
Re: MQTT : Failed to connected to broker
just actually stumbled upon this:
which it think is in ESPeasy. may you check this version requirements with your broker on the mac?
https://github.com/Imroy/pubsubclientNote that for now PubSubClient requires a broker that supports version 3.1.1 of the MQTT standard, not 3.1 or earler.
For Mosquitto, this means version 1.3 or later. Although version 1.3 only officially supports MQTT 3.1, it does accept the "MQTT" protocol name string in the CONNECT message (MQTT 3.1 uses "MQIsdp"). Version 1.4 is recommended however, as it fully supports MQTT 3.1.1.
which it think is in ESPeasy. may you check this version requirements with your broker on the mac?
Re: MQTT : Failed to connected to broker
I found this post that explains what is going on. Not sure I completely understand how to resolve the MQTT 3.1/3.1.1 version issue. So its a compatibility problem between Rev 78 and Mosquitto 1.4.7 which is using MQTT 3.1...at least this is how I understand it. Someone please correct me if this is incorrect.
I found this post which explains the issue.
http://jasecunningham.co.uk/index.php/2 ... n-connect/
I pointed my ESP to test.mosquitto.org:1883. The ESP client and the hosted broker connected. My next step will be to turn off the LED via openHAB.
I found this post which explains the issue.
http://jasecunningham.co.uk/index.php/2 ... n-connect/
I pointed my ESP to test.mosquitto.org:1883. The ESP client and the hosted broker connected. My next step will be to turn off the LED via openHAB.
Re: MQTT : Failed to connected to broker
maybe you rename this thread hereby to SOLVED?MarkIngle wrote: The ESP client and the hosted broker connected.

Re: MQTT : Failed to connected to broker
I dont mind changing the topic to SOLVED once I get the LED working. But what about the issue of compatibility with MQTT? How should that be tracked? Or is it just not worth it?
[SOLVED] MQTT : Failed to connected to broker
darek wrote:After changed protocol to mqtt domoticz I noticed that all my nodemcu (v2 i v3) have some problem with broker (mosquitto) connection.
From time to time (1 hour) I see something as:
1455311799: Client ESPClient1 has exceeded timeout, disconnecting.
1455311799: Socket error on client ESPClient1, disconnecting.
or
1455311700: New client connected from 192.168.10.118 as ESPClient2 (c1, k15, u'b2').
1455311715: Socket error on client ESPClient2, disconnecting.
Further investigation showed some problem with esp wifi:
{"idx":8,"nvalue":0,"svalue":"29.46;0;0;999.07;0"}
bcn_timout,ap_probe_send_start
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
pm close 7
f r-40, MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
WD : Uptime 109 ConnectFailures 4 FreeMem 29048
MQTT : Connection lost
MQTT : Failed to connected to broker
scandone
no Qlin found, reconnect after 1s
reconnect
f 0, MQTT : Failed to connected to broker
10 ps:336 uS 1 ps:164 uS
10 ps:249 uS 1 ps:220 uS
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt
connected with Qlin, channel 1
dhcp client start...
chg_B1:-40
Other mqtt clients working to this broker without problems.
I tested esp easy R60 - R78
Any help is greatly appreciated(;
Re: MQTT : Failed to connected to broker
i am not very experienced with MQTT,
but your link showed up, that the (mosquito) broker should be updated to protocol ver 3.1.1.
what broker do you use on the mac? you mentioned it?
maybe first to google how to check MQTT protocol versions of the broker?
i quoted above from the pubsubclient github-readme, that they suggest to use Mosquitto 1.4 or up.
http://www.esp8266.nu/forum/viewtopic.p ... 4213#p4168
do you have this? cant see from your post...
another observation yesterday, as i thied to compile a new pubsubclient in arduino ide for a led-ws2812-experiment i noticed,
that the source was updated from 1.9.1 to 1.99.1 on github.
i compiled my R078 with old 1.9.1 source. dont know which one you used to build the ESPeasy firmware..
maybe you want to check this also?
dont know which one was used by the devs to build the R078 procompiled binary package, what is downloadable here:
http://www.esp8266.nu/downloads/ESPEasy_R78.zip
dont know how to check wich MQTT procol version is in this compiled binary,
but it looks like that one has to check deeper the procol version of MQTT client and broker for your problem..
may the devs have some more hints...

but your link showed up, that the (mosquito) broker should be updated to protocol ver 3.1.1.
what broker do you use on the mac? you mentioned it?
maybe first to google how to check MQTT protocol versions of the broker?
i quoted above from the pubsubclient github-readme, that they suggest to use Mosquitto 1.4 or up.
http://www.esp8266.nu/forum/viewtopic.p ... 4213#p4168
do you have this? cant see from your post...
another observation yesterday, as i thied to compile a new pubsubclient in arduino ide for a led-ws2812-experiment i noticed,
that the source was updated from 1.9.1 to 1.99.1 on github.
i compiled my R078 with old 1.9.1 source. dont know which one you used to build the ESPeasy firmware..
maybe you want to check this also?
dont know which one was used by the devs to build the R078 procompiled binary package, what is downloadable here:
http://www.esp8266.nu/downloads/ESPEasy_R78.zip
dont know how to check wich MQTT procol version is in this compiled binary,
but it looks like that one has to check deeper the procol version of MQTT client and broker for your problem..
may the devs have some more hints...

Re: MQTT : Failed to connected to broker
i searched the forum and found this discussion about protocol 3.1.1 and
mosquito update.
may this helps?
http://www.esp8266.nu/forum/viewtopic.p ... 4121#p1098
mosquito update.
may this helps?
http://www.esp8266.nu/forum/viewtopic.p ... 4121#p1098
Re: MQTT : Failed to connected to broker
Thanks tozeet for try to help me.
and seems to be correct. I don't see any "invalid protocol " as MarkIngle. Also I have installed mosquitto from http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
I have R78-develop with pubsubclient ver 1.9 (change.log). On github I found v2.6 but this I can't compile to esp project
Also for some test I connected to public mqtt server iot.eclipse.org but I meet the same problem.
Code: Select all
dpkg -l mosquitto
||/ Name Version Architecture Description
+++-===================-==============-==============-===========================================
ii mosquitto 1.4.7-0mosquit armhf MQTT version 3.1/3.1.1 compatible message
I have R78-develop with pubsubclient ver 1.9 (change.log). On github I found v2.6 but this I can't compile to esp project
Code: Select all
no matching function for call to 'PubSubClient::PubSubClient(const char [1])
Re: [SOLVED] MQTT : Failed to connected to broker
i bound my esp12 R078 (pubsub 1.9, i guess) to my raspberry with mosquitto 1.4.5 without any prob.MarkIngle wrote:darek wrote: bcn_timout,ap_probe_send_start
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
pm close 7
f r-40, MQTT : Failed to connected to broker
i checked with mosquito.fx (for fun). seems to work. i looked into your post, but:
maybe you have a wifi-problem _before_ the MQTT problem?
may you check your wifi setup? may the ESP stops the wifi connection?
maybe change your AP, or Position, or Wifi strength?
if the wifi is lost, than the MQTT cant send...

Re: MQTT : Failed to connected to broker
My Mac was running Mosquitto as the broker and it is using MQTT 3.1
It was installed using Homebrew. I tried to figure out how to get a more recent version of mosquitto installed but was not able to do so.
Until then I am using test.mosguitto.org as a broker and I have the LED working (ON/OFF) via openHAB.
My next project is to get a HC-SR04 working and also integrate it into openHAB. (fingers crossed!)
I plan on using another broker service...there are several to choose from.
Thanks for the help guys! I really appreciate it very much!
Mark
It was installed using Homebrew. I tried to figure out how to get a more recent version of mosquitto installed but was not able to do so.
Until then I am using test.mosguitto.org as a broker and I have the LED working (ON/OFF) via openHAB.
My next project is to get a HC-SR04 working and also integrate it into openHAB. (fingers crossed!)
I plan on using another broker service...there are several to choose from.
Thanks for the help guys! I really appreciate it very much!
Mark
Re: MQTT : Failed to connected to broker
I have considered wifi-problem and I'm testing network (ping test). At this moment I don't see any problems with network.
Also I used few ESPs in two localizations in two AP.
Is there any way to switch off a subscription from esp mqtt?
Also I used few ESPs in two localizations in two AP.
Is there any way to switch off a subscription from esp mqtt?
Re: MQTT : Failed to connected to broker
I have the version R91, R100, R103 and 2x R107. When I retart the AP, only R91 to connect always. Other versions someone joins permanently or end up in a loop (Socket error on client ESPClientX, disconnecting.).
I'm using OpenHAB MQTT, Broker Mosquitto 1.4.9 on Linux.
I'm using OpenHAB MQTT, Broker Mosquitto 1.4.9 on Linux.
Re: MQTT : Failed to connected to broker
I too have problems with MQTT with rev 108 on two different devices. Here's my sample log :
Log
299837625 : MQTT : Connected to broker
299837629 : Subscribed to: /oturma grubu/#
299866607 : WD : Uptime 4997 ConnectFailures 17774 FreeMem 27880
299866607 : MQTT : Connection lost
299867624 : MQTT : Connected to broker
299867629 : Subscribed to: /oturma grubu/#
299896608 : WD : Uptime 4998 ConnectFailures 17776 FreeMem 27880
299896608 : MQTT : Connection lost
299897631 : MQTT : Connected to broker
299897634 : Subscribed to: /oturma grubu/#
Re: MQTT : Failed to connected to broker
And if you remove the space in /oturma grubu/ ?
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.
Re: MQTT : Failed to connected to broker
Nothing changes:
306047827 : MQTT : Connected to broker
306047832 : Subscribed to: /oturma_grubu/#
306076814 : WD : Uptime 5101 ConnectFailures 18188 FreeMem 27880
306076814 : MQTT : Connection lost
306077834 : MQTT : Connected to broker
306077838 : Subscribed to: /oturma_grubu/#
306106815 : WD : Uptime 5101 ConnectFailures 18190 FreeMem 27880
306106815 : MQTT : Connection lost
306107848 : MQTT : Connected to broker
306107851 : Subscribed to: /oturma_grubu/#
Re: MQTT : Failed to connected to broker
Somebody can post the compiled (.bin 512k) version 91 ? 

Re: MQTT : Failed to connected to broker
Are you able to connect with mqtt spy to mqtt server?
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.
Re: MQTT : Failed to connected to broker
I'm using MQTT fx and yes i can connect to broker no problem.
I think it has to do with that i changed boot state of the GPIO pin i use(12) to output low. I changed it back to default. Now the problem seems to be solved. Or that i manually rebooted the device. Time will tell
I think it has to do with that i changed boot state of the GPIO pin i use(12) to output low. I changed it back to default. Now the problem seems to be solved. Or that i manually rebooted the device. Time will tell
Re: MQTT : Failed to connected to broker
I have the same problem with the R108. As sozkara.
Re: MQTT : Failed to connected to broker
My ESP still can't connect to broker...
1/ My broker is running well :
2/ I can connect & send fake messages to my broker via MQTT.fx :
Then I receive them well :
Here is my ESPEasy configuration :
And here is my log :
My ESPEasy version is R78
I also tried with versions R107 & R91 and I have exactly the same problem...
Strangely I prefer R78, other versions make my board a little bit noisy, the board make a little shrill noise.
My Mosquitto version is 1.3.4-2 :
If anybody can help me...
Best Regards.

1/ My broker is running well :
Code: Select all
Toma@raspberrypi:~ $ ps aux | grep mos
mosquit+ 338 0.1 0.8 5080 3580 ? S 20:17 0:02 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
pi 4957 0.0 0.3 4244 1660 pts/0 S+ 20:50 0:00 grep --color=auto mos
Code: Select all
Toma@raspberrypi:~ $ sudo mosquitto_sub -t /#
HELLO !!!
I also tried with versions R107 & R91 and I have exactly the same problem...
Strangely I prefer R78, other versions make my board a little bit noisy, the board make a little shrill noise.
My Mosquitto version is 1.3.4-2 :
Code: Select all
Toma@raspberrypi:~ $ dpkg -s mosquitto
Package: mosquitto
Status: install ok installed
Priority: optional
Section: net
Installed-Size: 186
Maintainer: Roger A. Light <roger@atchoo.org>
Architecture: armhf
Version: 1.3.4-2
Description: MQTT version 3.1/3.1.1 compatible message broker
This is a message broker that supports version 3.1 and 3.1.1 of the MQTT
protocol.
Best Regards.
Re: MQTT : Failed to connected to broker
I think I have found the solution...
My controller IP adress is not 192.168.0.100 but 192.168.1.100
I'll check it tonight @home and send you reply.

My controller IP adress is not 192.168.0.100 but 192.168.1.100

I'll check it tonight @home and send you reply.
Code: Select all
90% of problems are located between the chair and the keyboard...
Re: MQTT : Failed to connected to broker
All is good for me with :
Mosquitto version 1.3.4-2
ESPEasy R78
Mosquitto version 1.3.4-2
ESPEasy R78
Re: MQTT : Failed to connected to broker
your esp-modules are on your net 192.168.1.x,
and your mosquitto-server is in a different net 192.168.0.x
(look at your screenshots).
are you shure, you can reach clients from one net on the other?
maybe you check your networking-setup regarding this routing?
----
oop,s sorry . didnt saw your postings...
and your mosquitto-server is in a different net 192.168.0.x
(look at your screenshots).
are you shure, you can reach clients from one net on the other?
maybe you check your networking-setup regarding this routing?
----
oop,s sorry . didnt saw your postings...
Re: MQTT : Failed to connected to broker
Hello all,
I have found this problem in all versions that I have tried since R78. Once ESP Easy lost the IP connection with MQTT broker, it can't connect again entering in a infinite loop. Doesn't matter if the ESP lost wifi connection or MQTT server goes down. I have tried to change the ESP Easy code in order to increase the time between reconnections attempts. The original value is 500 milliseconds and I changed it to 5000 without success.
Also, I have write some simple code to publish some sensor values using MQTT in a very similar way that ESP Easy do but using the last MQTT libraries. Everything works very well.
So, my theory is that the MQTT library used by ESP Easy (Nick O'Leary Version 1.9.1) is causing the problem. In my small test program I'm using last version 2.6.0. The problem is that if you try to compile ESP Easy with the last MQTT library, you will get a lot of compilations errors and unfortunately, my C++ programing skills are very poor and insufficient to change a complex code like ESP Easy and contribute with this awesome project...
I have found this problem in all versions that I have tried since R78. Once ESP Easy lost the IP connection with MQTT broker, it can't connect again entering in a infinite loop. Doesn't matter if the ESP lost wifi connection or MQTT server goes down. I have tried to change the ESP Easy code in order to increase the time between reconnections attempts. The original value is 500 milliseconds and I changed it to 5000 without success.
Also, I have write some simple code to publish some sensor values using MQTT in a very similar way that ESP Easy do but using the last MQTT libraries. Everything works very well.
So, my theory is that the MQTT library used by ESP Easy (Nick O'Leary Version 1.9.1) is causing the problem. In my small test program I'm using last version 2.6.0. The problem is that if you try to compile ESP Easy with the last MQTT library, you will get a lot of compilations errors and unfortunately, my C++ programing skills are very poor and insufficient to change a complex code like ESP Easy and contribute with this awesome project...
Re: MQTT : Failed to connected to broker
So let's see if upgrading to 2.6. makes a difference to solve the issues. Can you pull R109 from github, compile using the 2.6 library and see if it works better than the old library?ut1545 wrote:Hello all,
I have found this problem in all versions that I have tried since R78. Once ESP Easy lost the IP connection with MQTT broker, it can't connect again entering in a infinite loop. Doesn't matter if the ESP lost wifi connection or MQTT server goes down. I have tried to change the ESP Easy code in order to increase the time between reconnections attempts. The original value is 500 milliseconds and I changed it to 5000 without success.
Also, I have write some simple code to publish some sensor values using MQTT in a very similar way that ESP Easy do but using the last MQTT libraries. Everything works very well.
So, my theory is that the MQTT library used by ESP Easy (Nick O'Leary Version 1.9.1) is causing the problem. In my small test program I'm using last version 2.6.0. The problem is that if you try to compile ESP Easy with the last MQTT library, you will get a lot of compilations errors and unfortunately, my C++ programing skills are very poor and insufficient to change a complex code like ESP Easy and contribute with this awesome project...
Re: MQTT : Failed to connected to broker
i compiled just for me wemos-d1 mini,
with pubsubclient v2.6 on arduino-ide 1.6.5 and platform 2.1.0 without bigger issues.
only this little hint poped up:
did not yet tested mqtt...but complie was ok..
with pubsubclient v2.6 on arduino-ide 1.6.5 and platform 2.1.0 without bigger issues.
only this little hint poped up:
Code: Select all
C:\Users\olaf\AppData\Local\Temp\build7720517566021989786.tmp\ESPEasy.cpp -o C:\Users\olaf\AppData\Local\Temp\build7720517566021989786.tmp\ESPEasy.cpp.o
_P001_Switch.ino: In function 'boolean Plugin_001(byte, EventStruct*, String&)':
_P001_Switch.ino:235:31: warning: NULL used in arithmetic [-Wpointer-arith]
C:\Users\olaf\AppData\Roaming\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -IC:\Users\olaf\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.1.0/tools/sdk/include -c -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DARDUINO=10605 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266 -DESP8266 -IC:\Users\olaf\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266
Re: MQTT : Failed to connected to broker
i left all the same, but updated board manager to esp-plattform 2.3.0 and compiled ok with this warnings:
Code: Select all
-IC:\Users\olaf\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266HTTPUpdateServer\src -ID:\daten\olaf.arduino\arduino-1.6.5-r5\libraries\IRremoteESP8266 C:\Users\olaf\AppData\Local\Temp\build6597881346912999724.tmp\ESPEasy.cpp -o C:\Users\olaf\AppData\Local\Temp\build6597881346912999724.tmp\ESPEasy.cpp.o
ESPEasy.ino:227:0: warning: "LWIP_OPEN_SRC" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
_P001_Switch.ino: In function 'boolean Plugin_001(byte, EventStruct*, String&)':
_P001_Switch.ino:235:31: warning: NULL used in arithmetic [-Wpointer-arith]
C:\Users\olaf\AppData\Roaming\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -IC:\Users\olaf\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.
Re: MQTT : Failed to connected to broker
i set plattform to 2.2.0 and got a build, but with the same hints as in 2.1.0
did not uploaded yet to test....but binaries are build...
Code: Select all
ID:\daten\olaf.arduino\arduino-1.6.5-r5\libraries\IRremoteESP8266 C:\Users\olaf\AppData\Local\Temp\build6597881346912999724.tmp\ESPEasy.cpp -o C:\Users\olaf\AppData\Local\Temp\build6597881346912999724.tmp\ESPEasy.cpp.o
_P001_Switch.ino: In function 'boolean Plugin_001(byte, EventStruct*, String&)':
_P001_Switch.ino:235:31: warning: NULL used in arithmetic [-Wpointer-arith]
C:\Users\olaf\AppData\Roaming\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++ -D__ets__ -DICAC
Re: MQTT : Failed to connected to broker
Hi all,
I have tested the R109 with 2.6 library and everything seams to work ok. After the IP connection to the broker has been restored, ESP Easy reconnects immediately and stays connected.
I will continue to test this version and will keep all of you informed.
Good work Martinus and thank you very much.
I have tested the R109 with 2.6 library and everything seams to work ok. After the IP connection to the broker has been restored, ESP Easy reconnects immediately and stays connected.
I will continue to test this version and will keep all of you informed.
Good work Martinus and thank you very much.
Re: MQTT : Failed to connected to broker
Okay, now I feel like an idiot..... Last time I compiled & uploaded successfully was R108. Seams we have new good stuff, MQTT pubsubclient v2.6, LWT with subscribe MQTT <template>/status, etc.
Downloaded Arduino 16.10 (last successful one I sed was 1.6.8), upgraded boards manager to v2.3.0.
But compile complains ..... fatal error: PubSubClient.h: No such file or directory #include <PubSubClient.h>
So, where on earth do I find pubsubclient v2.6 ? Stable version R108 - under directory Source/Libraries/pubsubclient/ seams to be the 1.9 version?
So where do I find v2.6 ?
(thank you, search high and low, on this forum and net, cannot find it?)
Downloaded Arduino 16.10 (last successful one I sed was 1.6.8), upgraded boards manager to v2.3.0.
But compile complains ..... fatal error: PubSubClient.h: No such file or directory #include <PubSubClient.h>
So, where on earth do I find pubsubclient v2.6 ? Stable version R108 - under directory Source/Libraries/pubsubclient/ seams to be the 1.9 version?
So where do I find v2.6 ?
(thank you, search high and low, on this forum and net, cannot find it?)
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.
Re: MQTT : Failed to connected to broker
//Feel like an idiot// - for not finding pubs v2.6.
Found it - Arduino menu > Sketch > Include Library > Manage Libraries.
(Maybe this helps others......)
Found it - Arduino menu > Sketch > Include Library > Manage Libraries.
(Maybe this helps others......)
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.
Re: MQTT : Failed to connected to broker
FYI, for anyone with the same issue I had..
I treated myself to a cubietruck 5 last weekend, running Lubuntu; I managed to get everything working with the exception of MQTT (mqtt installed fine and the service was running and I could publish to the broker using another remote Domoticz server also node_red connected to ok, but the ESP would not connect.
After some time googling I found that by adding the following into the repository,
https://mosquitto.org/2013/01/mosquitto ... epository/
adding the following line
Save and update
this updated mosquitto and is now working fine 
I treated myself to a cubietruck 5 last weekend, running Lubuntu; I managed to get everything working with the exception of MQTT (mqtt installed fine and the service was running and I could publish to the broker using another remote Domoticz server also node_red connected to ok, but the ESP would not connect.
After some time googling I found that by adding the following into the repository,
https://mosquitto.org/2013/01/mosquitto ... epository/
Code: Select all
sudo nano /etc/apt/sources.list
Code: Select all
deb http://repo.mosquitto.org/debian /wheezy main trusty main restricted
Code: Select all
sudo apt-get update

Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 20 guests