now the sensors reconnects after connection issues

This commit is contained in:
Stefan Kögl 2014-03-27 14:04:44 +01:00
parent 2df8221eaf
commit d9295dd05d
3 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ def main():
else: else:
continue continue
#print repr(data) #print repr(data)
except socket.error, msg: except (socket.error, serial.serialutil.SerialException), msg:
# got disconnected? # got disconnected?
print "serial socket error!!!", msg print "serial socket error!!!", msg
platform.reconnect() platform.reconnect()

View File

@ -38,7 +38,7 @@ def main():
t = platform.serial_sock.read(1) t = platform.serial_sock.read(1)
else: else:
continue continue
except socket.error as msg: except (socket.error, serial.serialutil.SerialException), msg:
# got disconnected? # got disconnected?
print "serial socket error!!!", msg print "serial socket error!!!", msg
platform.reconnect() platform.reconnect()

View File

@ -75,7 +75,7 @@ def main():
t = platform.serial_sock.read(1) t = platform.serial_sock.read(1)
else: else:
continue continue
except socket.error as msg: except (socket.error, serial.serialutil.SerialException), msg:
# got disconnected? # got disconnected?
print "serial socket error!!!", msg print "serial socket error!!!", msg
platform.reconnect() platform.reconnect()