Timothy Buchanan <
timothye...@gmail.com> writes:
> When I start mosquitto manually, it will work only locally, that is, from
> one instance of terminal to another, but will not pick up subscribed
> messages published by a device on the same LAN. Do these error messages on
> install tell me how to troubleshoot mosquitto? Thanks for any help.
As Karen says, this is probably due to a change in default behavior for
mosquitto 2. Basically, it's a bug for a program to listen on the
network by default, when it can make sense to only be on localhost.
Certainly one can make mosquitto 2.0.x listen on the network beyond
localhost.
It sounds like you do not have a configuration file and have not
configured authentication or an explicit listener. Basically, don't do
that - read the docs and set up mosquitto intentionally.
Note the man page
-p, --port
Listen on the port specified. May be specified up to 10 times to
open multiple sockets listening on different ports.
Important
In version 1.6.x and earlier, the listener defined by -p (or
the default port of 1883) would be bound to all interfaces and
so be accessible from any network. It could also be used in
combination with -c.
From version 2.0 onwards, the listeners defined with -p are
bound to the loopback interface only, and so can only be
connected to from the local machine. If both -p is used and a
listener is defined in a configuration file, then the -p
options are IGNORED.
See also ChangeLog.txt in the sources
2.0.0 - 2020-12-03
==================
Breaking changes:
- When the Mosquitto broker is run without configuring any listeners it will
now bind to the loopback interfaces 127.0.0.1 and/or ::1. This means that
only connections from the local host will be possible.
- All listeners now default to `allow_anonymous false` unless explicitly set
to true in the configuration file. This means that when configuring a
listener the user must either configure an authentication and access control
method, or set `allow_anonymous true`. When the broker is run without a
configured listener, and so binds to the loopback interface, anonymous
connections are allowed.