optiCLOUD Dashboard module "opticloud"
Description
The "opticloud" module provides an interface to the optiCLOUD dashboard. Both telemetry data and client attributes can be transferred from the measuring device to the dashboard. It is also possible to feed so-called shared attributes from the dashboard to the measuring device. It is also possible to communicate from the dashboard to the device via an RPC interface.
Interfaces & protocols used
- MQTT
JSON configuration
The following section describes the entire JSON configuration of the module and explains the individual parameters.
Example configuration (minimum)
The following is a minimal example configuration:
{
"module": "Opticloud",
"factory": "opticloud",
"config":{
"channels":[
{
"name": "*"
}
]
}
}
Example configuration (typical)
{
"module": "Opticloud",
"factory": "opticloud",
"config":{
"pollingIntervalMs":1000,
"channels":[
{
"name": "*",
"refreshIntervalMs":60000,
"minimumSendIntervalMs":0
}
]
}
}
Example configuration (maximum)
{
"module": "Opticloud",
"factory": "opticloud",
"config":{
"transmitBoolAsInt": false,
"connectTimeoutS": 10,
"disconnectTimeoutS": 10,
"keepaliveIntervalS": 10,
"completionIntervalS": 10,
"sendingIntervalS": 10,
"maxBufferedMessages": 10,
"channels":[
{
"name": "can*",
"messageType": "telemetry,clientAttribute",
"sendOnlyOnChange":true,
"refreshIntervalMs":60000,
"minimumSendIntervalMs":0,
"useTrueTimestamps":false
}
],
"splitGpsLocationChannels":[
{
"gpsLocationChannelName": "GPS.Location",
"gpsLatitudeChannelName": "GPS.Latitude",
"gpsLongitudeChannelName": "GPS.Longitude",
"gpsAltitudeChannelName": "GPS.Altitude"
}
],
"pollingIntervalMs":1000,
"sharedAttributes":[
{
"name": "dataFromDashboardChannel",
"type": "double",
"persistent":true,
"requestInitialValue":true,
"bufferSize":1024,
"physicalDimension": "temperature",
"physicalUnit": "K"
}
],
"brokerAddress": "ssl://dashboard.opticloud.io:8883",
"brokerUserId": "",
"brokerUserPassword": "",
"brokerAuthentication": true,
"trustStore": "/etc/ssl/certs/ca-certificates.crt",
"clientCertificate": "notImplementedYet"
}
}
The "splitGpsLocationChannels" JSON array only needs to be specified if GPS locations are actually transferred to the dashboard, e.g. from the GPS module, are actually transmitted to the dashboard AND the splitting of this data is to be freely configured. In this case, the split channels are automatically named as follows, either by
- Append ".Latitude", ".Longitude", ".Altitude" to the GPS location channel name, or
- Remove the ".Location" suffix and append ".Latitude", ".Longitude", ".Altitude" to the GPS location channel name if this suffix exists in the GPS location channel name.
Global swapping of device-specific parameters
The connection-specific parameters can be outsourced to the following global section of the static smartCORE configuration (smartcore.json), i.e:
"device_based":{
"instances":{
"opticloudInstance1":{
"brokerAddress": "ssl://awe.some.io:8883",
"brokerUserId": "",
"brokerUserPassword": "",
"brokerAuthentication": true,
"clientCertificate": "notImplementedYet"
}
}
},
These global parameters have priority over the module-specific configured parameters. This makes it easier to roll out the same new dynamic measurement configuration (smartcore_dynamic.json) to several devices.
(Global) connection-specific module parameters
| Parameter Name | Required | Data Type | Meaningful Value Range | Default | Description |
|---|---|---|---|---|---|
| brokerAddress | No | STRING | valid dashboard URL | "ssl://dashboard.opticloud.io:8883" , "tcp://awe.some.io:1883" (not recommended) | |
| brokerUserId | No | STRING | Serial number | Password of the device | |
| brokerUserPassword | No | STRING | "" | "" | Password of the dashboard server |
| brokerAuthentication | No | BOOL | true, false | true | Dashboard server authentication |
| trustStore | No | STRING | /etc/ssl/certs/ca-certificates.crt | Trust Store for dashboard server authentication | |
| clientCertificate | No | STRING BASE64 | valid certificate | certificate for device authentication (not supported) |
Module parameters
| Parameter name | Required | Data type | Meaningful value range | Default | Description |
|---|---|---|---|---|---|
| pollingIntervalMs | No | INT | 1000 - | 1000 | Module-related channel data acquisition interval [ms] |
| transmitBoolAsInt | No | BOOL | false, true | false | transmit Boolean values (false,true) as integers (0,1) |
| transmitStatusChannels | No | BOOL | false, true | false | Determines whether STATUS signals should be created and transmitted |
| connectTimeoutS | No | INT | 1 - | 10 | Timeout regarding connection establishment |
| disconnectTimeoutS | No | INT | 1 - | 10 | Timeout regarding disconnection after request |
| keepaliveIntervalS | No | INT | 1 - | 10 | Timeout regarding detection of a disconnected connection |
| completionIntervalS | No | INT | 1 - | 10 | Timeout regarding acknowledgement receipt after sending an MQTT message |
| sendingIntervalS | No | INT | 1 - | 10 | Timeout for sending an MQTT message |
| maxBufferedMessages | No | INT | 1 - | 10 | Maximum number of buffered MQTT messages within the MQTT client |
| channels | YES | JSON Array | see below | ||
| splitGpsLocations | optional for GPS channels | JSON array | see below | ||
| sharedAttributes | No | JSON Array | see below |
Channel configuration "channels"
The telemetry/client attribute channels transmitted to the dashboard are each configured as a JSON object with the following parameters
| Parameter Name | Required | Data Type | Meaningful Value Range | Default | Description |
|---|---|---|---|---|---|
| name | YES | STRING | valid channel name | channel name, simplified wildcards "*" and "?" are supported | |
| messageType | No | STRING | "telemetry", "clientAttribute" | "telemetry" | Type of transmission to the dashboard. "telemetry,clientAttribute" is also possible |
| sendOnlyOnChange | No | BOOL | true, false | true | Data reduction of unchanged channel values |
| refreshIntervalMs | No | INT | 1 - | 60000 (60 s) | Resend the same values after an interval has expired if their associated trusted timestamp has been updated |
| minimumSendIntervalMs | No | INT | 0 - | 0 (0 s) | Channel-related minimum transmission interval |
| useTrueTimestamps | No | BOOL | false, true | false | Transmission using the production timestamps, if set (otherwise timestamp of the processing cycle) |
Splitting the GPS location channels "splitGpsLocationChannels"
The GPS location channels must be split before being sent to the dashboard. The split can be defined in the form of a JSON object for each channel
| Parameter name | Required | Data type | Meaningful value range | Default | Description |
|---|---|---|---|---|---|
| gpsLocationChannelName | YES | STRING | valid GPS location channel name | input channel from the smartCORE | |
| gpsLatitudeChannelName | No | STRING | see above | Channel name for transmission of geo. Latitude to the dashboard | |
| gpsLongitudeChannelName | No | STRING | see above | Channel name for transmitting the geo. Longitude to the dashboard | |
| gpsAltitudeChannelName | No | STRING | see above | Channel name for transmitting the geo. Altitude above sea level to the dashboard |
Channel configuration "sharedAttributes"
Attributes created by the dashboard can be loaded onto the device via "sharedAttributes" and produced in corresponding channels. The configuration is carried out via the following JSON object for each channel.
| Parameter name | Required | Data type | Meaningful value range | Default | Description |
|---|---|---|---|---|---|
| name | YES | STRING | valid channel name | channel name | |
| type | YES | STRING | valid data type | "bool", "double", "float", "string", "[u]int8" | |
| persistent | no | BOOL | false, true | true | should the last value of the channel be persistent across a smartCORE restart |
| requestInitialValue | No | BOOL | false, true | true | additional reference to the sharedAttribute directly after the start of measurement operation |
| bufferSize | No | INT | 1 - | 1024 | Buffer size of the created channel |
| physicalDimension | No | STRING | Physical dimension | ||
| physicalUnit | No | STRING | Physical unit |
Module information
| Information | Value |
|---|---|
| Authors | optiMEAS Measurement and Automation Systems GmbH |
| since smartCORE | 0 |
| Module type | Consumer, (optional) Producer |
| Dependencies | optiCLOUD Dashboard |