python3 mqtt 添加用戶名以及密碼

 

import paho.mqtt.client as mqtt

client = mqtt.Client(client_id, transport='tcp')
client.username_pw_set(username, password=passwd)


參考:
https://www.cnblogs.com/chenpingzhao/p/11383856.html
https://www.jianshu.com/p/ef546f476322
相關文章
相關標籤/搜索