GHA
Well-Known Member
This seems to work, possible of interest to a few and possibly no one will bother to try anything 
So, you are fiddling with your ais and interested in how well it's receiving...
Graph the distance of target received should help, fiddle with the antenna, wait an hour or 3 and see if it looks better.
How it works - the ais data goes into the (wonderful
) signalk. Then in a add on in signalk it strips out just the ais messages, calculates the distance from your boat and sends that to a database, then look it 
In the off chance of anyone actually giving it a go just ask & I'll do a better how to, but signalk is easy to install and set up these days, windows or linux anyway, dunno about mac. Also required is influxdb database and a prog called chronograf (or grafana, similar) which does the work of making pretty graphs. Below is some data from a sample nmea file running on the voyage data recorder in opencpn and sending all the data to signalk. I got bit bored early on about 8pm and turned up the speed of playback.
Might be useful if anyone wants it. Not so sure about the calcs - cut n paste from the web - look right?
So, you are fiddling with your ais and interested in how well it's receiving...
Graph the distance of target received should help, fiddle with the antenna, wait an hour or 3 and see if it looks better.
How it works - the ais data goes into the (wonderful
In the off chance of anyone actually giving it a go just ask & I'll do a better how to, but signalk is easy to install and set up these days, windows or linux anyway, dunno about mac. Also required is influxdb database and a prog called chronograf (or grafana, similar) which does the work of making pretty graphs. Below is some data from a sample nmea file running on the voyage data recorder in opencpn and sending all the data to signalk. I got bit bored early on about 8pm and turned up the speed of playback.
Might be useful if anyone wants it. Not so sure about the calcs - cut n paste from the web - look right?
let _ = global.get('lodash')
let app = global.get('app')
let position = app.getSelfPath('navigation.position.value')
msg.lat1 = position.latitude;
msg.lon1 = position.longitude;
msg.lat2 = msg.payload.latitude;
msg.lon2 = msg.payload.longitude;
var p = 0.017453292519943295; // Math.PI / 180
var c = Math.cos;
var a = 0.5 - c((msg.lat2 - msg.lat1) * p)/2 + c(msg.lat1 * p) * c(msg.lat2 * p) * (1 - c((msg.lon2 - msg.lon1) * p))/2;
msg.payload = 12742/ 1.852 * Math.asin(Math.sqrt(a)); // 2 * R; R = 6371 km
msg.topic = 'temp.ais.distance'
return msg;
Last edited: