Skip to content

allco/signalk-i2c-reader-plugin

Repository files navigation

SignalK I2C Reader Plugin

A SignalK server plugin to read data from I2C devices and feed it into the SignalK data model. Ideal for environmental sensors such as temperature or humidity.

Features

  • Read from multiple I2C devices
  • Configure each device with address, register, and SignalK path to update
  • Supports unit conversion via simple linear equation
  • Periodically updates SignalK data with sensor readings

Installation

  1. Navigate to your SignalK server plugin directory:

    cd ~/.signalk/node_modules
  2. Clone this repository:

    git clone https://github.com/allco/signalk-i2c-reader-plugin
  3. Restart the SignalK server:

    systemctl restart signalk
  4. Open the SignalK web UI → Server / Plugin Config → Enable and configure the plugin.

Configuration

The plugin schema includes:

  • Global settings (e.g. I2C bus number, polling interval)
  • Devices array where each I2C device has:
    • name: Device name
    • address: I2C address (e.g. 8)
    • register: Register to read from
    • signalk.path: SignalK path to update
    • signalk.units: Units (e.g. K, %)
    • signalk.converter: Optional a and b values for conversion a * value + b

Example:

{
  "global": {
    "busNumber": 1,
    "pollingInterval": 10000
  },
  "devices": [
    {
      "name": "Interior Temp Sensor",
      "address": 8,
      "register": 0,
      "signalk": {
        "path": "environment.inside.temperature",
        "units": "K",
        "converter": {
          "a": 1,
          "b": 273.15
        }
      }
    }
  ]
}

Development

Install dependencies:

npm install

To run locally:

node index.js

License

Apache-2.0

Author

GitHub: allco

Links

About

A SignalK plugin for reading I2C devices

Resources

License

Stars

Watchers

Forks

Packages

No packages published