Commit 0266e5c7 authored by Nico Schottelius's avatar Nico Schottelius

Log update

parent 199b8489
......@@ -15,7 +15,7 @@ import time
import websocket
log = logging.getLogger("lorautil")
log = logging.getLogger(__name__)
dbname="lorawan"
......
......@@ -16,7 +16,7 @@ import logging
import lorautil
logging.root.setLevel(logging.DEBUG)
log = logging.getLogger(__name__)
#Call back functions
......@@ -39,7 +39,6 @@ def on_message(client,userdata,msg):
log.info("Cannot decode packet as utf-8")
payload = mydict['payload']
log.info("Message received: {}: {}".format(deveui, payload))
lorautil.db_insert_json("ttn", myjson, payload, deveui)
lorautil.db_notify("ttn", payload, deveui)
......@@ -53,6 +52,8 @@ def on_disconnect(client, userdata, rc):
client.reconnect()
if __name__ == '__main__':
logging.root.setLevel(logging.DEBUG)
mqttc= mqtt.Client()
mqttc.on_connect=on_connect
mqttc.on_message=on_message
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment