Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.5 KB

README.md

File metadata and controls

34 lines (22 loc) · 1.5 KB

MQTT Demo

This is a demostration of MQTT protocol. To give a brief illustration, this README is only about Python version demo. Other language version are the same as Python's version.

For Java version you can visit this project.

For JavaScript version, please checkout npm project.

For Scala version, please checkout here.

Prerequisite

  • MQTT broker: Mosquitto (yap, an additional 't' there)

    • Ubuntu: sudo apt-get install mosquitto
    • OS X: brew install mosquitto
  • The Mosquitto Python Module

Usage

  1. You should first launch an MQTT broker server. With instanlling mosquitto, you can launch a server with purely type mosquitto.

  2. Then use python mqtt_subscriber.py and python mqtt_publisher.py respectively.

  • Subscriber subscriber

  • Publisher publisher

Note

The publisher will automatically terminate after send a message to broker. To terminate subscriber and broker server, use ctrl + C or control + C for times.