From 8a0646b11b10d1aeb930fec838b825e917ba6cc9 Mon Sep 17 00:00:00 2001 From: realraum Date: Thu, 30 Apr 2009 04:18:17 +0000 Subject: [PATCH] update status at daemon start --- door_daemon.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/door_daemon.py b/door_daemon.py index fefc6cd..8df0761 100755 --- a/door_daemon.py +++ b/door_daemon.py @@ -50,7 +50,8 @@ class ArduinoUSBThread ( threading.Thread ): self.cv_updatestatus = threading.Condition(); #lock ist automatically created withing condition self.file_dev_ttyusb=file_dev_ttyusb #self.fh = open(self.file_dev_ttyusb,"w+") - self.fh = os.fdopen(os.open(self.file_dev_ttyusb, os.O_RDWR | os.O_NONBLOCK),"r+") + self.fh = os.fdopen(os.open(self.file_dev_ttyusb, os.O_RDWR | os.O_NONBLOCK),"r+") + #pythons sucks just like perl: we need nonblock or we can't write to FileHandle while we block reading on same filehandle self.statusdisplay = StatusDisplay() threading.Thread.__init__(self) @@ -206,6 +207,8 @@ arduino.start() ctrlfifo = ControlFIFOThread(fifofile,arduino) ctrlfifo.start() +arduino.send_statusrequest() + def exit_handler(signum, frame): global arduino, ctrlfifo logging.info("Door Daemon stopping") -- 1.7.10.4