Giter Site home page Giter Site logo

Error on AIS messages about pynmea2 HOT 6 OPEN

knio avatar knio commented on August 20, 2024
Error on AIS messages

from pynmea2.

Comments (6)

Knio avatar Knio commented on August 20, 2024

Hi, unfortunately we don't have support for AIS messages. If you are able to help contribute code, or even just provide references and samples, it would be appreciated!

from pynmea2.

audiether avatar audiether commented on August 20, 2024

I doubt I'll be able to contribute much in the way of code... I'm much more of a hack than an experienced programmer. :-)

I can definitely provide some sample messages and see what else I can find in the way of resources. I'm on the road and need to be on the boat to get the samples, so it will be about two weeks, but I will definitely post here.

THANK YOU for pynmea2!!!

from pynmea2.

audiether avatar audiether commented on August 20, 2024

Here are the details on the data structure:
http://catb.org/gpsd/AIVDM.html

from pynmea2.

klint-k avatar klint-k commented on August 20, 2024

try this github

https://github.com/schwehr/libais

from pynmea2.

rtprio avatar rtprio commented on August 20, 2024

@Knio how would one structure the fact that ais messages can be more than one line? Keep track of the count and re-parse? I'm not sure one can assume the next line would be the next part of the message, but I haven't seen any examples otherwise.

>>> foo = pynmea2.parse("!AIVDM,2,1,6,B,56:fS:D0000000000008v0<QD4r0`T4v3400000t0`D147?ps1P00000,0*3")
>>> foo.is_complete
False
>>> foo.parse("!AIVDM,2,2,6,B,000000000000008,2*29")
>>> foo.is_complete
True

That's just getting the whole binary blob; I'm not exactly sure how to make it magically re-split when it comes time to .render() it again. It seems there are assumptions than the output is a single line again.

from pynmea2.

xOneca avatar xOneca commented on August 20, 2024

(Disclaimer: I have zero knowledge of AIS, but maybe I don't get too far)

I would let pynmea take care of the "transport" of the binary data in chunks, as it arrives. Then I would have an "upper stage" to which feed those blobs, and let it join and interpret the data as a whole.

For rendering, I would split the binary data in chunks and then encode each chunk in its own message. But this, again, using a first stage to split, and then pynmea (if it can) to encode them.

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.