pynmea2 icon indicating copy to clipboard operation
pynmea2 copied to clipboard

Continious listen for data from serial and parse all sentences for all the data

Open RosiersRobin opened this issue 4 years ago • 1 comments

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...

RosiersRobin avatar Aug 21 '19 18:08 RosiersRobin

Can you repr() the full line that gives you ParseError?

xOneca avatar Nov 01 '19 21:11 xOneca