Raspberry PI as MQTT Publisher and Subscriber

1)Open Raspberry Pi Terminal
2)Execute the Following command to Publish data on topic test

mosquitto_pub -t test -h localhost -m “Temp:10”
mosquitto_pub -t test -h localhost -m “Temp:20”

1)Open Raspberry Pi Terminal
2)Execute the Following command to Subscribe topic test

mosquitto_sub -t test -h localhost

Please first Follow the Subscriber steps to See data published by publisher on Subscriber terminal.
Please click on the below link to become master in MQTT.

Master MQTT Protocol

You may also like...

Leave a Reply