Skip to main content

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 NameRequiredData TypeMeaningful Value RangeDefaultDescription
brokerAddressNoSTRINGvalid dashboard URL"ssl://dashboard.opticloud.io:8883" , "tcp://awe.some.io:1883" (not recommended)
brokerUserIdNoSTRINGSerial numberPassword of the device
brokerUserPasswordNoSTRING""""Password of the dashboard server
brokerAuthenticationNoBOOLtrue, falsetrueDashboard server authentication
trustStoreNoSTRING/etc/ssl/certs/ca-certificates.crtTrust Store for dashboard server authentication
clientCertificateNoSTRING BASE64valid certificatecertificate for device authentication (not supported)

Module parameters

Parameter nameRequiredData typeMeaningful value rangeDefaultDescription
pollingIntervalMsNoINT1000 -1000Module-related channel data acquisition interval [ms]
transmitBoolAsIntNoBOOLfalse, truefalsetransmit Boolean values (false,true) as integers (0,1)
transmitStatusChannelsNoBOOLfalse, truefalseDetermines whether STATUS signals should be created and transmitted
connectTimeoutSNoINT1 -10Timeout regarding connection establishment
disconnectTimeoutSNoINT1 -10Timeout regarding disconnection after request
keepaliveIntervalSNoINT1 -10Timeout regarding detection of a disconnected connection
completionIntervalSNoINT1 -10Timeout regarding acknowledgement receipt after sending an MQTT message
sendingIntervalSNoINT1 -10Timeout for sending an MQTT message
maxBufferedMessagesNoINT1 -10Maximum number of buffered MQTT messages within the MQTT client
channelsYESJSON Arraysee below
splitGpsLocationsoptional for GPS channelsJSON arraysee below
sharedAttributesNoJSON Arraysee 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 NameRequiredData TypeMeaningful Value RangeDefaultDescription
nameYESSTRINGvalid channel namechannel name, simplified wildcards "*" and "?" are supported
messageTypeNoSTRING"telemetry", "clientAttribute""telemetry"Type of transmission to the dashboard. "telemetry,clientAttribute" is also possible
sendOnlyOnChangeNoBOOLtrue, falsetrueData reduction of unchanged channel values
refreshIntervalMsNoINT1 -60000 (60 s)Resend the same values after an interval has expired if their associated trusted timestamp has been updated
minimumSendIntervalMsNoINT0 -0 (0 s)Channel-related minimum transmission interval
useTrueTimestampsNoBOOLfalse, truefalseTransmission 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 nameRequiredData typeMeaningful value rangeDefaultDescription
gpsLocationChannelNameYESSTRINGvalid GPS location channel nameinput channel from the smartCORE
gpsLatitudeChannelNameNoSTRINGsee aboveChannel name for transmission of geo. Latitude to the dashboard
gpsLongitudeChannelNameNoSTRINGsee aboveChannel name for transmitting the geo. Longitude to the dashboard
gpsAltitudeChannelNameNoSTRINGsee aboveChannel 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 nameRequiredData typeMeaningful value rangeDefaultDescription
nameYESSTRINGvalid channel namechannel name
typeYESSTRINGvalid data type"bool", "double", "float", "string", "[u]int8"
persistentnoBOOLfalse, truetrueshould the last value of the channel be persistent across a smartCORE restart
requestInitialValueNoBOOLfalse, truetrueadditional reference to the sharedAttribute directly after the start of measurement operation
bufferSizeNoINT1 -1024Buffer size of the created channel
physicalDimensionNoSTRINGPhysical dimension
physicalUnitNoSTRINGPhysical unit

Module information

InformationValue
AuthorsoptiMEAS Measurement and Automation Systems GmbH
since smartCORE0
Module typeConsumer, (optional) Producer
DependenciesoptiCLOUD Dashboard