GithubHelp home page GithubHelp logo

Comments (21)

tkurki avatar tkurki commented on September 26, 2024

fulup-bzh/GeoGate#4

from nmea0183-signalk.

fabdrol avatar fabdrol commented on September 26, 2024

@tkurki I think this is an issue in @fulup-bzh library

sorry, missed your issue on fulup-bzh/GeoGate. Do you have any plans to implement it for GeoGate? We could look for an alternative parser, might be less work.

from nmea0183-signalk.

tkurki avatar tkurki commented on September 26, 2024

No. This issue is for documenting & tracking this for now, in the hope that somebody could fix it.

from nmea0183-signalk.

fabdrol avatar fabdrol commented on September 26, 2024

Okay, sounds good. An option is to spawn a separate program to do the parsing - or use a lib and write node bindings

from nmea0183-signalk.

fulup-bzh avatar fulup-bzh commented on September 26, 2024

I doubt spawning a separated programme is the simplest option, this especially for long term maintenance. The biggest issue with multi-part messages is always session handing to support multiple stream of data without confusing the parser.

GeoGate has a session management for both TCP/socket and HTTP protocols, sessions mechanism is what is use by the GeoGate to compute distances and average speed in between two acquisitions. In current implementation, GeoGate/Server does not transfer session handle to the parser, nevertheless this would be a simple mechanism to provide a session for the parser not to mess up with multipart AIS. With such an option the parser would remain completely independent of server implementation, requesting only a session handle from the server without interfering on network protocols.

As I wrote in my post, updating GeoGate parser to support multipart is not a gig job, but someone still have to do it. Unfortunately for my own project I do not need it. But is someone is willing to propose a patch, I would be more than happy to integrate and support it.

from nmea0183-signalk.

tkurki avatar tkurki commented on September 26, 2024

There's also the option to let gpsd do the decoding. I believe (can't find anything quickly to verify this) it handles multipart and outputs easily handled json.

from nmea0183-signalk.

fulup-bzh avatar fulup-bzh commented on September 26, 2024

Yes Gpsd does multipart decoding, but this impose you to have GPSd running, which depending on the case is going to be simple or not.

If you want to enable HTML5 and run your parser directly in a browser GPSd is out of scope, on the other hand if you develop only for server side it might be an option.

from nmea0183-signalk.

fabdrol avatar fabdrol commented on September 26, 2024

I don't like the idea of having GPSd running (or anything else) as a requirement for a simple parser; that's why I liked @fulup-bzh's library. A C library with node bindings is an option though

from nmea0183-signalk.

fulup-bzh avatar fulup-bzh commented on September 26, 2024

@fabdrol, I'm not sure I would follow you on a GPSlib versus full GPSd. I understand quite well GPSd and in fact wrote http://www.catb.org/gpsd/gps2udp.html that is part of GPSd distribution. In my opinion: either the constrain of running native code is not an issue and GPSd/Json could be a smart move; either it is important for Signal-K to support tiny hardware, run in a browser, run on MIPs embedded board without recompilation ... in which case you should stick to 100% HTML5 code.

GGencoder https://github.com/fulup-bzh/GeoGate/blob/master/encoder/lib/GG-AisDecode.js is less than 400 lines of code. Adding multipart AIS probably less than one day effort, adding every other AIS messages SAR, Forcast, ... probably less than one week.

From my experience, either you use GPSd and stick to the full and standard version of the daemon, or you go for a pure vanilla HTML5 code. Anything on between would result is getting the disadvantage of both without getting the advantage.

from nmea0183-signalk.

fabdrol avatar fabdrol commented on September 26, 2024

@fulup-bzh I agree with your comments regarding tiny hardware; that's why I used your software in the first place. However, I do not agree about a trade-off between a (C) library bound to Node.js and running another program - I prefer managing one process over multiple processes anytime!

from nmea0183-signalk.

fulup-bzh avatar fulup-bzh commented on September 26, 2024

@fabdrol, multi-process is not an issue for me, but I understand your point. This being said if you bound GPSd to nodejs which is available at https://github.com/kintel/aisdecoder you will have to maintain yourself your binary library. Cross compile to cheap hardware based on Mips/Arm, backport patches when needed... Porting kintel/aisdecoder to an arduino board should be a good measure to understand if the difficulty is acceptable or not.

As itself maintaining a C-lib mapped on scripting language like node.js is not impossible, but it does not drive adoption and will be a "show stop signal" for many developers. In the case of Node.JS now that the hard work of decoding the AIS 6bits binary message is done the easiest way is for sure to add the few missing messages to ggencode or to recreate a new decoding lib based on the same principals.

from nmea0183-signalk.

timmathews avatar timmathews commented on September 26, 2024

Opened pull request fulup-bzh/GeoGate#6 to address this (in part). signalk-parser-nmea0183 will still need to be updated to make use of the new functionality in the GeoGate lib.

from nmea0183-signalk.

sailoog avatar sailoog commented on September 26, 2024

Hi guys, I am getting an error:
A session object is required to maintain state for decoding multipart AIS messages
I think is coming from GeoGate. The server stops parsing NMEA. Signalk-server-node 0.1.23. Sources: GPS and AIS. This didn't happen with previous versions. Tested with an AIS from digital yacht and a SDR AIS.

from nmea0183-signalk.

fulup-bzh avatar fulup-bzh commented on September 26, 2024

