Daemon API v2.7.x (beta)
WebSocket authentication
As of version 2.7, clients are required to authenticate before using the Daemon JSON API via WebSocket. New client sessions are expected to authenticate within configurable time period, otherwise the connection is terminated by the server with policy error code (1008). The server expects authentication request to be the first message sent by client after establishing connection.
Clients can authenticate their session via special authentication API messages below.
Note that authentication is required when connecting directly to the WebSocket server, if you are using the IQRF Gateway Webapp user interface, the application handles session authentication for users upon singing in.
Authentication request
The authentication request message is a JSON request in the following format:
json
{
"type": "auth",
"token": "<YOUR_API_TOKEN>"
}Authentication response
In case of successful authentication, the server responds with a message confirming authentication, and includes expiration time of the session and whether the used API key has sufficient permissions for use of service mode API.
json
{
"type": "auth_success",
"expiration": "2026-06-29T12:20:02.188Z",
"service": false
}If on the other hand, the authentication fails, the server responds with an authentication failure message, informing the client of the authentication failure reason via a code and short message, and the connection is terminated with policy error code (1008).
json
{
"type": "auth_error",
"code": 4,
"error": "Invalid token"
}Authentication error codes
Below is a table of authentication error codes and their meaning.
| Code | Error string | Description |
|---|---|---|
| 1 | Unauthenticated | Client sent a non-authentication message after connecting. |
| 2 | Authentication timeout | Client failed to send authentication message in time. |
| 3 | Authentication failed | Authentication could not be performed. Currently only used if the server receives a mangled, non-JSON message. |
| 4 | Invalid token | The token used for authentication is not in a valid format, or the token record does not exist. |
| 5 | Expired token | The token used for authentication has already expired. |
| 6 | Revoked token | The token used for authentication has been revoked. |
General message error
If a request fails before reaching its handler, the Daemon replies with the generic messageError (mType) response. The rsp object containts additional properties to further clarify the error.
Message error status codes
| Code | Message | Description |
|---|---|---|
| 1 | An error has occurred while handling request. | A general, further unspecified, unexpected error occurred while handling the request. |
| 2 | Failed to parse JSON message. | Received message is not a valid JSON object. The specifics of the failure are described by the error and offset properties of the rsp object. |
| 3 | mType missing in JSON message. | The received message does not contain $.mType property, and as such is not recognized, and cannot be handled. |
| 4 | Failed to validate JSON message contents. | The received message contents are not valid against the respective JSONSchema. The error property of the rsp object specifies schema validation. |
| 5 | Management queue is not initialized. | Management message queue is not active and cannot process incoming management messages. |
| 6 | Management queue is full. | Management queue is at capacity, and cannot process the new incoming message. |
| 7 | Network queue is not initialized. | Management message queue is not active and cannot process incoming management messages. |
| 8 | Network queue is full. | Management queue is at capacity, and cannot process the new incoming message. The capacity property of the rsp object specifies the queue capacity. |
| 9 | Unexpected auth message. | This response is sent if a client attempts to authenticate an already authenticated WebSocket session. |
IQRF Generic
Generic messages are able to handle any DPA packet. See the IQRF Standard section for status code details.
Raw iqrfRaw
| Schema | Example |
|---|---|
RawHdp iqrfRawHdp
| Schema | Example |
|---|---|
IQRF Standard
Standard messages have been designed according to IQRF Standard and DPA protocol.
Status codes
Status codes between 0 and 255 are based on the DPA framework, status codes from 32 to 63 are reserved for implementations of user peripherals. Asynchronous responses are marked by bit 7 set to 1. Negative status codes represent issues occurring during communication with the IQRF interfaces. For more details about each of the messages, click the DPA doc badge to view the corresponding DPA peripheral command page.
| Code | Message | Description |
|---|---|---|
| 0 | ok | Request has been handled successfully. |
| 1 | ERROR_FAIL | General failure code representing further unspecified issues. |
| 2 | ERROR_PCMD | The peripheral does not support the specified command. |
| 3 | ERROR_PNUM | The specified peripheral is not supported or the peripheral does not support the specified command. |
| 4 | ERROR_ADDR | Incorrect address parameter. The address may be out of range. |
| 5 | ERROR_DATA_LEN | The number of request data bytes is not correct for specified peripheral command. |
| 6 | ERROR_DATA | The request message data is not valid for the specified peripheral command. This usually translates to value being out of range of accepted values. |
| 7 | ERROR_HWPID | The specified HWPID does not correspond to an HWPID of the device. |
| 8 | ERROR_NADR | The specified node address does not corresponding to a bonded node. |
| 9 | ERROR_IFACE_CUSTOM_HANDLER | Data from interface consumed by Custom DPA Handler. |
| 10 | ERROR_MISSING_CUSTOM_DPA_HANDLER | Custom DPA handler is enabled in transciever configuration, but there is no handler loaded in the device. |
| 255 | STATUS_CONFIRMATION | This code is returned when only a confirmation is received, for example when a message is sent via broadcast. |
| -1 | ERROR_TIMEOUT | No response was received within timeout. |
| -8 | ERROR_IFACE_EXCLUSIVE_ACCESS | The request could not be handled due to exclusive access not being available. |
Binary output
Enumerate iqrfBinaryoutput_EnumerateIQRF Standard doc
| Schema | Example |
|---|---|
Set output iqrfBinaryoutput_SetOutputIQRF Standard doc
| Schema | Example |
|---|---|
Light
Set Voltage of lighting analog interface (LAI) iqrfLight_SetLaiIQRF Standard doc
| Schema | Example |
|---|---|
Send LDI commands and returns answers synchronously iqrfLight_SendLdiCommandsIQRF Standard doc
| Schema | Example |
|---|---|
Send LDI commands and returns answers asynchronously iqrfLight_SendLdiCommandsAsyncIQRF Standard doc
| Schema | Example |
|---|---|
Read Voltage of lighting analog interface (LAI) using FRC iqrfLight_FrcLaiReadIQRF Standard doc
| Schema | Example |
|---|---|
Execute LDI command using FRC iqrfLight_FrcLdiSendIQRF Standard doc
| Schema | Example |
|---|---|
Sensor
Enumerate iqrfSensor_EnumerateIQRF Standard doc
| Schema | Example |
|---|---|
Read sensors with types iqrfSensor_ReadSensorsWithTypesIQRF Standard doc
| Schema | Example |
|---|---|
FRC iqrfSensor_FrcIQRF Standard doc
| Schema | Example |
|---|---|
Embed Coordinator
Address information iqrfEmbedCoordinator_AddrInfoDPA doc
| Schema | Example |
|---|---|
Get discovered devices iqrfEmbedCoordinator_DiscoveredDevicesDPA doc
| Schema | Example |
|---|---|
Get bonded devices iqrfEmbedCoordinator_BondedDevicesDPA doc
| Schema | Example |
|---|---|
Clear all bonds iqrfEmbedCoordinator_ClearAllBondsDPA doc
| Schema | Example |
|---|---|
Bond node iqrfEmbedCoordinator_BondNodeDPA doc
| Schema | Example |
|---|---|
Remove bond iqrfEmbedCoordinator_RemoveBondDPA doc
| Schema | Example |
|---|---|
Discovery iqrfEmbedCoordinator_DiscoveryDPA doc
| Schema | Example |
|---|---|
Set DPA parameters iqrfEmbedCoordinator_SetDpaParamsDPA doc
| Schema | Example |
|---|---|
Set hops iqrfEmbedCoordinator_SetHopsDPA doc
| Schema | Example |
|---|---|
Backup iqrfEmbedCoordinator_BackupDPA doc
| Schema | Example |
|---|---|
Restore iqrfEmbedCoordinator_RestoreDPA doc
| Schema | Example |
|---|---|
Authorize bond iqrfEmbedCoordinator_AuthorizeBondDPA doc
| Schema | Example |
|---|---|
SmartConnect iqrfEmbedCoordinator_SmartConnectDPA doc
| Schema | Example |
|---|---|
Set MID iqrfEmbedCoordinator_SetMIDDPA doc
| Schema | Example |
|---|---|
Embed OS
Read iqrfEmbedOs_ReadDPA doc
| Schema | Example |
|---|---|
Batch iqrfEmbedOs_BatchDPA doc
| Schema | Example |
|---|---|
Selective batch iqrfEmbedOs_SelectiveBatchDPA doc
| Schema | Example |
|---|---|
Reset iqrfEmbedOs_ResetDPA doc
| Schema | Example |
|---|---|
Restart iqrfEmbedOs_RestartDPA doc
| Schema | Example |
|---|---|
Run RFPGM iqrfEmbedOs_RfpgmDPA doc
| Schema | Example |
|---|---|
Set security iqrfEmbedOs_SetSecurityDPA doc
| Schema | Example |
|---|---|
Sleep iqrfEmbedOs_SleepDPA doc
| Schema | Example |
|---|---|
Load code iqrfEmbedOs_LoadCodeDPA doc
| Schema | Example |
|---|---|
Read configuration iqrfEmbedOs_ReadCfgDPA doc
| Schema | Example |
|---|---|
Write configuration iqrfEmbedOs_WriteCfgDPA doc
| Schema | Example |
|---|---|
Write configuration byte iqrfEmbedOs_WriteCfgByteDPA doc
| Schema | Example |
|---|---|
Test RF signal iqrfEmbedOs_TestRfSignalDPA doc
| Schema | Example |
|---|---|
Factory settings iqrfEmbedOs_FactorySettingsDPA doc
| Schema | Example |
|---|---|
Indicate iqrfEmbedOs_IndicateDPA doc
| Schema | Example |
|---|---|
Embed SPI Removed in DPA v4.15.0
Write and read iqrfEmbedSpi_WriteReadDPA docRemoved in DPA v4.15.0
| Schema | Example |
|---|---|
IQMESH Network
Services that ease the task of working with IQMESH network.
They are composed of more than single DPA transaction (request-confirmation-response) in most of the cases, for that reason, the IQMESH services attempt to acquire exclusive access to DPA interface to ensure network consistency.
They are also integrating information from IQRF Repository.
They are inspired by the services available in IQRF IDE - IQMESH Network Manager.
Common status codes
The IQMESH service error codes are numbered from 1000. If no error has occurred, the response status code is 0. The following error codes are shared across all IQMESH services. Specific services may also have their own status codes.
| Code | Message | Description |
|---|---|---|
| 0 | -- | A request has been handled successfully. |
| 1000 | -- | A general, further unspecified error has occurred, see statusStr for details. |
| 1001 | -- | Request parameters are missing or are not valid. |
| 1002 | -- | Exclusive access could not be acquired. |
IQRF Network
Ping iqmeshNetwork_Ping
| Schema | Example |
|---|---|
Service-specific status codes
| Code | Message | Description |
|---|---|---|
| 1003 | -- | There are no nodes bonded in network. |
Restart iqmeshNetwork_Restart
| Schema | Example |
|---|---|
Service-specific status codes
| Code | Message | Description |
|---|---|---|
| 1003 | -- | There are no nodes bonded in network. |
IQRF Bonding
Bond node locally iqmeshNetwork_BondNodeLocal
| Schema | Example |
|---|---|
Service-specific status codes
| Code | Message | Description |
|---|---|---|
| 1003 | -- | Requested address is already assigned to another node. |
| 1004 | -- | No available free address to assign to a new node. |
SmartConnect iqmeshNetwork_SmartConnect
| Schema | Example |
|---|---|
Service-specific status codes
| Code | Message | Description |
|---|---|---|
| 1003 | -- | Requested address is already assigned to another node. |
| 1004 | -- | No available free address to assign to a new node. |
Remove bond iqmeshNetwork_RemoveBond
| Schema | Example |
|---|---|
Remove bond only from coordinator iqmeshNetwork_RemoveBondOnlyInC
| Schema | Example |
|---|---|
AutoNetwork iqmeshNetwork_AutoNetwork
| Schema | Example |
|---|---|
IQRF Enumeration
Enumerate device iqmeshNetwork_EnumerateDevice
| Schema | Example |
|---|---|
IQRF Configuration
Read TR configuration iqmeshNetwork_ReadTrConf
| Schema | Example |
|---|---|
Write TR configuration iqmeshNetwork_WriteTrConf
| Schema | Example |
|---|---|
IQRF DPA Parameters
DPA parameters iqmeshNetwork_DpaValue
| Schema | Example |
|---|---|
DPA hops iqmeshNetwork_DpaHops
| Schema | Example |
|---|---|
FRC parameters iqmeshNetwork_FrcParams
| Schema | Example |
|---|---|
IQRF Backup and Restore
Backup iqmeshNetwork_Backup
| Schema | Example |
|---|---|
Restore iqmeshNetwork_Restore
| Schema | Example |
|---|---|
Service-specific status codes
| Code | Message | Description |
|---|---|---|
| 1003 | -- | The restore function is not supported for node devices. |
| 1004 | -- | Incorrect backup data size. |
| 1005 | -- | Incorrect backup data checksum. |
IQRF Maintenance
FRC response time iqmeshNetwork_MaintenanceFrcResponseTime
| Schema | Example |
|---|---|
Service-specific status codes
| Code | Message | Description |
|---|---|---|
| 1003 | -- | There are no nodes bonded in network. |
| 1004 | -- | No network node responded to FRC request. |
| 1005 | -- | No network node handled FRC event. |
Test RF signal iqmeshNetwork_MaintenanceTestRF
| Schema | Example |
|---|---|
Service-specific status codes
| Code | Message | Description |
|---|---|---|
| 1003 | -- | There are no nodes bonded in network. |
Resolve duplicated addresses iqmeshNetwork_MaintenanceDuplicatedAddresses
| Schema | Example |
|---|---|
Service-specific status codes
| Code | Message | Description |
|---|---|---|
| 1003 | -- | There are no nodes bonded in network. |
Resolve inconsistent MIDs in Coordinator iqmeshNetwork_MaintenanceInconsistentMIDsInCoord
| Schema | Example |
|---|---|
Service-specific status codes
| Code | Message | Description |
|---|---|---|
| 1003 | -- | There are no nodes bonded in network. |
Resolve unused prebonded nodes iqmeshNetwork_MaintenanceUselessPrebondedNodes
| Schema | Example |
|---|---|
Service-specific status codes
| Code | Message | Description |
|---|---|---|
| 1003 | -- | There are no nodes bonded in network. |
IQRF Sensor Data New in v2.7.0
The sensor data service allows for periodic collecting of sensor measurement data and storing latest values in the database.
Service status codes
| Code | Message | Description |
|---|---|---|
| 0 | ok | Request has been handled successfully. |
| 1003 | -- | Sensor data reading worker is not running. |
| 1004 | -- | Sensor data reading is already in progress. |
| 1005 | -- | Unable to read or write worker configuration. |
Get configuration iqrfSensorData_GetConfig
| Schema | Example |
|---|---|
Set configuration iqrfSensorData_SetConfig
| Schema | Example |
|---|---|
Start worker iqrfSensorData_Start
| Schema | Example |
|---|---|
Stop worker iqrfSensorData_Stop
| Schema | Example |
|---|---|
Invoke worker iqrfSensorData_Invoke
| Schema | Example |
|---|---|
Worker status iqrfSensorData_Status
| Schema | Example |
|---|---|
Asynchronous report iqrfSensorData_ReportAsyncAsync
| Schema | Example |
|---|---|
Daemon Management
With the introduction management and network request queues, the following messages are available to pause and resume execution of network requests if necessary. For example, if there are multiple network requests queued up, the network queue can be paused to allow for management tasks to be performed, without losing network messages.
Common status codes
| Code | Message | Description |
|---|---|---|
| 0 | ok | Request has been handled successfully. |
| -1 | -- | The request failed, refer to the statusStr property for details of failure. |
Exit mngDaemon_Exit
| Schema | Example |
|---|---|
Mode mngDaemon_Mode
| Schema | Example |
|---|---|
Reload coordinator mngDaemon_ReloadCoordinator
| Schema | Example |
|---|---|
Update cache mngDaemon_UpdateCache
| Schema | Example |
|---|---|
Version mngDaemon_Version
| Schema | Example |
|---|---|
Start network queue mngDaemon_StartNetworkQueueNew in v2.7.0
Resumes network request queue.
| Schema | Example |
|---|---|
Stop network queue mngDaemon_StopNetworkQueueNew in v2.7.0
Pauses network request queue, if a network request is currently being processed, the queue is paused once the network request is finished.
| Schema | Example |
|---|---|
Daemon Database New in v2.7.0
API for network enumeration and querying database for network device data. This API replaces the Daemon Information API.
Common status codes
| Code | Message | Description |
|---|---|---|
| 0 | ok | Request has been handled successfully. |
| -1 | -- | The request failed, refer to the statusStr property for details of failure. |
Device enumeration iqrfDb_Enumerate
| Schema | Example |
|---|---|
Get device information iqrfDb_GetDevice
| Schema | Example |
|---|---|
Get information about multiple devices iqrfDb_GetDevices
| Schema | Example |
|---|---|
Get user-defined device metadata iqrfDb_GetDeviceMetadata
| Schema | Example |
|---|---|
Set user-defined device metadata iqrfDb_SetDeviceMetadata
| Schema | Example |
|---|---|
Get binary outputs iqrfDb_GetBinaryOutputs
| Schema | Example |
|---|---|
Get lights iqrfDb_GetLights
| Schema | Example |
|---|---|
Get sensors iqrfDb_GetSensors
| Schema | Example |
|---|---|
Get network topology iqrfDb_GetNetworkTopology
| Schema | Example |
|---|---|
Annotate responses with metadata iqrfDb_MetadataAnnotation
| Schema | Example |
|---|---|
Reset database iqrfDb_Reset
| Schema | Example |
|---|---|
Daemon Configuration
Common status codes
| Code | Message | Description |
|---|---|---|
| 0 | ok | Request has been handled successfully. |
| -1 | -- | The request failed, refer to the statusStr property for details of failure. |
Component cfgDaemon_Component
| Schema | Example |
|---|---|
Daemon Scheduler
Common status codes
| Code | Message | Description |
|---|---|---|
| 0 | ok | Request has been handled successfully. |
| -1 | -- | The request failed, refer to the statusStr property for details of failure. |
Add task mngScheduler_AddTask
| Schema | Example |
|---|---|
Edit task mngScheduler_EditTask
| Schema | Example |
|---|---|
Get task mngScheduler_GetTask
| Schema | Example |
|---|---|
List tasks mngScheduler_List
| Schema | Example |
|---|---|
Remove all tasks mngScheduler_RemoveAll
| Schema | Example |
|---|---|
Remove task mngScheduler_RemoveTask
| Schema | Example |
|---|---|
Start task mngScheduler_StartTask
| Schema | Example |
|---|---|
Stop task mngScheduler_StopTask
| Schema | Example |
|---|---|
Daemon Notification
Daemon state notifications related to interfaces, modes via WebSocket channel on port 1438.
Monitor ntfDaemon_Monitor
| Schema | Example |
|---|---|
Monitor invocation ntfDaemon_InvokeMonitor
| Schema | Example |
|---|---|