From d9295dd05d23ccf6908cd388da4dc968a674e978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Thu, 27 Mar 2014 14:04:44 +0100 Subject: [PATCH] now the sensors reconnects after connection issues --- sensors2osc/sensors2osc/ehealth2osc.py | 2 +- sensors2osc/sensors2osc/ekg2osc.py | 2 +- sensors2osc/sensors2osc/pulse2osc.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sensors2osc/sensors2osc/ehealth2osc.py b/sensors2osc/sensors2osc/ehealth2osc.py index 087ebfe..a68e3b7 100644 --- a/sensors2osc/sensors2osc/ehealth2osc.py +++ b/sensors2osc/sensors2osc/ehealth2osc.py @@ -37,7 +37,7 @@ def main(): else: continue #print repr(data) - except socket.error, msg: + except (socket.error, serial.serialutil.SerialException), msg: # got disconnected? print "serial socket error!!!", msg platform.reconnect() diff --git a/sensors2osc/sensors2osc/ekg2osc.py b/sensors2osc/sensors2osc/ekg2osc.py index bea1cd8..0956078 100644 --- a/sensors2osc/sensors2osc/ekg2osc.py +++ b/sensors2osc/sensors2osc/ekg2osc.py @@ -38,7 +38,7 @@ def main(): t = platform.serial_sock.read(1) else: continue - except socket.error as msg: + except (socket.error, serial.serialutil.SerialException), msg: # got disconnected? print "serial socket error!!!", msg platform.reconnect() diff --git a/sensors2osc/sensors2osc/pulse2osc.py b/sensors2osc/sensors2osc/pulse2osc.py index 707014c..2fb758d 100644 --- a/sensors2osc/sensors2osc/pulse2osc.py +++ b/sensors2osc/sensors2osc/pulse2osc.py @@ -75,7 +75,7 @@ def main(): t = platform.serial_sock.read(1) else: continue - except socket.error as msg: + except (socket.error, serial.serialutil.SerialException), msg: # got disconnected? print "serial socket error!!!", msg platform.reconnect()