Mosquitto on Ubuntu - no connection
Moderators: grovkillen, Stuntteam, TD-er
-
- New user
- Posts: 9
- Joined: 07 Sep 2018, 07:51
Mosquitto on Ubuntu - no connection
Guys,
New to the product - but have been using Mosquitto for a fair amount of time and have MQTT running from a number of android devices etc.
Flashed a Node-MCU with your software - absolutely brilliant how easy it was.
Stumbled my way through the initial config and all seems fine
However i am not getting anything showing up at the Mosquitto broker.
I fired up MQTT SPY on my laptop and changed the controller (Openhab MQTT) to point to my laptop IP address rather than the Mosquitto VM (I have mosquitto running on my laptop also)
I have told it to use IP address
192.168.1.134
I have changed the default Sub and pub templates to
%sysname%/#
%sysname%/%tskname%/%valname%
i.e. i have removed the leading /
IN MQTT Spy i can see the messages coming in
When i change the IP address to point to my Mosquitto on my Ubuntu VM - no messages come in
I have logging enabled to All on Mosquitto - on the Ubuntu VM - i am tailing the log file and can see all the other connection messages coming in from Node-red and the other clients - but nothing from ESP_Easy
I have the firewall disabled on Ubuntu.
They are both on the same flat IP network 192.168.1.x
I will roll back to an older firmware and see if that makes any diference - otherwise - any ideas ?
Craig
New to the product - but have been using Mosquitto for a fair amount of time and have MQTT running from a number of android devices etc.
Flashed a Node-MCU with your software - absolutely brilliant how easy it was.
Stumbled my way through the initial config and all seems fine
However i am not getting anything showing up at the Mosquitto broker.
I fired up MQTT SPY on my laptop and changed the controller (Openhab MQTT) to point to my laptop IP address rather than the Mosquitto VM (I have mosquitto running on my laptop also)
I have told it to use IP address
192.168.1.134
I have changed the default Sub and pub templates to
%sysname%/#
%sysname%/%tskname%/%valname%
i.e. i have removed the leading /
IN MQTT Spy i can see the messages coming in
When i change the IP address to point to my Mosquitto on my Ubuntu VM - no messages come in
I have logging enabled to All on Mosquitto - on the Ubuntu VM - i am tailing the log file and can see all the other connection messages coming in from Node-red and the other clients - but nothing from ESP_Easy
I have the firewall disabled on Ubuntu.
They are both on the same flat IP network 192.168.1.x
I will roll back to an older firmware and see if that makes any diference - otherwise - any ideas ?
Craig
-
- New user
- Posts: 9
- Joined: 07 Sep 2018, 07:51
Re: Mosquitto on Ubuntu - no connection
This is now resolved with going back to R120 - previously i was on the latest Dev release - It may be something the Devs want to look at
regards
Craig
regards
Craig
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Mosquitto on Ubuntu - no connection
I would think it has to do with the Mosquitto setup? We're now using unique client IDs for example.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
-
- Normal user
- Posts: 33
- Joined: 05 Jun 2017, 05:32
Re: Mosquitto on Ubuntu - no connection
FWIW, I'm using a dev version from July I think (at work and can't check), and mosquitto works fine for me.
I can both send commands, and receive status over mosquitto.
Also, if it works on your laptop, but not on Ubuntu, that seems to point to a difference between the two.
Randy
I can both send commands, and receive status over mosquitto.
Also, if it works on your laptop, but not on Ubuntu, that seems to point to a difference between the two.
Randy
-
- New user
- Posts: 9
- Joined: 07 Sep 2018, 07:51
Re: Mosquitto on Ubuntu - no connection
Guys,
OK more follow up on this
I went back to the 1.20 release and it worked fine to my Mosquitto on Node-Red (Ubuntu 16.04)
I was then curious to see what was going on
So i flashed a brand new Sonoff Basic - with ESP_Easy_mega-20180910_normal_ESP8266_1024
Flashing is fine - same problem.
My testing setup is as follows
Windows 10 laptop - IP 192.168.1.134
Mosquitto 1.5.1 running on there in a console window - started as Administrator
run Mosquitto with mosquitto -v
On my live setup - Ubuntu 16.04 192.168.1.35 - all latest updates applied as of yesterday through Webmin - Firewall/IPTables disabled, running Mosquitto V 1.4.8 as a daemon - this is live and has 6 different clients (Arduino Ether and ESP8266) talking to it with Arduino sketches - Node-Red also runs on the same box - i am running a tail-f of the mosquitto log file for all testing
On my firewall i have defined a static IP 192.168.1.104 for the sonoff - after a reboot it gets that IP and i can hit it with Chrome.
After flashing the latest mega (as above) to the Sonoff - i setup Openhab MQTT as the broker and point it at the IP address of my ubuntu system
I define a switch on GPIO12 in devices.
I remove the leading forward slash from both the pub and sub on the ESPEASY
I see nothing at all coming into the mosquitto broker on my ubuntu system (from the Sonoff)
If i change nothing except the IP address of the OpenHab broker to point to my laptop i can see messages coming in - i can also publish messages to the sonoff and turn the relay on and off from a command line mosquitto_pub on the windows box - so all is working OK
I have MQTT spy setup on my laptop so i setup two connections on it - one pointing at my ubuntu system to monitor all topics and one pointing at the windows mosquitto to monitor all topics.
I then fire up my 2nd ESPEasy on the nodemcu from my initial testing which is now running
Build: 120
Core Version: 2_3_0
It immediately connects to my Ubuntu system and starts pumping out measurements and i can see them turn up in my node-red dashboard
So in summary Build 120 connects to Ubuntu Mosquitto 1.4.8 no problems,
mega-20180910 will not - this is from two different devices
Remembering i also did this initial test on mega-20180904
I have no security on my Mosquitto broker on either machine (i.e. username/password/machine names are not needed or checked)
Any ideas guys ? I would really much prefer to run the newer builds and am happy to help you get to the bottom of this.
Craig
OK more follow up on this
I went back to the 1.20 release and it worked fine to my Mosquitto on Node-Red (Ubuntu 16.04)
I was then curious to see what was going on
So i flashed a brand new Sonoff Basic - with ESP_Easy_mega-20180910_normal_ESP8266_1024
Flashing is fine - same problem.
My testing setup is as follows
Windows 10 laptop - IP 192.168.1.134
Mosquitto 1.5.1 running on there in a console window - started as Administrator
run Mosquitto with mosquitto -v
On my live setup - Ubuntu 16.04 192.168.1.35 - all latest updates applied as of yesterday through Webmin - Firewall/IPTables disabled, running Mosquitto V 1.4.8 as a daemon - this is live and has 6 different clients (Arduino Ether and ESP8266) talking to it with Arduino sketches - Node-Red also runs on the same box - i am running a tail-f of the mosquitto log file for all testing
On my firewall i have defined a static IP 192.168.1.104 for the sonoff - after a reboot it gets that IP and i can hit it with Chrome.
After flashing the latest mega (as above) to the Sonoff - i setup Openhab MQTT as the broker and point it at the IP address of my ubuntu system
I define a switch on GPIO12 in devices.
I remove the leading forward slash from both the pub and sub on the ESPEASY
I see nothing at all coming into the mosquitto broker on my ubuntu system (from the Sonoff)
If i change nothing except the IP address of the OpenHab broker to point to my laptop i can see messages coming in - i can also publish messages to the sonoff and turn the relay on and off from a command line mosquitto_pub on the windows box - so all is working OK
I have MQTT spy setup on my laptop so i setup two connections on it - one pointing at my ubuntu system to monitor all topics and one pointing at the windows mosquitto to monitor all topics.
I then fire up my 2nd ESPEasy on the nodemcu from my initial testing which is now running
Build: 120
Core Version: 2_3_0
It immediately connects to my Ubuntu system and starts pumping out measurements and i can see them turn up in my node-red dashboard
So in summary Build 120 connects to Ubuntu Mosquitto 1.4.8 no problems,
mega-20180910 will not - this is from two different devices
Remembering i also did this initial test on mega-20180904
I have no security on my Mosquitto broker on either machine (i.e. username/password/machine names are not needed or checked)
Any ideas guys ? I would really much prefer to run the newer builds and am happy to help you get to the bottom of this.
Craig
-
- New user
- Posts: 9
- Joined: 07 Sep 2018, 07:51
Re: Mosquitto on Ubuntu - no connection
As more info.
I have now upgraded the mosquitto on Ubuntu from Source to 1.5.1 - this is now the same as the Windows version
Same problems
Here is an excerpt from the log file
1536801224: New connection from 192.168.1.104 on port 1883.
1536801224: Sending CONNACK to 192.168.1.104 (0, 5)
1536801224: Socket error on client <unknown>, disconnecting.
I have gone back in the logs and that is the only time that i see the ESP attempting to attach and then it disappears (this happened after a reboot)
I have then changed the controller to point to my laptop - and this is what comes up on the mosquitto logs
1536809029: Tank_Top_Up_Pump/# (QoS 0)
1536809029: ESPClient_5C:CF:7F:81:B2:B1 0 Tank_Top_Up_Pump/#
1536809029: Sending SUBACK to ESPClient_5C:CF:7F:81:B2:B1
1536809029: Received PUBLISH from ESPClient_5C:CF:7F:81:B2:B1 (d0, q0, r1, m0, 'Tank_Top_Up_Pump/status/LWT', ... (2 bytes))
1536809029: Sending PUBLISH to mosqsub|15192-CCs-Dell- (d0, q0, r0, m0, 'Tank_Top_Up_Pump/status/LWT', ... (2 bytes))
1536809029: Sending PUBLISH to ESPClient_5C:CF:7F:81:B2:B1 (d0, q0, r0, m0, 'Tank_Top_Up_Pump/status/LWT', ... (2 bytes))
1536809039: Received PINGREQ from ESPClient_5C:CF:7F:81:B2:B1
1536809039: Sending PINGRESP to ESPClient_5C:CF:7F:81:B2:B1
1536809049: Received PINGREQ
Any ideas ?
Craig
I have now upgraded the mosquitto on Ubuntu from Source to 1.5.1 - this is now the same as the Windows version
Same problems
Here is an excerpt from the log file
1536801224: New connection from 192.168.1.104 on port 1883.
1536801224: Sending CONNACK to 192.168.1.104 (0, 5)
1536801224: Socket error on client <unknown>, disconnecting.
I have gone back in the logs and that is the only time that i see the ESP attempting to attach and then it disappears (this happened after a reboot)
I have then changed the controller to point to my laptop - and this is what comes up on the mosquitto logs
1536809029: Tank_Top_Up_Pump/# (QoS 0)
1536809029: ESPClient_5C:CF:7F:81:B2:B1 0 Tank_Top_Up_Pump/#
1536809029: Sending SUBACK to ESPClient_5C:CF:7F:81:B2:B1
1536809029: Received PUBLISH from ESPClient_5C:CF:7F:81:B2:B1 (d0, q0, r1, m0, 'Tank_Top_Up_Pump/status/LWT', ... (2 bytes))
1536809029: Sending PUBLISH to mosqsub|15192-CCs-Dell- (d0, q0, r0, m0, 'Tank_Top_Up_Pump/status/LWT', ... (2 bytes))
1536809029: Sending PUBLISH to ESPClient_5C:CF:7F:81:B2:B1 (d0, q0, r0, m0, 'Tank_Top_Up_Pump/status/LWT', ... (2 bytes))
1536809039: Received PINGREQ from ESPClient_5C:CF:7F:81:B2:B1
1536809039: Sending PINGRESP to ESPClient_5C:CF:7F:81:B2:B1
1536809049: Received PINGREQ
Any ideas ?
Craig
Re: Mosquitto on Ubuntu - no connection
What are the IP-addresses of the Windows and the Ubuntu machine?
Are they in the same subnet?
Do you connect using hostname, or IP-address?
Are they in the same subnet?
Do you connect using hostname, or IP-address?
-
- New user
- Posts: 9
- Joined: 07 Sep 2018, 07:51
Re: Mosquitto on Ubuntu - no connection
Yep they are all on the same subnet
Ubuntu is 192.168.1.35
Windows is 192.168.1.134
Nodemcu with 1.2 is 192.168.1.103
Sonoff basic with ver 2 is 192.168.1.104
All hosts are resolved by IP address
The ESPEasy devices get their IP through DHCP - it is a reserved address on the firewall
Craig
Ubuntu is 192.168.1.35
Windows is 192.168.1.134
Nodemcu with 1.2 is 192.168.1.103
Sonoff basic with ver 2 is 192.168.1.104
All hosts are resolved by IP address
The ESPEasy devices get their IP through DHCP - it is a reserved address on the firewall
Craig
Re: Mosquitto on Ubuntu - no connection
And just to be sure, the subnetmask is 255.255.255.0 ?
-
- New user
- Posts: 9
- Joined: 07 Sep 2018, 07:51
Re: Mosquitto on Ubuntu - no connection
Umm yeah - i do networking for a living !! Pretty sure my infrastructure is OK
To confirm this i flashed the misbehaving device with 1.2 ESPEasy and it worked straight away and is chattering away doing its thing now. (This is on the Sonoff Basic)
regards
Craig
To confirm this i flashed the misbehaving device with 1.2 ESPEasy and it worked straight away and is chattering away doing its thing now. (This is on the Sonoff Basic)
regards
Craig
Re: Mosquitto on Ubuntu - no connection
OK, I will also install Mosquito 1.5 to one of my Ubuntu machines (currently it is running here on a Pi3) to see if I can reproduce it.
OpenHab MQTT and no user/pass?
OpenHab MQTT and no user/pass?
-
- New user
- Posts: 9
- Joined: 07 Sep 2018, 07:51
Re: Mosquitto on Ubuntu - no connection
Yep, Ubunutu 16.04 - all modules updated through webmin
Initially Mosquitto 1.4.8, then updated (from source to 1.5.1)
The same unit that would not connect on Mega 2 version is quite happily working for the last 3 days on 1.2 - no issues.
I have blasted the Mega 2 release onto a spare unit so can do any testing you would like to do
Craig
Initially Mosquitto 1.4.8, then updated (from source to 1.5.1)
The same unit that would not connect on Mega 2 version is quite happily working for the last 3 days on 1.2 - no issues.
I have blasted the Mega 2 release onto a spare unit so can do any testing you would like to do
Craig
Re: Mosquitto on Ubuntu - no connection
In recent versions there is an advanced setting "MQTT usage unit name as ClientId" have you tried activating that?
-
- New user
- Posts: 9
- Joined: 07 Sep 2018, 07:51
Re: Mosquitto on Ubuntu - no connection
No i have not tried that - but i have no security on my setup i.e. i do not demand user/password combos nor do i tie it down to ClientIDs/IP addresses etc.
The sticking point i have is that i can take the exact same hardware i.e. the same physical device - put 1.2 on it and it works as expected - as soon as i flash the Mega 2 - it fails to connect - i can not see how that is anything in the Mosquitto setup - but as a pointer the exact same version of mosquitto on windows (10) - does work - so it would see to point to something that is different in the underlying comms
Craig
The sticking point i have is that i can take the exact same hardware i.e. the same physical device - put 1.2 on it and it works as expected - as soon as i flash the Mega 2 - it fails to connect - i can not see how that is anything in the Mosquitto setup - but as a pointer the exact same version of mosquitto on windows (10) - does work - so it would see to point to something that is different in the underlying comms
Craig
Re: Mosquitto on Ubuntu - no connection
The client ID is not about security it is about identity. Every MQTT client introduces itself with an ID when connecting to the broker. I observed similar behavior when a client ID was not unique. The broker would reject connections from clients using an ID that is already in use by another connected client.
-
- New user
- Posts: 9
- Joined: 07 Sep 2018, 07:51
Re: Mosquitto on Ubuntu - no connection
OK but that would then imply that there is something fundamentally different in the code in ESPEasy. V1.2 works fine to the broker, flash with 2 and it stops working. THats with Zero changes to the Broker
Craig
Craig
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Mosquitto on Ubuntu - no connection
The client ID has been changed since version 1. Now we use MAC address together with the unit name. Before it was only the unit name I think.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Mosquitto on Ubuntu - no connection
So this implies that a client ID collision could not be the cause of the observed issue.
Re: Mosquitto on Ubuntu - no connection
Hi,
Was there ever a solution to this problem?
I have a very similar problem - everything works fine with R147, but using r2.0 (mega-20190110) result in the following:
1547124475: New connection from 10.10.201.30 on port 1883.
1547124475: Socket error on client <unknown>, disconnecting.
Using a RasperryPi and HassIO with the Mosquitto broker. Network is in same subnet etc.
Any good suggestions
Was there ever a solution to this problem?
I have a very similar problem - everything works fine with R147, but using r2.0 (mega-20190110) result in the following:
1547124475: New connection from 10.10.201.30 on port 1883.
1547124475: Socket error on client <unknown>, disconnecting.
Using a RasperryPi and HassIO with the Mosquitto broker. Network is in same subnet etc.
Any good suggestions
Who is online
Users browsing this forum: No registered users and 4 guests