[FIX] hw_scale: use a larger timeout during initial probe

I'm not sure why the serial timeout is so aggressive, but I assume there
is a reason for it. During probing however, we shouldn't use such an
aggressive timeout because if we miss the device during initial startup
we'll never find it since we only probe devices once.
This commit is contained in:
Joren Van Onder 2016-03-02 16:27:31 +01:00
parent 290eb4ea2e
commit c23eb23267
1 changed files with 4 additions and 2 deletions

View File

@ -94,8 +94,8 @@ class Scale(Thread):
bytesize = serial.SEVENBITS,
stopbits = serial.STOPBITS_ONE,
parity = serial.PARITY_EVEN,
timeout = 0.02,
writeTimeout= 0.02)
timeout = 1,
writeTimeout = 1)
connection.write("W")
self.probed_device_paths.append(path)
@ -104,6 +104,8 @@ class Scale(Thread):
_logger.debug(path + ' is scale')
self.path_to_scale = path
self.set_status('connected','Connected to '+device)
connection.timeout = 0.02
connection.writeTimeout = 0.02
return connection
else:
_logger.debug('Already probed: ' + path)