I have a rpi + adafruit gps board. Everything works fine with default gps settings. I'm using gps python module to handle gps parsing.
Log from the program:
Code: Select all
DEBUG:root:[GPS] timestamp: 1416150533.52, fix time: 2014-11-16T15:08:53.000Z, UTC: 2014-11-16T15:08:53.000Z, Satellites: 13, Used: 4
DEBUG:root:[GPS] timestamp: 1416150534.57, fix time: 1416150534.0, UTC: 2014-11-16T15:08:54.000Z, Satellites: 13, Used: 4
DEBUG:root:[GPS] timestamp: 1416150535.52, fix time: 2014-11-16T15:08:55.000Z, UTC: 2014-11-16T15:08:55.000Z, Satellites: 13, Used: 4
DEBUG:root:[GPS] timestamp: 1416150536.57, fix time: 1416150536.0, UTC: 2014-11-16T15:08:56.000Z, Satellites: 13, Used: 4
DEBUG:root:[GPS] timestamp: 1416150537.71, fix time: 1416150536.0, UTC: 2014-11-16T15:08:56.000Z, Satellites: 13, Used: 5
DEBUG:root:[GPS] timestamp: 1416150537.77, fix time: 2014-11-16T15:08:57.000Z, UTC: 2014-11-16T15:08:57.000Z, Satellites: 13, Used: 5
DEBUG:root:[GPS] timestamp: 1416150538.53, fix time: 1416150538.0, UTC: 2014-11-16T15:08:58.000Z, Satellites: 13, Used: 5
DEBUG:root:[GPS] timestamp: 1416150539.56, fix time: 2014-11-16T15:08:59.000Z, UTC: 2014-11-16T15:08:59.000Z, Satellites: 13, Used: 5
DEBUG:root:[GPS] timestamp: 1416150540.52, fix time: 1416150540.0, UTC: 2014-11-16T15:09:00.000Z, Satellites: 13, Used: 5
Important bits from the code:
Code: Select all
from gps import *
self.data = gps(mode=WATCH_ENABLE | WATCH_NEWSTYLE)
Code: Select all
self.data.next()
timestamp = time.time()
self.utc = self.data.utc
self.fix_time = self.data.fix.time
Code: Select all
self.occ.log.debug("[GPS] timestamp: {}, fix time: {}, UTC: {}, Satellites: {}, Used: {}".format(timestamp, self.fix_time, self.utc, self.satellites, self.satellites_used))
I can handle both, but I'd prefer to know what's going on. Anyone had the same problem?
P.S. I found this:
Code: Select all
# Time can be either Unix time as a float or an ISO8601 string
if type(self.fix.time) == type(0.0):
self.fix.time = self.utc
else:
self.fix.time = isotime(self.utc.encode("ascii"))