diff options
Diffstat (limited to 'gpspoller.py')
| -rw-r--r-- | gpspoller.py | 12 |
1 files changed, 8 insertions, 4 deletions
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])
|
