Translate

Thursday 13 August 2015

Navionics SonarChart™ Live on Android

Skip to the good bit

For a quick hack to get SonarChart™ Live on android working with a home-brew or "unsupported" serial-to-wifi solution without the background, jump here.

How Deep Is Your Love?

A few months back a kplex user made me aware of a new feature in Navionics Boating: SonarChart™ Live.  This is a new feature in Navionics which enables users to generate bathymetric maps using current (hence, presumably, "Live") depth information from their own instruments.  More specifically,  data provided via selected partners' products. 

Anthony was trying to work out how to feed depth information via kplex to Navionics.  He'd done some investigation of the iOS version of Navionics and determined that the app was trying to contact fixed IP addresses and ports associated with the default set-up of the various "supported" partner products.  In subsequent analysis of the app I also noticed references to the bonjour services associated with GoFree (_nmea-0183._tcp) and Vesper (_vesper-nmea0183._tcp).

By setting up his pi to emulate the Digital Yacht Sonar Server, Anthony managed to feed depth information into Navionics from kplex but I thought that there must be a better way to achieve this so I emailed Navionics to ask how Navionics Boating users with existing serial-to-wifi solutions could realise the benefits of this exciting new feature. Not possible came the reply, and no they wouldn't reveal how their "automatic" connection worked:
We have developed at code level this features together with our partners. We do not open it externally at the moment and there's not any future plan to do it.
I asked for this to be escalated to product management as surely they'd want as many people as possible to enjoy this feature. I was promised a reply but despite several prompts over the following weeks one never came.

Echoes

A few days ago my android phone prompted me to upgrade Navionics Boating. The android version previously didn't support SonarChart™ Live but now it does, so despite my disinclination to allow the draconian new permission requirements (access to all my accounts? Make phone calls? Access to my contacts?  Why?) I upgraded.  With my Raymarine plotter bridging my seatalk-1 depth sounder's data to NMEA, converted to wifi by kplex running on my raspberry pi access point, I started experimenting.

Say Hello

First up...would advertising _nmea-0183._tcp as Navico's GoFree does tell Navionics to look for depth data in the right place?  I installed avahi (the linux bonjour implementation) and configured a service, creating a file /etc/avahi/services/kplex.service as follows:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>
  <name replace-wildcards="yes">%h NMEA</name>

  <service>
    <type>_nmea-0183._tcp</type>
    <port>11010</port>
  </service>

</service-group>

No joy.  For good measure I also tried configuring the _vesper-nmea0183._tcp service. Still nothing.

Listen Like Thieves


Some network snooping showed the phone attempting to connect to 192.168.0.10 on port 10110.  This was the only address I could see it trying apart from an immense volume of traffic to MarkMonitor (apparently a "brand protection" company), Flurry and Amazon Web Services (presumably Navionics's servers).  Good to know how they're using your bandwidth and exploiting all those security privileges then.

My pi is set up as a router (so will move traffic from one interface to another) so I ran up a secondary interface, assigned it the address 192.168.0.10, restarted kplex (which was implementing a tcp server on all interfaces), restarted Navionics boating and Bingo!  SonarChart™ Live functionality.

My Name Is

By curious co-incidence 192.168.0.10 is the first DHCP address handed out by the Navico GoFree Wifi-1 in default configuration and would often be the address handed out to a plotter (distributing GoFree data) on a Navico network.  Further experimentation whilst attempting to emulate a Navico network revealed something bizarre.  Without the 192.168.0.10 address configured, if the SSID of the network the phone connects to contains the string "GoFree" (e.g. "GoFree-1234") and a data service on 192.168.0.10 is not available, the Navionics app throws up a screen asking the user to input the address for the source of depth information.  Port is not configurable and seems to be fixed at 10110 but inputting the pi NMEA server's address once again gave me SonarChart™ Live functionality.

This seems to be a very crude method of attempting to limit the data servers which can be used with SonarChart™ Live given that SSID is configurable and some GoFree wifi-1 users will have doubtless changed theirs from default.  Knowing less about the set-up of other supported data servers (e.g. Vexilar T-Box, Raymarine Dragonfly) I have not investigated whether default SSID plays a part in presuming them to be sources of data.

Disco 2000

So what of UDP?  For some reason Digital Yacht's products have used 2000 as a port for their wireless NMEA servers in the past.  I've had a hard time finding a manual for their SonarServer (one of the Navionics "SonarChart" supported products).  I tried UDP broadcasts from kplex on port 10110 to no avail but changing the port to 2000 once again yielded success.

Where's Your Head At?

Interestingly Navionics Boating seems to be parsing GPS data it is being sent over wifi.  Turn off location services on android and the app doesn't know your position when it fires up.  Turn on wireless data which includes GPS as well as depth sentences and your position is plotted.   This should be of particular interest to people who bought duff mobile devices which don't include an integrated GPS chipset.

Different Trains

It seems to be the case that the iOS version of Navionics may well function differently from the android one in how it determines where its data comes from.  Bonjour is well established on Apple platforms but Network Service Discovery was only added in android 4.1.  On the other hand "wifi multicast reception" is one of the (many, many) privileges Boating requests on android.  Sadly I don't have an iOS device with Navionics to play with in order to learn more.

As Navico's use of bonjour as one of the two ways they advertise their GoFree data service isn't a bad plan, I've decided to retain my avahi configuration on the pi for the time being.

The First Cut is the Deepest

So how best to get SonarChart™ Live on android to use our home-brew data server?  You could run up an interface on 192.168.0.10 but the easiest solution would appear to be one of the following.

If you prefer to access your data over TCP, change your SSID to something with the string "GoFree" in it, e.g. "GoFree-1234" and run an nmea server on port 10110.  When you open Navionics Boating it will ask you for the address of your server, tell it, and you can start using SonarCharts™ Live.

Otherwise broadcast your data over UDP port 2000.

If anyone has a better suggestion on how to achieve this with either the android or iOS versions of Navionics Boating, please do post a comment below.