I am new to MQTT and I am trying to send a basic message from client to broker using the command prompt. I have downloaded the mqtt for both client and broker and I could not publish the message to the subsriber as it has connection refused problem. below and the command i run for both subsriber and publisher.
subsriber command(no error here): mosquitto_sub -t topic/example
publisher command(connection refused): mosquitto_pub -h 192.168.1.196 -t topic/example -m "This is the first message sent via MQTT from the Edge to the Cloud server"
I have try to add the port inside the command but it is not working as well
After execute the command at the publisher side, I should be able to see the message sent by the publisher. But at this case, it has problem with the connection.