MQ Telemetry Transport (MQTT)


Compared to Hypertext Transfer Protocol (HTTP), it focuses to transfer data.

Installation


sudo apt-get install mosquitto
sudo apt-get install mosquitto-clients
pip install paho-mqtt
    

Subscriber and Publisher


mosquitto_sub -t "test" # T1 to create a topic named test
mosquitto_pub -m "message from mosquitto_pub client" -t "test" # T2
    

NodeRed mqtt in node

References


  1. How to Install Mosquitto MQTT Broker/Server on Ubuntu 16.04
  2. MQTT vs. HTTP: which one is the best for IoT?
  3. Beginners Guide To The Paho MQTT Python Client