Reputation: 11
I want to publish data from Ubuntu VM to Windows 10 Host Machine.
On Ubuntu VM side I edited the mosquitto.conf file at /usr/share/doc/mosquitto/examples path with mentioned changes
> allow_anonymous true
> bind_address 0.0.0.0 / ::
> listener 1883 172.16.1.153 (IP of my host machine)
I edited the mosquitto.conf on host machine at C:\Program Files\mosquitto with the following changes
> listener 1883 172.16.1.219
> allow_anonymous true
Still I am unable to connect to the remote server.
PS: I am able to ping from both machines
Windows 10:
Ubuntu:
Upvotes: 0
Views: 1370
Reputation: 59618
Firstly
Starting mosquitto manually on the command line will not read any configuration file unless explicitly told to by using the -c
argument. e.g.
mosquitto -c /usr/share/doc/mosquitto/examples/mosquitto.conf`
On Ubuntu the active configuration file is found at /etc/mosquitto/mosquitto.conf
and inly used if you use the systemd service file (start the service with service mosquitto start
.
Likewise on Windows, the config file in C:\Program Files\mosquitto\mosquitto.conf
is only read by default if you run mosquitto as a Windows service. Just running it on the command line without specifying a config file will only load the built in defaults.
The address already in use errors imply that you are already running instances of mosquitto as services on both machines and probably need to restart those services to pick up the changes to the config files (assuming you edit the correct file on Ubuntu)
Second
There is no need to run an instance of the mosquitto broker on the Ubuntu VM if you just want to publish messages to the host machine. You can just use a MQTT client and publish directly to (a properly configured) broker on the Windows machine.
Upvotes: 1