Skip to content

Instantly share code, notes, and snippets.

@eydam-prototyping
Last active February 23, 2021 15:19
Embed
What would you like to do?
mqtt.py v1
import ubinascii
import machine
import sys
sys.path.reverse()
from umqtt.robust2 import MQTTClient
sys.path.reverse()
def setup(host, port):
client_id = ubinascii.hexlify(machine.unique_id())
client = MQTTClient(client_id, host, int(port))
client.connect()
return client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment