summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-02-11 22:57:05 +0100
committerFlorian Pritz <bluewind@xinu.at>2013-02-11 22:58:00 +0100
commit4e50c8291bd83a3fbb24a209fd1f6c7cbdb5283c (patch)
tree78dc08a0979287c22e9dd3099e839c4540f8e975
parent833a7b602cd22c7d20604c37561c6e5a9699d582 (diff)
downloadmpd-box-4e50c8291bd83a3fbb24a209fd1f6c7cbdb5283c.tar.gz
mpd-box-4e50c8291bd83a3fbb24a209fd1f6c7cbdb5283c.tar.xz
daemon: add some more log entries
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xdaemon.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/daemon.py b/daemon.py
index 91b38e8..9d35f33 100755
--- a/daemon.py
+++ b/daemon.py
@@ -21,6 +21,7 @@ class Daemon:
def __init__(self):
self.ser = serial.Serial(sys.argv[1], 9600, timeout=1)
+ logger.debug("connected. waiting for client greeting")
# raise timeout to let arduino start up
self.ser.timeout = 15
@@ -29,13 +30,14 @@ class Daemon:
# arduino sometimes has a dirty buffer
# and sends junk before the ready message
if not incoming.endswith("ready"):
- sys.stderr.write("Got unexpected reply: "+incoming)
- raise Exception("Wrong client greeting")
+ log.error("Got reply: '"+incoming+"'")
+ raise Exception("Wrong or no client greeting")
self.ser.timeout = 1
+ logger.debug("got client greeting")
self.client = mpd.MPDClient()
self.client.connect("localhost", 6600)
- logger.debug("connected")
+ logger.debug("connected to mpd")
def readline(self):
return self.ser.readline().decode("ascii").strip()