Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RosiersRobin opened this issue Aug 21, 2019 · 1 comment

Comments

@RosiersRobin
Copy link

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

@xOneca
Copy link
Contributor

xOneca commented Nov 1, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants