I have the ellipse mosquito broker running on a win 11 machine with IP address 192.168.0.22 . I also have NodRed running on the same machine. I can subscribe and publish using mqtt to the mosquito broker with NodeRed, I have an arduino Mega with an ethernet shield running PubSubClient The Arduino IP address is:192.168.0.105 on the same subnet. I can ping both the windows machine and the arduino… Every attempt to connect to the broker results in error -2.
I have modified the mosquitto.conf file adding the following lines (these are the only non commented lines in the conf file:
allow_anonymous true
listener 1883
I have also made the following attempt with mosquitto.conf adding the Ip address of the windows machine.
allow_anonymous true
listener 1883 192.168.0.22
Now the odd thing is I also have a mosquito broker running on a raspberry pi with the IP address 192.168.0.110 which if I run the exact same code except changing the mqtt broker’s IP address it connects and I get the data so i know the program is good.
I have also tried putting just the win box and the arduino on their own network. still no joy making a connection.
So everything points to the Mqtt broker on the windows box. Any suggestions as to what to try next?