-
Notifications
You must be signed in to change notification settings - Fork 36
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
Feature request: Downsampling of the NMEA data #36
Comments
I've taken a look at what AIS dispatcher is doing. If I understand correctly there's no distinction being made in the downsampling between message types so with this downsampling you might never propagate static data for a vessel with a class b transmitter. I'm guessing though that maybe marinetraffic etc. maintain some static data associated with each mmsi so this is not such a big deal. Is that the case? This is certainly doable but my concern is that it's a little off-mission as it involves decoding all the AIS and making decisions based on data content so might be better done externally. Let me think about this a bit more though as I understand the utility for remote bandwidth constrained sites pumping data to AIS sites. |
Hello thanks for your fast reply! |
I do understand the utility of this, especially if you're transmitting over satellite. Not all AIS messages contain the same info and notably "static" data about a vessel (e.g. name, length etc.) are transmitted with a much lower frequency than position reports. Both will be tagged with the same MMSI though. Taken at face value, if AIS dispatcher just allows one message with a given MMSI every N seconds, it could filter out almost all the static data reports. That may not be significant if marinetraffic (or wherever) holds those data (e.g. from previous station reports). Also, that may not actually be what AIS dispatcher is doing. It could be that rather than actually decoding the messages and filtering on MMSI it's scanning for duplicates in the first 7 characters of the payload field of VDM messages without actually decoding the data which would be the quick and effective way of doing things and would pass different message types from the same MMSI within one time window. Note that the messages AIS dispatcher is filtering out won't be duplicates, but whereas position updates every 2-10 seconds are useful for collision avoidance, they're not really necessary for vessel tracking via marinetraffic. Anyway...this type of filtering (rate limiting based on a substring match in the payload) doesn't easily fit into the current filtering framework so I was thinking again about a "plugin" mechanism which I've been considering for years and have an idea how I might approach it. In the meantime I've also started to write some AIS decoding software which is proving educational. An intermediate solution might be something like..instead of current invocation of kplex, remove the AIS interface from your main kplex.conf and rather than invoking kplex the normal way do something like: Longer term I'm going to re-vist the plugin idea, but it may be a couple of months before that comes to fruition |
I'm thinking something kinda like this....excuse any non-idiomatic or even downright wrong code here: I don't claim any python proficiency but it's probably the easiest choice for most people:
|
Hello, |
fwiw had a reply from AISHub to say that their downsampling only affects position reports so filtering based on the first 7 characters of the armoured AIS info as above should replicated this behaviour (if my calculations are correct which they may not be) |
Update: Today I pushed the "filter" branch to GitHub, not because it's ready for public consumption but because I'd done too much work on it to leave it uncommitted on my laptop. It's probably full of precarious race conditions and lacks suitable messages but does basically work and with the minor modification to the above python program of providing with a default downsample frequency (because the new "xofilter=" and "xifilter=" options currently only take a single argument so I can pass command line parameters) I was achieving the required downsampling. I'm working on a set of AIS decoding libraries and a utility to use them but for downsampling, as previously suggested, a simple python script will do. I'll smooth out some of the rough edges in the coming week and hopefully ask you to test it soon. |
The xfilter branch still has some tweaks I could make but is ready for testing with details of how to use external filters in the README but basically the deal is...
|
Have you had a chance to give this a try? I have in development a program which will be able to decode AIS and filter by message type and rate limit by mmsi. It would be able to be used as a kplex external filter. What other functionality would you be interested in seeing? |
It would be great if there were a possibility to downsample the NMEA data like the AIS Dispatcher does.
The text was updated successfully, but these errors were encountered: