SonarLink

This information is generally targeted toward advanced applications and 3rd party software that wants to listen in on the SonarView data streams. Most SonarView users can safely ignore.

Use Version 1.12.3-beta (or newer) for the following functionality.

The SonarView application comprises browser-compatible web application with all the UI and most of the functionality, plus a second process called SonarLink which handles all connections to the real world that are not possible to access via browser technology.

SonarLink is a node.js server-side application which runs as a separate process from the web-compatible SonarView application. SonarView and SonarLink are bundled together in a single (Electron) executable available for Windows, MacOS, or Linux.

While the bundled application includes both SonarView and SonarLink, SonarView can optionally connect to remote instances of SonarLink rather than the local bundled one. The SonarLink connection are specified in the user settings as documented in Application Settings.

You can run multiple instance of SonarView on the same computer. In this scenario, only a single SonarLink instance is actually active. This is transparent to the user.

HTTP interface

Among other functions, SonarLink hosts an http interface on port 7077. This interface can be used to access status information as described here.

Status

The /status endpoint reports a bunch of useful information about SonarLink as a JSONobject. This includes SonarLink's host machine and network interfaces, as well as any currently active sessions.

GET http://host:port/status

Where host is the ip address (typically 127.0.0.1 or localhost), and port is 7077.

In particular, this can be used to identify existing sessions and getting their session_id.

Listen-Only WebSocket

Here we describe a scenario where SonarView is connected to a sonar and a 3rd party application wants to "listen in" on all the data coming from the sonar so that it can process the live information in real time.

Here is how you might open a listen-only web socket to an existing session already opened by SonarView. We're assuming SonarLink is running on localhost.

  1. Submit a HTTP GET to ws://localhost:7077/status . This will return the current status of SonarLink and list all active sessions. If an appropriate session already exists, find the session id in this JSON object at status.sessions[index].session_id.

  2. Open a WebSocket connection like ws://localhost:7077/connect?session_id=1.

Now all data coming from the sonar (and other devices in the session if any) will be sent to this web socket. The data is a stream of Cerulean Ping Protocol packets. The 3rd party application is then responsible to parse the data and process as desired. For information on the packet formats consult the API section for the particular sonar as well as the Cerulean Ping Protocol document.

Last updated