Comments (21)
from nmea0183-signalk.
@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.
No. This issue is for documenting & tracking this for now, in the hope that somebody could fix it.
from nmea0183-signalk.
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.
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.
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.
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.
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.
@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.
@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.
@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.
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.
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.
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.
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.
Pasing data from TCP by kplex 1.3.3
from nmea0183-signalk.
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.
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.
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.
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.
Fixed in #59
from nmea0183-signalk.
Related Issues (20)
- VDM: Request of IMO number (/Registrations) from message 5
- Custom sentence procedure HOT 21
- Seatalk 0x84 fails for single digit hex values HOT 1
- ROT: navigation/rateOfTurn seems not to be parsed from NMEA AIVDM HOT 7
- Broken link in README.md HOT 1
- Tiny typo errors HOT 1
- Empty in certain nmea0183 strings prevents parsing HOT 3
- Datagram 25 trip calculation: factor for W should probably be 4096 HOT 1
- VDM, callsign and imo data are not pushed to SK HOT 4
- BWC not recognized HOT 5
- DSC Distress Alerts HOT 6
- callsignVhf not according to the spec HOT 8
- timestamp handling: use only data from NMEA sentences HOT 4
- COG value differently parsed from RMC and VTG sentences
- Depth sentences don't generate output with empty incoming data fields
- HDG sentence incorrectly parsed HOT 1
- APB and BOD sentences not decoded according to SignalK spec HOT 8
- RMB parser stores next waypoint position to incorrect SignalK field HOT 1
- Is error detection too aggressive? HOT 2
- AIS VDM to support meteorological data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nmea0183-signalk.