Interesting AIS Project

Hurricane

Well-Known Member
Joined
11 Nov 2005
Messages
9,855
Location
Sant Carles de la Ràpita
Visit site
As most will know on here, I run the technical side of the marina forum at Sant Carles Marina ( www.scmchat.com )
The forum is run by berth holders for berth holders - no MDL influence.

That said, the marina manager at Sant Carles is always helpful and supportive.
So, when I approached him saying that we need better internet coverage for AIS in the Sant Carles area, he was understanding and prepared to help where necessary.

A background for those who don't know how all this stuff works.
If properly equipped, AIS signals are transmitted by vessels using VHF frequencies.
This limits the range to about 20 to 50 miles depending on conditions and installation etc.
Great for close quarter navigation to avoid collisions etc.
Vessels close to each other can share information - their position and course etc thus reducing the chance of collisions etc.
VHF is close range so, over the years, base stations have sprung up around the world that receive all these local AIS signals and feed them onto the internet where websites like Marine Traffic and Vesselfinder make the data available to everyone on the internet where ever you are. Satellites also receive AIS and feed onto the internet in a similar way. This works well for commercial craft that are allowed to transmit a more powerful signal and more frequently than leisure boats (excluding the latest Class B+). Consequently, you find areas of poor internet coverage, particularly for leisure boats.

Sant Carles is no exception.
We have a large fishing fleet alongside the marina but poor AIS coverage on www.marinetraffic and www.vesselfinder.com
So, I suggested to our marina manager that if, he provided the power, antenna and internet connection, I would build the necessary equipment to relay local AIS signals onto the internet.
There is an extra benefit that we would get - I have included consenting Sant Carles berth holders into a fleet within Vesselfinder. The SCMCHAT software then uses Vesselfinder to display "our fleet" of boats on an interactive map - I have even included the Brittany Ferries we all use into our fleet. Berth holders simply log into SCMCHAT to see where everyone is. That is fine but we needed to have a more accurate AIS input into the internet and by inputting AIS, Vesselfinder would upgrade our account to their professional version - a win win.

See this link to the SCMCHAT page - the Sant Carles Marina AIS Fleet
Here you can easily see where all our boats are (including the ferries) - without all the other vessels in the world.
http://www.scmchat.com/marina/scmais.html

Our marina manager was very supportive of the idea and immediately authorised his contractor to prepare the site for the equipment that I was going to build.
I WAS NOW TOTALLY COMMITTED TO PROVIDING AN ELECTRONIC SOLUTION AND NO IDEA WHAT TO USE.
We run SCMCHAT in a tight budget so I needed to keep the costs to a minimum.

I looked at buying a cheap AIS receiver but that would need some form of computer to connect it all to the internet.
I would need something that would collect the AIS data, filter out duplications and then push the results onto the internet.

You can buy dedicated equipment but that would be expensive so I got my box of Raspberry Pi parts out and started experimenting!!

Continued on next post.
 
Raspberry Pi - background.
For those of you who don't know, the Raspberry Pi is a credit card sized micro processor that was designed for schools and universities to cheaply teach electronics and programming. The open source community got its hands on the project and you can now download all kinds of applications for this low cost and relatively powerful little device. It even runs a complete Linux operating system. In the past, I have built a range of applications using the Raspberry Pi including TV Set Top Boxes and full internet servers. The basic Raspberry Pi includes 4 USB interfaces, an Ethernet connection HDMI video output, an expansion port and, importantly, a microSD card which can be thought of as a hard disk. So, simply installing software onto the microSD card enables you to program loads of different applications.

The Raspberry Pi seemed to be an obvious solution to feed AIS data onto the internet.

But I got lucky.
I found a dedicated AIS "Hat" for the Raspberry Pi.
In the Raspberry Pi world, a "Hat" is an "addon board" that clips onto the Raspberry Pi's expansion port.
The AIS "Hat" is, essentially a marine AIS receiver that integrates into the Raspberry Pi.
The hat is called a "dAISy" hat - wonderful names that people come up with.
Here is a pic of the two parts - the green board is the Raspberry Pi - the red board is the "dAISy" hat.

6.jpg


You simply clip the two together and it looks like this:-

7.jpg


So, with the hardware sorted, I turned my attention to the software.
I got lucky - again.
A software project specifically for collecting AIS data on the Raspberry Pi and streaming it onto the internet.
The project is called - rPiAIS – AIS Dispatcher for Raspberry Pi
So I loaded it onto my Raspberry Pi / dAISy Hat combo and - IT WORKED

I live close to Lyme Bay and I have a very makeshift VHF antenna on the side of my house so I connected my new (now called) AIS Station to the antenna and wow - I was receiving signals from hundreds of miles away.

This is a screen dump from the new "AIS Station" connected up here in Devon.

AISScreenDump.jpg


Now, don't get too carried away.
VHF is a funny thing.
There are days when it will travel hundreds of miles.
And I had just picked one of those days.
But you can imagine how excited I got when I picked up signals in Devon transmitted from Calais.

So, I packaged it up into a small box and gave it a dedicated power supply.

3.jpg


Over the next few weeks, I "soak tested" it.
Basically, I left it on - feeding data into Vesselfinder's servers.
The guys at Vesselfinder were really helpful.
I was able to have email conversations with them and they provide some very useful links into their site where I could monitor my new AIS Station.
After a few days, it settled down consistently receiving signals from the TSS north of Guernsey - that makes it about 45 miles - just what I wanted.
So, last spring, I left it running at home for about 6 weeks.
It worked flawlessly - not a single hiccup.

So, the time came to take it out to Spain and make it work for real.
It actually took until late August before it was finally installed in Sant Carles.
The WiFi contractor in Sant Carles connected it all up and switched it on.
And it has been working ever since.
There have been several power cuts in the marina since then, but every time, it restarts itself and get on with its job.
The result is now very accurate AIS data on the internet in and around Sant Carles.

A month after installing it, I added Marine Traffic's servers so it is now streaming to both Vesselfinder and Marine Traffic.

Here is a link to it (actually, it is a link to Vesselfinders monitoring page but the data is live - as it is received by my little AIS Station):-
https://stations.vesselfinder.com/stations/5483

So, if you are interested, please browse to the above link.
If you scroll down, you will see the history statistics,
Look at the peaks - you should be able to see the times that the Sant Carles fishing fleet go to sea and when they return.
This is indicated by the increased number of ships in range at that time.
As you can see, they leave at about 05:00 each morning and return at about 16:00 in the evenings.

And here's a link to the final result - the SCMCHAT's AIS Fleet.
http://www.scmchat.com/marina/scmais.html
Note this link contains more vessels than the ones shown on the AIS Station's live feed ( https://stations.vesselfinder.com/stations/5483 ).
Thats because Vesselfinder keep track of boats last known position even though they might not be transmitting.
Jennywren is a good example of this - she is on the SCMCHAT AIS Fleet but not on the live AIS Station feed.

I hope you find this little project interesting.
Especially as it has been put together on a small budget.
My thanks go to the marina manager and his staff in making this possible.
 
Last edited:
Good stuff, one thing for you to think about, its worth making a copy of the sd card, and keeping it taped inside the case, for when the card that is running fails, they do eventually just through read/write cycles. Then all someone has to do is to swap the card out, means it can be sorted without you there.

You can use the Raspi backup software in the OS do this easily.
 
Good stuff, one thing for you to think about, its worth making a copy of the sd card, and keeping it taped inside the case, for when the card that is running fails, they do eventually just through read/write cycles. Then all someone has to do is to swap the card out, means it can be sorted without you there.

You can use the Raspi backup software in the OS do this easily.

Yep - that was done - already taped to the AIS Station and ready to plug in if it fails.

I also have installed some remote access software so that I can run diagnostics or fix things remotely.
Thats how I added Marine Traffic to the system.
 
Just thought I would add another idea to this thread.

Using the same hardware (Raspberry Pi and the dAISy Hat) you could make your own AIS receiver.
Why - I hear you say.
Well, the Raspberry Pi has an on-board WiFi interface.
So you could then get teh Raspberry Pi to transmit AIS wirelessly through the boat and display AIS on your mobile devices.
An open source program called Kplex will multiplex AIS NMEA data into an IP stream
I do this now on JW but using the ships PC so I know it works (JW's system even outputs depth to the mobile devices)

But you could do this using just the Raspberry Pi/dAISy Hat combo.

Unfortunately it is a little more complicated on the mobile end.
iPhones and the Navionics App might work but the port addresses aren't easy to find.
I use Androids and OpenCPN which works fine.
Likewise a Windows laptop under OpenCPN could be easily configured to receive AIS.
Effectively giving you a fully functional plotter.
 
This is very cool. Did you have to do any coding yourself or was it just "Plug and Play" using the hardware setup and the rPiAIS project software? I do find myself in a Hat Dofferation scenario right now, very nice job done indeed.:encouragement::cool::cool::cool:

(Thanks for the detailed write-up too.)
 
This is very cool. Did you have to do any coding yourself or was it just "Plug and Play" using the hardware setup and the rPiAIS project software? I do find myself in a Hat Dofferation scenario right now, very nice job done indeed.:encouragement::cool::cool::cool:

(Thanks for the detailed write-up too.)

No, I didn't have to do any coding.
rPIAS is a dedicated AIS Dispatcher it comes as a full Raspberry Pi image complete with its (console only) Linux operating system.
You don't need to use the console though - it also has an embedded web server so you set it all up and manage it using a browser.
That said, rPAIS is only designed for use as an AIS Dispatcher with servers like Marine Traffic and Vesselfinder so is probably of no use to people on here.

The hardware, though could be useful.
Still without coding, there are Open Source projects that could run this little Raspberry Pi / dAISy Hat.
For example, Openplotter will run on it.
Openplotter incorporates OpenCPN - add a £10 GPS dongle and a monitor and you would have a completely self contained plotter with AIS.

Alternatively - the idea I mentioned in #9
You could very easily install Linux (Raspbian - a distro specifically for the Raspberry Pi) and Kplex (an NMEA Multiplexer) and distribute NMEA sentences throughout the boat - wirelessley.
All on this cheap Raspberry Pi /dAISy Hat bundle.
 
I've done this with the cheap digital TV dongles, rtl-sdr and something like aisdeco2 for quite a bit less than the daisy....
 
I've done this with the cheap digital TV dongles, rtl-sdr and something like aisdeco2 for quite a bit less than the daisy....

IIRC you were routing NMEA data round the boat wirelessly years ago - long before I thought about it.

Before starting this AIS Station project, I played with rtl-sdr.
It worked but I couldn't get a good enough signal to use in a working environment.
Too much fiddling - the dAISy hat isn't the most sensitive either but it is very easy to use.
I seem to remember that you did a lot of work on software radio.
 
Last edited:
Can anyone tell me more about the VHF antenna? Which do you use with Raspberry?
Thanks

Any antenna you use should be matched with the frequency that you are using.
So, in this case an antenna suitable for marine VHF frequencies should work.
If you want perfection, you would buy a specific antenna for the actual frequency of the AIS signals that you are going to receive.
A quick Google shows AIS frequencies are 161.975 MHz (AIS1, or channel 87B) and 162.025 MHz (AIS2, or channel 88B).

Hope that helps
 
I did something very similar at home to be able to feed AIS into the Marinetraffic system. I used an old Digital Yacht AIS receiver (left over from when I upgraded to a transceiver on my boat) and connected it to the internet via a WIZ11SR serial to ethernet adaptor. Pretty much self-contained and no need for an RPi. Your solution is probably cheaper if you don't already have the AIS reciever.
 
Would the inboard Wi-Fi function of the Pi also make this work with the new AIS overlay of the Navionics Boating app, that also required a Wi-Fi AIS receiver like this? ??

https://www.navionics.com/usa/blog/post/ais-in-the-boating-apphttps://www.navionics.com/usa/blog/post/ais-in-the-boating-app

Thanks,
V.

The short answer is maybe.

It should work but there is more information required - your link above doesn't work - I assume it is because you are logged into Navionics and I am not.
About 9 months ago, I did some tests using the Navionics app on the Android and it didn't work.
Essentially, the way these things work is that a device like the Raspberry Pi sends an IP stream over either TCP or UDP using a dedicated port number.
The accepted port number that is usually used is 10110 but it could be anything.
I don't use the Navionics app any more so I can't help.
If you want an "off the shelf answer, Digital Yacht have hardware that does the job - see here:-
https://digitalyacht.net/2019/07/12/ais-navionics/

The system that I have outlined using a Raspberry Pi would simply send NMEA sentences over port 10110.
Any mobile device set up to receive this data should work.
I use OpenCPN and that works.

Also, there is a new technology called Signal K which specifies this type of connection and a whole lot more functionality.
At the moment, I can't see the point of Signal K and it just complicates things but it may be used more in the future.

Another point to consider - the actual WiFi connection.
In my Raspberry Pi example, you can do one of two things:-
1 - Get the Raspberry Pi to connect to an existing router, in which case, any other device attached to that router (a mobile device for example) would receive the data from the Raspberry Pi.
or
2 if a router isn't available, you could connect directly to the Raspberry Pi but then you wouldn't have any internet connection whilst you are attached to the Raspberry Pi.

I believe that the Digital Yacht systems work in a similar way.

If you are connecting
 
Top