changeset 25:29fda609f532

sba timeouts so it doesn't stall all the time Ignore-this: 5492c341398500bda225910d191b682b
author drewp@bigasterisk.com
date Tue, 17 Apr 2012 21:49:12 -0700
parents deb1d9ef0a02
children bd3604359b98
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)