From d15a608b4313bea0d24711cc85cc683aefb1f494 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 17 May 2012 20:24:43 +0100 Subject: time in gps debug --- gpspoller.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gpspoller.py') diff --git a/gpspoller.py b/gpspoller.py index 689ee88..51625f8 100644 --- a/gpspoller.py +++ b/gpspoller.py @@ -45,10 +45,14 @@ class GpsPoller(threading.Thread): self.changed=True time.sleep(0.5) else: - line = self.gps.read(1) - line = line+self.gps.readline() - datablock = line.split(',') - #print line + line="" + try: + line = self.gps.read(1) + line = line+self.gps.readline() + datablock = line.split(',') + #print line + except: + print "caught serial error" try: if line[0:6] =='$GPGSV': self.satellites=string.atoi(datablock[3]) -- cgit v1.2.3