diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-05-17 20:24:43 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-05-17 20:24:43 +0100 |
| commit | d15a608b4313bea0d24711cc85cc683aefb1f494 (patch) | |
| tree | b10ab613c743ace605f299f61fdf01f50fd34ad9 | |
| parent | e5a989f2e65434c02c2ef7b28d6507635d08e9b6 (diff) | |
time in gps debug
| -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])
|
