-def on_message(client, userdata, msg):
- print(msg.topic+" "+str(msg.payload))
- if msg.topic == 'rpdzkj-rsponse':
- print str(msg.payload)
+ def on_connect(client, userdata, flags, rc):
+ client.subscribe(id + "-response")
+ print("Connected with result code "+str(rc))
+ client.publish(id + '-request', 0)
+
+ def on_message(client, userdata, msg):
+ print(msg.topic+" "+str(msg.payload))
+ if msg.topic == id + '-response':
+ print 'port is', str(msg.payload)