Skip to content

FAQ: Frequently Asked Questions

MatsA edited this page Aug 26, 2021 · 56 revisions

Please, feel free to add new entries, if you can include the answer. Questions without answers in Signal K Slack (join) or as Github Issues.

How do I send data to the server?

PUT is for making changes that have some real world consequences, like turning on the anchor light.

Sensor data / new values for something are sent as delta messages over the WebSocket connection. The simplest delta is {"updates":[{"values": [{"path":"a.b", "value":3.14}]}]}.

How do I output data via a serial connection?

See Events and Outputting data.

Where is the server’s log?

On Raspberry Pi the log is at /var/log/syslog and under Server => Server Log in the admin webapp.

How to disable security? OR I have lost my admin password, what do I do?

Remove this section from your settings.json (that is usually located at $HOME/.signalk/settings.json)

  "security": {
    "strategy": "./tokensecurity"
  },

If your server is started with --securityenabled argument you need to remove that to disable security.

WebSocket connections are being dropped and syslog shows "Send buffer overflow, terminating connection"

Some WebSocket client connects with a url that causes the server to send it data continuously, but the client never reads the data. The outgoing buffer on the server grows and eventually the server cuts the connection to safeguard its wellbeing. The client should connect with subscribe=none query parameter, if it does not care for the data stream.

How do I integrate with NMEA2000 (CAN bus)?

Receiving NMEA2000 data requires a CAN bus transceiver to be connected to your system. There is a multitude of chips, devices, HATs, adapters and other solutions out there that roughly be divided into two categories: NMEA 2000 Gateways and Socketcan-compatible hardware. The Node.js Signal K server supports all socketcan-compatible hardware (some are well tested by other community members, others less so) and a few NMEA 2000 gateways.

Supported NMEA 2000 gateways

Node.js Signal K server gateway support is determined by the devices supported by canboat(js). At the time of writing, the following gateways are supported:

Socketcan-compatible CAN transceivers

Socketcan is a Linux kernel extension that publishes a compatible CAN transceiver as a network interface, allowing programs to open sockets to the CAN bus. Unlike the NMEA2000 Gateways, some configuration may be necessary (such as setting up the network interface to be set up at boot, with the right bitrate). The amount of configuration and correct settings depend on the transceiver and firmware used. These solutions are usually cheaper than an NMEA2000 Gateway, but require more DIY to get up and running, and carry no NMEA certification.

To set-up a socketcan device for NMEA 2000, you run the command: sudo ip link set up can0 type can bitrate 250000. However, that only persists until the next reboot. Consult the internet for instructions for your Linux distro and CAN transceiver on how to configure your system to enable the CAN interface at boot time.

The socketcan devices are divided in two categories: those that have galvanic signal isolation and those that do not. Galvanic isolation is important for removing ground loops and for improving signal noise immunity. Without galvanic isolation, ground loops (like the 50/60 Hz hum in badly designed audio systems) can cause significant voltage potential differences and disrupt the communication signal. Galvanic isolation is a mandatory requirement in both NMEA 2000 and NMEA 0183 specifications and should always be used when connecting to essential navigation equipment.

CAN interface devices with galvanic isolation, in alphabetical order:

*Note: PEAK provides SLCAN drivers, but they should not be necessary on Linux. When using SLCAN the CAN adapters shows up as a serial device instead of a socketcan device.

CAN interface devices without galvanic isolation, in alphabetical order:

These lists are incomplete. Most other socketcan-compatible boards and chips will work, but have not been tested yet.

Are you using a CAN transceiver not on this list? Please add!

How do I configure a Yacht Devices Wi-Fi Gateway as a NMEA 2000 source?

Go to the "NMEA Server" page on the YD gateway and add a new server. Use Network Protocol TCP, Data Protocol RAW, Port 1457 and Direction BOTH.

Now you can configure, at the Signal K server, a NMEA 2000 connection as "Yacht Devices RAW TCP(canboatjs)".

Tested with YDWG-02, YDNR-02

How to add missing units and static data

The metadata are provided by the Signal K schema on the server. If they do not appear in the original schema, server's Data Browser, webapps like InstrumentPanel and mobile apps like WilhelmSK can not retrieve the unit for display and conversions.

You can add the missing units to your defaults.json file. The known units are defined in the schema files.

If you have a ~/.signalk/baseDeltas.json file

  • If it's a static value, add to the updates section
  • If it's meta, add to the meta section
[
  {
    "context": "vessels.self",
    "updates": [
      {
        "values": [
          {
            "path": "navigation.magneticVariation",
            "value": -0.191986
          },
          {
            "path": "",
            "value": {
              "name": "MyBoat",
              "mmsi": "1234556",
              "communication": {
                "callsignVhf": "Test"
              }
            }
          }
        ]
      }
    ]
  },
  {
    "context": "vessels.self",
    "updates": [
      {
        "meta": [
          {
            "path": "environment.cpu.temperature",
            "value": {
              "units": "K",
              "timeout": 30
            }
          }
        ]
      }
    ]
  }
]

If you have a ~/.signalk/defaults.json file

For example, to add the missing unit for the Raspberry PI Temperature plugin:

  • Locate your defaults.json file
  • Locate self key in the json structure
  • Add content below inside the self key
"environment": {
  "cpu": {
    "temperature": {
      "meta": {
        "description": "Raspberry Pi cpu temperature",
        "units": "K",
        "displayName": "CPU temp",
        "timeout": 30
      }
    }
  }
}

You can also add missing static data, like environment.depth.transducerToKeel.value used by the Derived Data plugin, in the same file. Note that static data added in defaults.json is not visible in the Data Browser but you can use the /signalk/v1/api/vessels/self/ http endpoint to verify that the data is where it should.

  • Double check your json file with a json validator (if something wrong in your json file, your server will not start)
  • Loading changes requires a server restart
  • Verify if unit is present in Signal K Data Browser (Wait at least 30 seconds for the plugin to send data)
  • As InstrumentPanel caches the retrieved units on the server, you must reset the Instrumentpanel's cache: In settings, select Reset settings then check Layouts cache and click Reset button

How can I get remote access to Signal K?

The following solutions provide direct access to your server.

How do I develop a plugin or webapp so that I can run it in the server?

Use npm link to link the module you are developing to the server and run the server from a git clone, not as a real install.

$ mkdir work && cd work
$ git clone [email protected]:SignalK/set-system-time.git && pushd set-system-time && npm link && popd
$ git clone [email protected]:SignalK/signalk-server.git && pushd signalk-server && npm install && npm link @signalk/set-system-time
$ bin/n2k-from-file