Commits

Anonymous committed a0f1ac8

more logging

Comments (0)

Files changed (1)

         super(GardenDuino, self).__init__(config, garden)
         self.ready = False
         try:
-            self.serial = serial.Serial(self.config.DEVICE_PATH, self.config.BAUD_RATE)
+            self.serial = serial.Serial(self.config.DEVICE_PATH, self.config.BAUD_RATE, timeout=1)
             self.ready = True
         except SerialException:
             logging.error("Unable to connect to device '%s'" % (self.id,))
         return True
     """
     def readOneWireThermo(self, thermo):
+        logging.debug("inside read one wire")
         self.sendData('%s,%s;' % (self.GET_THERMO, thermo))
+        logging.debug("data sent one wire")
         return float(self.getData()[0])
 
     def readFlowSensor(self, flow):
         self.serial.write(str(serial_data))
 
     def getData(self):
+        logging.debug("inside get data")
         line = self.serial.readline().replace('\n', '').replace('\r', '').replace(";", "")
+        logging.debug("after readline")
         parts = line.split(',')
         try:
             if int(parts[0]) == 1:
 class NumatoGpioBoard(Device):
     def __init__(self, config, garden):
         super(NumatoGpioBoard, self).__init__(config, garden)
-        self.serial = serial.Serial(self.config.DEVICE_PATH, self.config.BAUD_RATE, timeout=5)
+        self.serial = serial.Serial(self.config.DEVICE_PATH, self.config.BAUD_RATE, timeout=1)
 
         self.pin = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V"]