Skip to content

NCCUCS-PLSM/mqtt-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A demo for Mosquitto MQTT broker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published