Guest User

Untitled

a guest
May 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. ```python
  2. from umqtt.simple import MQTTClient
  3.  
  4. # Test reception e.g. with:
  5. # mosquitto_sub -t foo_topic
  6.  
  7. def main(server="localhost"):
  8. c = MQTTClient("umqtt_client", server)
  9. c.connect()
  10. c.publish(b"foo_topic", b"hello")
  11. c.disconnect()
  12.  
  13. if __name__ == "__main__":
  14. main()
  15. ```
Add Comment
Please, Sign In to add comment