From 42721c09266f453dcc9d3af4c141b94fdd65c221 Mon Sep 17 00:00:00 2001 From: Roman Bazalevskiy Date: Tue, 31 Oct 2017 08:55:16 +0300 Subject: [PATCH] =?utf8?q?"=D0=A3=D0=BC=D0=BD=D0=B0=D1=8F"=20=D0=B3=D0=B5?= =?utf8?q?=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D1=8F=20ID=20=D0=BA=D0=BB?= =?utf8?q?=D0=B8=D0=B5=D0=BD=D1=82=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=B2?= =?utf8?q?=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20?= =?utf8?q?=D0=BE=D0=B4=D0=BD=D0=BE=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?utf8?q?=D0=BD=D0=BE=D0=B9=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20?= =?utf8?q?=D0=BD=D0=B5=D1=81=D0=BA=D0=BE=D0=BB=D1=8C=D0=BA=D0=B8=D1=85=20?= =?utf8?q?=D1=8D=D0=BA=D0=B7=D0=B5=D0=BC=D0=BF=D0=BB=D1=8F=D1=80=D0=BE?= =?utf8?q?=D0=B2=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- mqtt-agi/mqtt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mqtt-agi/mqtt b/mqtt-agi/mqtt index 6f69c7e..cbb3e25 100755 --- a/mqtt-agi/mqtt +++ b/mqtt-agi/mqtt @@ -13,8 +13,12 @@ import paho.mqtt.client as paho import json +from os import getpid,uname from pprint import pprint +client_name='agi-'+uname()[1]+'-'+str(getpid()) +print client_name + conffile, topic = sys.argv[1:3] config = ConfigParser() @@ -55,7 +59,7 @@ def on_publish(mosq, *args): # done agi_exit(0) -client = paho.Client('agi') +client = paho.Client(client_name) client.username_pw_set(mqtt_username, mqtt_password) client.connect(mqtt_server, port=mqtt_port) client.on_connect = on_connect -- 2.34.1