Skip to content

DeviceManagerSettings

Rob Dobson edited this page May 19, 2026 · 2 revisions

Raft DeviceManager Settings

{
    "Buses": [
        BusConfig#1,
        BusConfig#2
    ],
    "Devices": [
        DeviceConfig#1,
        DeviceConfig#2
    ],
}

Notes:

  • DeviceManager automatically scans the I2C bus to detect devices. For details on the scanning process, priority lists, and multiplexer handling, see I2C Device Scanning.
  • DeviceManager automatically publishes device data through the devjson and devbin topics. For details on the published message formats and how to subscribe to device data, see Device Data Publishing.

Buses

Array of configurations for Buses which must contain at least the settings defined below. Any other information is passed to the bus constructor as part of the JSON configuration and is specific to the type of bus being defined.

Setting Description Type Default Example
name The name of the bus. string N/A "I2CA"
type The type of the bus which must match a registered bus type string N/A "I2C"

Devices

An array of configurations for Devices. Each entry is either a static-device entry (identified by the presence of a class field — DeviceManager instantiates the device via the DeviceFactory) or a bus-tagging entry (no class field — used purely to assign a friendly name and/or role to a bus-discovered device identified by its bus+addr).

Static-device entries

A class field is required. Any other information is passed to the device constructor as part of the JSON configuration and is specific to the type of device being defined.

Setting Description Type Default Example
class The class name of the device which must match a registered device class. string N/A "Buzzer"
name Optional friendly name for the device. Recorded in DeviceManager's name map and returned by /devman/typeinfo and /devman/listdevs. string (optional) "Buzzer1"
role Optional role tag. The default role is normal; set to system to mark the device as system infrastructure (e.g. fuel gauge, RTC) so that consumers can distinguish it from standard measurement devices. string (optional) "normal" "system"
enable true (or non-zero) if the device is to be created. bool (optional) true false

Bus-tagging entries

Used to attach a friendly name and/or role to a device that is dynamically detected on a bus (i.e. not instantiated from the Devices list). No factory instantiation occurs — the entry exists purely to associate metadata with the bus address.

Setting Description Type Default Example
bus Bus name (e.g. "I2CA") on which the device lives. string N/A "I2CA"
addr Device address on the bus (hex, with or without 0x). string N/A "0x36"
name Friendly name to assign to the bus device. string (optional) "FuelGauge"
role Role tag for the bus device (e.g. "system"). string (optional) "normal" "system"
enable Set to false to skip this entry. bool (optional) true false

Example

"Devices": [
    { "class": "Buzzer", "name": "Buzzer1" },
    { "class": "MotorControl", "name": "MotorControl", "role": "system" },
    { "bus": "I2CA", "addr": "0x36", "name": "FuelGauge", "role": "system" },
    { "bus": "I2CA", "addr": "0x6a", "name": "IMU1" }
]

The role and name mappings configured here can also be changed at runtime through the /devman/setname and /devman/setrole REST endpoints (in-memory only — runtime changes are not persisted).

Clone this wiki locally