1 year ago
#383463
tessa Brock
how i write mqtt URL in python 3
i new to python 3 and raspberry and im doing an IOT project where i use mqtt app to turn off led from my raspberry i got the code with python 2 but im sill new so i didnt know how to change the follwing functions
import urlparse
url_str = os.environ.get('CLOUDMQTT_URL', 'tcp://broker.emqx.io:1883')
url = urlparse.urlparse(url_str)
mqttc.connect(url.hostname, url.port)
i have the full code too This is my first question here sorry for bad explanation or writing
python
mqtt
0 Answers
Your Answer