Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. import paho.mqtt.client as mqtt
  2.  
  3. def on_publish(client,userdata,result):            
  4.     print("data published \n")
  5.  
  6. client= mqtt.Client("Publisher")                          
  7. client.on_publish = on_publish                          
  8. client.connect("test.mosquitto.org",1883)                                
  9. client.publish(”topic_example","Hello")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement