Mercurial > code > home > repos > homeauto
changeset 830:6860694eb19a
sba timeouts so it doesn't stall all the time
Ignore-this: 5492c341398500bda225910d191b682b
darcs-hash:20120418044912-312f9-ed79820295bf748e2c2ebc2c777de2978da5a972.gz
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Tue, 17 Apr 2012 21:49:12 -0700 |
parents | 772b2065fca8 |
children | bbecee3d287d |
files | service/sba/sba.py |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/service/sba/sba.py Sun Mar 04 03:44:26 2012 -0800 +++ b/service/sba/sba.py Tue Apr 17 21:49:12 2012 -0700 @@ -12,7 +12,8 @@ def reset(self): log.msg("reopening port") - self.s = serial.Serial(self.port, baudrate=115200) + # this timeout will fire every few seconds + self.s = serial.Serial(self.port, baudrate=115200, timeout=0.020) log.msg(str(self.s.__dict__)) self.sendControl() @@ -168,10 +169,7 @@ parser.add_argument('-v', '--verbose', action="store_true", help='logging') args = parser.parse_args() - try: - sba = Sba() - except serial.SerialException: - sba = Sba("/dev/ttyACM1") + sba = Sba("/dev/serial/by-id/usb-http:__engr.biz_CDC_RS-232_SB-Av1.0-if00") chain = BriteChain(sba)