subscribe: set client_id for MQTT subscriber to ensure unique identification
This commit is contained in:
@@ -32,6 +32,7 @@ client.on_connect = on_connect
|
||||
client.on_message = on_message
|
||||
if username:
|
||||
client.username_pw_set(username, password)
|
||||
client.client_id = f"subscribe-{os.getpid()}"
|
||||
|
||||
try:
|
||||
client.connect(host, port, 60)
|
||||
|
||||
Reference in New Issue
Block a user