pynmea2
pynmea2 copied to clipboard
Continious listen for data from serial and parse all sentences for all the data
I've tried ALOT already, but still nothing works or gives me the wanted results.
Currently I tried to read data usin the streamin docs, however, this throws
pynmea2.nmea.ParseError: ('could not parse data', u'*72\r')
I implemented it like this:
import serial
import pynmea2
ser = serial.Serial()
ser.port = "/dev/ttyS0"
ser.baudrate = 9600
ser.timeout = 1
ser.open()
reader = pynmea2.NMEAStreamReader()
while 1:
data = ser.readline()
for msg in reader.next(data):
print(msg)
Sometimes I get the sream to work, however, it's never ever instant.
I just want to have a continious stream of GPS data to be stored and displayed.
I need the latitude
, longitude
, speed
, time
, date
.
Someone please help me out here...
Can you repr()
the full line that gives you ParseError
?