Skip to content
Permalink
7782a0dd9f
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
16 lines (12 sloc) 293 Bytes
import paho.mqtt.client as mqtt
import time
mqttc = mqtt.Client()
mqttc.connect( "iot.eclipse.org" ) # test broker
counter = 0
while True:
message = "Hello World {}!".format(counter)
print( message )
mqttc.publish( "mytest/counter", message )
mqttc.loop()
counter += 1
time.sleep(2)