mosquitto MQTT: No connection could be made because the target machine actively refused it

Ivan Sager picture Ivan Sager · Apr 5, 2015 · Viewed 8k times · Source

I'm using c# MQTT Client clientSub = new MqttClient("raspberrymachine100");

and when I connect with this C# client, I get the error {"No connection could be made because the target machine actively refused it 192.168.12.134:1883"}

But when I use the same C# client and connect to host test.mosquitto.org I am able to connect.

Additionally, when I use the mosquittto installed client "C:\Program Files (x86)\mosquitto\mosquitto_sub" -h 192.168.12.134 -p 1883 -d -t /topic/test This above line works fine and I can subscribe

Any thoughts?

Answer

Eyal Levy picture Eyal Levy · Mar 6, 2019

I had the that problem. I saw a solution (in Windows), and it helped me.

Go to Services (it is also called Services.msc) and search for the "Mosquitto Broker" service, and click on "start (the) service".

service_window_picture