1.sudo apt-get install -y mosquitto mosquitto-clients #Now the Moquitto server
should already be running
2.Opening a test channel
mosquitto_sub -h localhost -v -t test #This command starts an MQTT Subscriber waiting for messages in the "Test" channel.
3.Sending Message to Raspberry Pi
mosquitto_pub -h localhost -t test -m "Hello world, Mosquitto" #Now you can start a second connection to the Raspberry Pi and send a message: #Now the Subscriber should display the message "Hello world, Mosquitto" on the screen.