Repository navigation
DeviceManagerRESTAPI
The API for DeviceManager is included in the Raft API List
This endpoint is used to retrieve detailed information about a specific device type on a given bus. It returns information such as the device's capabilities, status, and configuration details.
| GET Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | The type name of the device to retrieve information for. |
/devman/typeinfo?type=LSM6DS
{
"req": "/devman/typeinfo?type=LSM6DS",
"devinfo": {
"name": "LSM6DS",
"desc": "6-Axis IMU",
"manu": "ST",
"type": "LSM6DS",
"resp": {
"b": 12,
"a": [
{
"n": "gx",
"t": "<h",
"u": "dps",
"r": [
-2000,
2000
],
"d": 16.384,
"f": ".2f",
"o": "float"
},
{
"n": "gy",
"t": "<h",
"u": "dps",
"r": [
-2000,
2000
],
"d": 16.384,
"f": ".2f",
"o": "float"
},
{
"n": "gz",
"t": "<h",
"u": "dps",
"r": [
-2000,
2000
],
"d": 16.384,
"f": ".2f",
"o": "float"
},
{
"n": "ax",
"t": "<h",
"u": "g",
"r": [
-4,
4
],
"d": 8192,
"f": ".2f",
"o": "float"
},
{
"n": "ay",
"t": "<h",
"u": "g",
"r": [
-4,
4
],
"d": 8192,
"f": ".2f",
"o": "float"
},
{
"n": "az",
"t": "<h",
"u": "g",
"r": [
-4,
4
],
"d": 8192,
"f": ".2f",
"o": "float"
}
]
}
},
"rslt": "ok"
}{
"req": "/devman/typeinfo?type=UnknownDevice",
"rslt": "error",
"error": "failTypeNotFound"
}Other failure reasons:
-
failTypeMissing: Missingtypeparameter. -
failTypeNotFound: The specified type was not found.
Description:
This endpoint allows raw commands to be sent to a device on a specified bus. It can be used to send low-level control commands to devices, such as writing specific data to a device register.
Method: GET
| Parameter | Type | Required | Description |
|---|---|---|---|
bus |
string | Yes | The name of the bus where the device is located. |
addr |
string | Yes | The address of the device on the bus. |
hexWr |
string | No | A hex-encoded string representing the data to write to the device. |
numToRd |
int | No | The number of bytes to read from the device. |
/devman/cmdraw?bus=I2C1&addr=0x3C&hexWr=F00D
{
"req":"/devman/cmdraw?bus=I2CA&addr=0x6a",
"rslt":"ok"
}-
result: Indicates the success or failure of the command (ok,error).
-
failBusMissing: Missingbusparameter. -
failMissingAddr: Missingaddrparameter. -
failBusNotFound: The specified bus was not found.
Description:
Routes a JSON command to a specific device. The JSON body must include a device field that matches the configured device name or device ID string.
Method: GET
| Parameter | Type | Required | Description |
|---|---|---|---|
body |
string | Yes | JSON command string; must include a device field. |
/devman/cmdjson?body={"device":"I2CA_20","cmd":"reset"}
-
failMissingBody: Missingbodyparameter. -
failDeviceNotFound: The specified device was not found. -
failNoDeviceSpecified: The JSON body did not include adevicefield. -
failCmdFailed: The command failed in the device handler.
Description:
This endpoint retrieves the bus name from a bus number. Bus numbers start from 1 and match the numbering used in device data JSON/binary messages. Only buses with valid device interfaces are numbered.
Method: GET
| Parameter | Type | Required | Description |
|---|---|---|---|
busnum |
int | Yes | The bus number to retrieve the name for. |
/devman/busname?busnum=1
{
"req": "devman/busname?busnum=1",
"rslt": "ok",
"busName": "I2CA"
}-
failInvalidBusNum: Missing or invalidbusnumparameter. -
failBusNotFound: The specified bus number was not found.
Description:
This endpoint sets the polling interval for a bus-connected device. Only works for devices connected via a bus (I2C, Serial, etc.).
Method: GET
| Parameter | Type | Required | Description |
|---|---|---|---|
bus |
string or int | Yes | The bus name (e.g., "I2CA") or bus number. |
device |
string | Yes | The device ID or device address (e.g. "20" or "I2CA_20"). |
intervalMs |
int | Yes | The polling interval in milliseconds. |
/devman/setpollinterval?bus=I2CA&device=20&intervalMs=50
or
/devman/setpollinterval?device=1_20&intervalMs=50
{
"req": "devman/setpollinterval?bus=I2CA&device=20&intervalMs=50",
"rslt": "ok"
}-
failBusMissing: Missingbusparameter. -
failDeviceMissing: Missingdeviceparameter. -
failInvalidInterval: Missing or invalidintervalMsparameter. -
failDeviceNotFound: The specified device was not found. -
failBusNotFound: The specified bus was not found.
Description:
Starts a demo device instance (if enabled) with a configurable sample rate, duration, and offline behavior. Useful for testing pipelines without real hardware.
Method: GET
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | No | Device type name; default ACCDEMO. |
rate |
int | No | Sample rate in ms (min 10, max 60000). |
duration |
int | No | Duration in ms (0 for continuous). |
offlineIntvS |
int | No | Offline interval seconds. |
offlineDurS |
int | No | Offline duration seconds (min 1). |
/devman/demo?type=ACCDEMO&rate=100&duration=10000
-
failDemoDeviceExists: The demo device already exists.
Common Tasks
Getting Started
- Quick Start
- Architecture at a Glance
- Writing Your First SysMod
- Adding a Comms Channel
- Adding an I2C Device Type
Scaffolding & Building
- Raft CLI
- Web Apps (Device Types, Flasher)
- SysTypes
- Top-Level SysType
- Build Process
- WebUI Build Pipeline
- File System
- Partitions & Flash
- Local Dev Libraries
- Library Developer Guide
Architecture
Built-in SysMods
- NetworkManager
- WiFi Troubleshooting
- BLEManager
- WebServer
- MQTTManager
- SerialConsole
- CommandSerial
- CommandSocket
- CommandFile
- FileManager
- LogManager
- ESPOTAUpdate
- StatePublisher
- Remote Logging
- Data Source Registration
Comms & Protocols
- Stack Overview
- Comms Channels
- ProtocolExchange
- RICREST Protocol
- Real-Time Streams
- Adding REST Endpoints
- Built-in REST Endpoints
- File Download (OKTO)
- OTA Update Flow
Devices & Buses
- DeviceManager
- Device Manager REST API
- Device Factory & Classes
- Device Type Records
- Selecting Device Types
- Adding an I2C Device Type
- Device Data Publishing
- Data Logger
- I2C Bus
- I2C Device Scanning
- I2C ID & Polling
- MotorControl Overview
- MotorControl Config
- MotorControl Commands
- Camera
ROS 2
Helpers
Reference