示例#1
0
def on_message(client, userdata, msg):
    print("MQTT Data Received...")
    print("MQTT Topic: " + msg.topic)
    print("Data: " + str(msg.payload))
    try:
        Sensor(msg.payload)
    except:
        print("Error insert database!!")
示例#2
0
def on_message(client, userdata, msg):
    # This is the Master Call for saving MQTT Data into DB
    # For details of "sensor_Data_Handler" function please refer "sensor_data_to_db.py"
    print("MQTT Data Received...")
    print("MQTT Topic: " + msg.topic)
    print("Data: " + str(msg.payload))
    try:
        Sensor(msg.payload)
    except:
        print("Error insert database!!")
示例#3
0
def on_message(client, userdata, msg):
    print("MQTT DATA RECEVICED...")
    print("MQTT Topic: " + msg.topic)
    print("Data: " + str(msg.payload))
    Sensor(msg.payload)
示例#4
0
def on_message(client, userdata, msg):
    print("MQTT Data Received...")
    print("MQTT Topic: " + msg.topic)
    print("Data: " + str(msg.payload))
    Sensor(msg.payload)