@@ -0,0 +1,1759 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Tue Nov 10 20:30:02 2015%0A%0A@author: piotr at nicecircuits.com%0A%22%22%22%0A%0A# -*- coding: utf-8 -*-%0Afrom __future__ import print_function # compatibility with python 2 and 3%0A__author__ = 'piotr'%0Aimport paho.mqtt.client as mqtt%0Aimport serial, time, re, logging, numpy%0Aserver = %22test.mosquitto.org%22%0Aport = 1883%0Aglobal received, ids, lastId, log, ser, client%0A%0Adef on_connect(client, userdata, flags, rc):%0A    print(%22Connected with result code %22 + str(rc))%0A%0A    # Subscribing in on_connect() means that if we lose the connection and%0A    # reconnect then subscriptions will be renewed.%0A    client.subscribe(%22/drOctopus/#%22)%0A    #client.subscribe(%22/esp-link/#%22)%0A%0A# The callback for when a PUBLISH message is received from the server.%0Adef on_message(client, userdata, msg):%0A    global received, ids, lastId, log%0A    temp=%22topic: %22 + msg.topic + %22 %22 + %22  message: %22 + str(msg.payload)%0A    log.debug(temp)%0A%0Adef kill_mqtt():%0A    client.disconnect()%0A    %0Adef tester_init():%0A    global received, ids, lastId, log, ser, client%0A    #enable debug logs%0A    log=logging.getLogger()%0A    log.setLevel(logging.DEBUG)%0A    formatter=logging.Formatter('%25(asctime)s - %25(message)s')%0A    logfile=logging.FileHandler(%22log.txt%22,%22w%22)%0A    logfile.setLevel(logging.INFO)%0A    logfile.setFormatter(formatter)%0A    console = logging.StreamHandler()%0A    console.setLevel(logging.DEBUG)%0A    console.setFormatter(formatter)%0A    log.addHandler(console)%0A    log.addHandler(logfile)%0A    %0A    client = mqtt.Client(protocol=3)%0A    client.on_connect = on_connect%0A    client.on_message = on_message%0A    client.connect_async(server, port, 60)%0A    %0A    log.info(%22Application start%22)%0A    client.loop_start()%0A%0Aif __name__ ==%22__main__%22:%0A    tester_init()%0A    while 1:%0A        pass%0A

Add MQTT receiver python script