Skip to main content

Posts

Showing posts from September, 2015

MQTT server up and running in 7 simple steps

In this post I won't be talking about what MQTT server is why is and all, may be I'll write a different post for that. This post focuses on installing MQTT broker and getting it to work in 7 simple steps. Step 1: sudo apt-get update Step 2: sudo apt-get install mosquitto Step 3: sudo apt-get install python-pip Step 4: Install mosquitto module for python > sudo python-pip install mosquitto Step 5: Install mosquitto client > sudo apt-get install mosquitto-clients After executing above command you can start publisher and subscribe modules. These publisher subscriber can use a topic and write/read data from it respectively.   Step 6: Start subscriber client => mosquitto_sub -h <hostname> -t <topicname> -v > mosquitto_sub -h localhost -t testTopic -v Step 7: Start publisher client => mosquitto_pub -h <hostname> -t <topicname> -m "<message>" > mosquitto_pub -h localhost -t testTopic -m "Test Messages" P