python 2.7 - Pynmea2 attribute error -
i've been using pynmea2 library, today ran gpgga message through , it's throwing attribute error when trying access objects datetime method.
>>> pynmea2 import parse >>> = '$gpgga,201326.000,3348.5072,n,11809.6409,w,2,20,0.55,37.5,m,-34.3,m,0000,0000*65' >>> msg = parse(a) >>> msg <gga(timestamp=datetime.time(20, 13, 26), lat='3348.5072', lat_dir='n', lon='11809.6409', lon_dir='w', gps_qual='2', num_sats='20', horizontal_dil='0.55', altitude=37.5, altitude_units='m', geo_sep='-34.3', geo_sep_units='m', age_gps_data='0000', ref_station_id='0000')> >>> msg.datetime traceback (most recent call last): file "<stdin>", line 1, in <module> file "/library/python/2.7/site-packages/pynmea2/nmea.py", line 154, in __getattr__ raise attributeerror(name) attributeerror: datetime here's line 154 , related states in nmea.py:
def __getattr__(self, name): #pylint: disable=invalid-name t = type(self) try: = t.name_to_idx[name] except keyerror: raise attributeerror(name) f = t.fields[i] if < len(self.data): v = self.data[i] else: v = '' if len(f) >= 3: if v == '': return none return f[2](v) else: return v any ideas be? looking @ this!
found it...gpgga sentences have no date values in string.
Comments
Post a Comment