Skip to content

Instantly share code, notes, and snippets.

@tsailiming
Last active August 29, 2015 14:20
Show Gist options
  • Save tsailiming/8a17745b9b0c4aa6d37f to your computer and use it in GitHub Desktop.
Save tsailiming/8a17745b9b0c4aa6d37f to your computer and use it in GitHub Desktop.
Simple paho mqtt client
#/usr/bin/python
import paho.mqtt.publish as publish
from paho.mqtt.client import MQTTv311
import time
for i in xrange(10):
publish.single("testing", time.asctime() + ' hello ' + str(i), hostname="localhost",port=1883,protocol=MQTTv311)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment