mqtt.py v1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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