GithubHelp home page GithubHelp logo

Comments (5)

Knio avatar Knio commented on August 23, 2024

GPS_nmea.py looks like your own code here, and not pynmea.
The error seems to be that you are not decoding your input to ASCII before passing it to pynmea.

from pynmea2.

sterwen avatar sterwen commented on August 23, 2024

from pynmea2.

sterwen avatar sterwen commented on August 23, 2024

Hello,

The bug still exist line 48 in the current version
lines = (self.buffer + data).split('\n')
This will raise an error because self.buffer is type while data is type <>
Here how I made it compatible with both versions:
if type(data) == str : line = data else: line = data.decode('ascii')
I have also removed the buffer because it is never used.

from pynmea2.

xOneca avatar xOneca commented on August 23, 2024

Actually, self.buffer is used. Specifically if data contains more than just one message, but last one is not yet complete.

from pynmea2.

xOneca avatar xOneca commented on August 23, 2024

I think self.buffer should be initialized to b'', instead of '', because it seems that NMEAStreamReader.stream.readline() returns type bytes, not str.

from pynmea2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.