now the sensors reconnects after connection issues
This commit is contained in:
parent
2df8221eaf
commit
d9295dd05d
|
@ -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()
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue