Reply To: Writing Code to Record GPS data

Home Forums Forums Technical Support for BerryGPS and BerryGPS-IMU Writing Code to Record GPS data Reply To: Writing Code to Record GPS data

#15771
PeterP
Participant

I tried your code, and it worked fine for me.
Below is the contents of the file;

pi@raspberrypi:~ $ tail -f test.txt
latitude , longitude , time , altitude , epv , ept , speed , climb, hour
-33.779926333 , 151.111997333 , 98.5 , 42.78 , 0.005 , 0.037 , nan , 11:41
-33.7799275 , 151.112000167 , 98.4 , 43.01 , 0.005 , 0.175 , nan , 11:41
-33.779929167 , 151.112002167 , 98.2 , 40.94 , 0.005 , 0.102 , nan , 11:41
-33.779930833 , 151.112003667 , 98.0 , 43.01 , 0.005 , 0.093 , nan , 11:41
-33.779931167 , 151.112002333 , 97.9 , 43.01 , 0.005 , 0.078 , nan , 11:41

Update your code to print report to the terminal, just add it after gpsd.next()

    while True:
        report = gpsd.next() #
        print report
        if report['class'] == 'TPV':

See if your output is similar to mine below;

pi@raspberrypi:~ $ python problem.py
<dictwrapper: {u'release': u'3.17', u'proto_major': 3, u'rev': u'3.17', u'class': u'VERSION', u'proto_minor': 12}>
<dictwrapper: {u'class': u'DEVICES', u'devices': [{u'parity': u'N', u'activated': u'2020-04-24T10:42:17.251Z', u'driver': u'u-blox', u'subtype': u'SW ROM CORE 3.01 (107888),HW 00080000,FWVER=SPG 3.01,PROTVER=18', u'bps': 115200, u'flags': 1, u'stopbits': 1, u'path': u'/dev/ttyACM3', u'cycle': 1.0, u'class': u'DEVICE', u'mincycle': 0.25, u'native': 0}]}>
<dictwrapper: {u'pps': False, u'enable': True, u'scaled': False, u'raw': 0, u'json': True, u'nmea': False, u'timing': False, u'class': u'WATCH', u'split24': False}>
<dictwrapper: {u'status': 2, u'epx': 6.598, u'epy': 4.299, u'epv': 8.682, u'ept': 0.005, u'lon': 151.111978833, u'eps': 13.2, u'lat': -33.779932167, u'track': 0.0, u'mode': 3, u'time': u'2020-04-24T10:42:18.000Z', u'device': u'/dev/ttyACM3', u'alt': 91.5, u'speed': 0.103, u'class': u'TPV'}>
<dictwrapper: {u'status': 2, u'epx': 6.598, u'epy': 4.299, u'epv': 8.682, u'ept': 0.005, u'lon': 151.1119795, u'eps': 13.2, u'lat': -33.779932167, u'track': 0.0, u'mode': 3, u'time': u'2020-04-24T10:42:19.000Z', u'device': u'/dev/ttyACM3', u'alt': 91.5, u'speed': 0.105, u'class': u'TPV'}>

Peter --OzzMaker.com --

Blip, blop, bloop…