import paho.mqtt.client as mqtt
-def on_connect(mosq, obj, rc):
+def on_connect(mqttc, obj, rc):
print("rc: "+str(rc))
-def on_message(mosq, obj, msg):
+def on_message(mqttc, obj, msg):
print(msg.topic+" "+str(msg.qos)+" "+str(msg.payload))
-def on_publish(mosq, obj, mid):
+def on_publish(mqttc, obj, mid):
print("mid: "+str(mid))
-def on_subscribe(mosq, obj, mid, granted_qos):
+def on_subscribe(mqttc, obj, mid, granted_qos):
print("Subscribed: "+str(mid)+" "+str(granted_qos))
-def on_log(mosq, obj, level, string):
+def on_log(mqttc, obj, level, string):
print(string)
# If you want to use a specific client id, use
-# mqttc = mosquitto.Mosquitto("client-id")
+# mqttc = mqtt.Client("client-id")
# but note that the client id must be unique on the broker. Leaving the client
# id parameter empty will generate a random id for you.
mqttc = mqtt.Client()