Skip to content

Instantly share code, notes, and snippets.

@LarsBergqvist
Last active December 3, 2016 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LarsBergqvist/90f0533ea62985271f24eede08bee997 to your computer and use it in GitHub Desktop.
Save LarsBergqvist/90f0533ea62985271f24eede08bee997 to your computer and use it in GitHub Desktop.
umqtt example in MicroPython
from umqtt.simple import MQTTClient
import utime
c = MQTTClient("umqtt_client", "192.168.1.16",port=1883)
c.set_callback(mqtt_message_received)
c.connect()
c.subscribe("Home/#")
while True:
c.check_msg()
utime.sleep(0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment