Adding new radar types - opencpn-radar-pi/radar_pi GitHub Wiki

Why doesn't the plugin support Furuno / Garmin Fantom ....

Well, simply because no owner of such a radar bothered to implement it.

In our experience, to implement a new radar you need to have three items at the the same time and place:

  1. A radar of the desired type with the means to control it such as a chart-plotter.
  2. A software developer with at least some C++ skills. They don't need to be huge, as long as (s)he has the willingness to learn.
  3. Lots of time to test, learn, adapt, recycle of #2.

Remember that we are not programming from a specification, there is a lot of trial and error to specify the interface with the radar on the fly.

How do I go about this then?

Well, if you've done any software development in the last 15 years, you should be able to contribute. We're here to help you with tips and support. The plugin, like the rest of OpenCPN is written in C++ but you don't need to worry too much as you can copy/paste large parts.

Once you've got the hardware running with a computer running OpenCPN, you will start by analysing the commands that your chartplotter produces and the data that comes from your radar. Luckily, all radars seem to send out spokes in the same sort of format, unencrypted and un-authenticated. To do the analysis you will need tools such as tcpdump and wireshark. Focus on simple things first: starting transmission, stopping transmission. Receiving spoke data.

Once you've got some idea what data goes back and forth, clone the radar_pi project and add files for your own radar type. It's probably easiest to assess which existing radar looks the most like yours in terms of functionality, and then copy the files for that radar and modify them to your radar. In principle you only need to implement the actual sending of commands and the actual reception of radar data, and even those you don't need to start from scratch but can probably copy an existing one. You will also need to extend the list of radars and the type of commands it supports, again see how this is done for existing radars. Talk to us if you have a concrete radar that you want to add; we can set up a branch of the code in git for you to work with which can have an "empty" framework for you to fill in.

You do not need to code the difficult bits, such as programming the PPI displays, overlay, menu entries, menu boxes, guard zones, target trails, etc. This is all generic code that you will just get for 'free'.

Once you've started you should start sending us pull requests so that we can share your work with others with the same radar.

Detecting the location and IP addresses of the radar

A proper radar variant will auto-detect the location of the radar. Some radars use only multicast. This means the computer doesn't need to have a particular IP range. Some radars use multicast to advertise the radar location, and send out DHCP requests. In such a case, the simplest is to add the requirement that a router or access point is present in the network that has a DHCP server. And other radars (we're looking at you, Garmin!) have a pretty rigid procedure where the computer must have an IP address in a particular range.

Writing the "spoke" reception code

Once you know where the radar sends the spoke data, add code to receive this data. This is best done by cloning the Navico radar reception code and removing all bits you don't need. (The Navico code is the cleanest of all types.)

At this point you are still controlling the radar using the MFD.

Writing the "command" code

Now the time has come to add the "Control" bits. If you dig into the code, you will find that you can define a list which commands the radar supports. For instance, whether it has a Gain (probably yes) or a Side Lobe Suppression setting (maybe?) All you need to do is say which ones the radar has. For each control that you enable, the GUI will gain extra buttons to control that setting. You should not need to add controls, we have so many now...

Then for each of those controls, implement code to send a command to the radar. You can clone any of the existing radars for this; they are all mostly alike as this is actually the easiest bit of code from a coding point of view. Knowing which commands to send though, that can be a big pain!