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.

You may also like...

Leave a Reply