Session was added few months ago for Signal-K to support multi-part message. Session should be an object and should remain stable in between multiple AisDecode call. Typically session is a static value

var session=[]; // defined at global or object level

// loop on ais messages
var ais= new AisDecode (line, session);

Do you have a valid session object ?

from nmea0183-signalk.

sailoog avatar sailoog commented on September 26, 2024

How could I check that?
It works for simple messages:

!AIVDM,1,1,,A,4028jJ1v1GcIK09cHlGdgmg00H@;,0*6B
!AIVDM,1,1,,A,4028jJ1v1GcIR09cHlGdgmw00HD5,0*68
!AIVDM,1,1,,A,4028ioiv1GcIW09kDvGag6G00@Gh,0*35
!AIVDM,1,1,,A,D028iohflffp,0*4C
!AIVDM,1,1,,A,4028j;1v1GcIW09cJ8GdgDW00D48,0*32
!AIVDM,1,1,,A,4028jJ1v1GcI`09cHjGdgmw00HGw,0*1D
!AIVDM,1,1,,A,13EpM3PP0009ni2Gb2s0iwwJ05IT,0*3C
!AIVDM,1,1,,A,4028jJ1v1GcIg09cHjGdgn?00HKq,0*5B
!AIVDM,1,1,,A,4028jJ1v1GcIn09cHhGdgn?00HOk,0*4E
!AIVDM,1,1,,A,13F:agPP0009nj`Gb4G0W?wd00RW,0*2B
!AIVDM,1,1,,A,4028ioiv1GcIs09kDvGag6G0080D,0*32
!AIVDM,1,1,,A,D028ioj<Tffp,0*2C
!AIVDM,1,1,,A,4028j;1v1GcIs09cJ8GdgDW008Rt,0*40
!AIVDM,1,1,,A,13EpM3PP0009ni6Gb2t0b?v80L1d,0*3E
!AIVDM,1,1,,A,4028jJ1v1GcJ709cHfGdgng00D5L,0*13

but fails and stops parsing for multiple message:

!AIVDM,2,1,1,A,53F:agP2@2NdD9Ub220ltq@<h5:222222222220l1p>652gV000PDPiC,0*15
!AIVDM,2,2,1,A,3kPH88888888880,2*65
A session object is required to maintain state for decoding multipart AIS messages.

from nmea0183-signalk.

sailoog avatar sailoog commented on September 26, 2024

Pasing data from TCP by kplex 1.3.3

from nmea0183-signalk.

fulup-bzh avatar fulup-bzh commented on September 26, 2024

As it is written in the error message you need a session to decode multipart AIS messages. You should change the code to add a session or it cannot work.

I quickly check signalk-parser-nmea0183/codecs/VDM.js this error comes from line 24 that should be updated to include a session. With something like following.

var Decoder = require ("ggencoder").AisDecode;
var session = [];

module.exports = new Codec('VDM', function(multiplexer, input, line) {
var data = new Decoder(line, session);

I think this bug should be posted on https://github.com/SignalK/signalk-parser-nmea0183

from nmea0183-signalk.

tkurki avatar tkurki commented on September 26, 2024

I created branch for implementing this: https://github.com/SignalK/signalk-parser-nmea0183/tree/multiline-ais

The suggestion to create a session (object, not array) by @fulup-bzh fixes the error (b8fe8fb), but it isn't quite enough: you need to add the code that emits Signal K delta when the complete sentence has been received.

So cat test/logs/ais.nmea | bin/nmea0183-signalk now runs without errors, but you get a bunch of null values in the delta output of the test I added: a27a43f.

@sailoog you can manually install the branch version of nmea0183-signalk to make the error go away, but this won't get you multiline ais data.

It would be great if somebody completed this feature, I don't have the time right now.

from nmea0183-signalk.

fulup-bzh avatar fulup-bzh commented on September 26, 2024

Few Comments.

  • You're right an array wont do the job, it should be an object. Sorry for this mistake.
  • With a session/object part-1 of a multipart message will return a valid contend. Some information will miss (typically secondary informations like destination,...). Nevertheless 1st part is valid and can be return directly to the application. When part-2 arrive a new message for the same MMSI with more information will be returned, exactly like when AIS static information are replay every 3/10mn.
  • With a pure static session like the one your used, you cannot run multiple AIS feed. As today this might not an issue, but if in the future you want to listen to more than one AIS feed it will break. Session should probably be implemented dynamically at a low level and passed a parameter.

You may test real AIS feed on tcp://sinagot.net:4022 (will change to 5022 in the future). Just connect on the port provide your boat location, you will receive the AIS target 30NM around. Service is active for most Western Europe.

telnet sinagot.net 4022
$GPRMC,171417,A,4737.1061,N,00245.6595,W,1.0969,58.544,080516,,*02

from nmea0183-signalk.

sailoog avatar sailoog commented on September 26, 2024

Thanks @fulup-bzh and @tkurki . multiline-ais branch worked at least to keep the server running when a multiple AIS message comes. It is not critical for OpenPlotter since we are taking AIS from kplex but I agree this should be fixed for kplex 1.0 release. I am afraid it is beyond my knowledge but I will try to find someone...

from nmea0183-signalk.

tkurki avatar tkurki commented on September 26, 2024

Fixed in #59

from nmea0183-signalk.

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.