1

I feel like all this was working fine last week, and all of a sudden I can't connect to a broker on my local network by IP.

I installed mosquitto via homebrew on 192.168.0.3 and started up the broker on that machine. Interestingly enough, when I use MQTTExplorer on Machine 192.168.0.3, I need to connect to mqtt://localhost or mqtt://127.0.0.1 (expected) but I cannot use mqtt://192.168.0.3 to connect to it (I find this odd).

Likewise, I can't use MQTTTool from my iPhone to connect to mqtt://192.168.0.3 when I'm on the same local network.

The broker is running on the standard port.

I'm not a network guy, can anyone point out my (probably obvious) mistake in being unable to connect to the broker running on 192.168.0.3 from another machine inside my local network?

EDIT: Ping's are working between the devices no problem.

EDIT:

When I start the broker, I see this message:

1608482209: mosquitto version 2.0.2 starting
1608482209: Config loaded from /usr/local/etc/mosquitto/mosquitto.conf.
1608482209: Starting in local only mode. Connections will only be possible from clients running on this machine.
1608482209: Create a configuration file which defines a listener to allow remote access.
1608482209: Opening ipv4 listen socket on port 1883.
1608482209: Opening ipv6 listen socket on port 1883.
1608482209: mosquitto version 2.0.2 running

Starting in local only mode makes it very explicit that I need to change a configuration setting, not sure which one though.

Here's the file:

https://gist.github.com/akmjenkins/27f2d9216031e5422296ed223c066d05

Thanks for the release notes, romkey, I updated two lines in the config file to look like this

listener 1883
allow_anonymous true

and now it behaves similarly to pre-2.0. It's certainly not good practice going forward, but I just looking to understand what had changed.

Adam Jenkins
  • 51,445
  • 11
  • 72
  • 100
  • 1
    Please share your mosquito.conf file and the version of Mosquito that you're running. – romkey Dec 20 '20 at 16:24
  • @romkey - 2.0.2_1, this issue sounds like it's due to the recent upgrade to 2.0. I have a feeling I may have had a pre-2.0 version installed via homebrew prior to this. It's really ruined my weekend, I am using the default config file. I've determined I need to change the config to allow external connections to connect to the brokwer, but I'm not sure what that is. I've added `bind_interface en0` but I am getting an error `Error: bind_interface specified but socket option not available.`. – Adam Jenkins Dec 20 '20 at 16:30
  • That makes sense, version 2 tightened up security. Sharing the full configuration file in the question would help other people and help people who may not have Mosquitto installed on macOS answer the question (I use a Mac but I'm not going to install Mosquitto just to see its default config file :) ). Do you have the macOS firewall enabled - System Preferences | Security & Privacy ? – romkey Dec 20 '20 at 16:33
  • @romkey - I've added the file, thanks so much for your help on this. Yes, MacOS firewall is enabled. – Adam Jenkins Dec 20 '20 at 16:41
  • You could always read the release notes https://mosquitto.org/blog/2020/12/version-2-0-0-released/ – hardillb Dec 20 '20 at 16:48
  • 1
    @romkey, thanks for your help, I've "fixed" it (at least fixed it to get it working that way I need it to). – Adam Jenkins Dec 20 '20 at 16:56
  • @Adam glad you got it going – romkey Dec 21 '20 at 01:11

0 Answers0