Commit feac761f authored by Ivan Tyagov's avatar Ivan Tyagov Committed by Thomas Gambier

software/osie-coupler: Initial release of SR

parent a2272d7d
[instance-profile]
filename = instance.cfg.in
md5sum = fa8d1d0a44720e0ffa4f6a953b65eae4
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"description": "Parameters to instantiate coupler",
"type": "object",
"configuration": {
"coupler_block_device": {
"description": "The Linux block device using I2C protocol,",
"type": "string",
"default": "/dev/i2c-1"
},
"coupler_i2c_slave_list": {
"description": "The list of comma separated addresses of I2C enabled devices on the I2C bus.",
"type": "string",
"default": "0x58"
},
"opc_ua_port": {
"description": "The OPC UA server bind to bind to.",
"type": "integer",
"default": 4840
},
"mode": {
"description": "The operationg mode of the coupler. By default 0 - i.e. control for real I2C devices attached. If 1 selected emulate them (useful for testing). ",
"type": "integer",
"default": 0
},
"username": {
"description": "The username for OPC UA server.",
"type": "string",
"default": ""
},
"password": {
"description": "The password for OPC UA server.",
"type": "string",
"default": ""
},
"heart_beat": {
"description": "Indication if coupler should send heart beats over a keep-alive network.",
"type": "boolean",
"default": 0
},
"heart_beat_interval": {
"description": "The heart beat interval (in ms)",
"type": "integer",
"default": 500
},
"heart_beat_id_list": {
"description": "A comma separated list of couplers' IDs which should send to us keep-alive messages. ",
"type": "string",
"default": ""
},
"heart_beat_timeout_interval": {
"description": "The timeout (in ms) which when expired without a keep alive message will cause the coupler to go to a safe mode. ",
"type": "integer",
"default": 2000
}
}
}
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"description": "Values returned by coupler's instantiation.",
"additionalProperties": false,
"properties": {},
"type": "object"
}
#############################
#
# Deploy coupler instance
#
#############################
[buildout]
parts =
directory
publish-connection-parameter
coupler-opc-ua
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
extends = {{ template_monitor }}
[coupler-opc-ua]
recipe = slapos.cookbook:wrapper
environment =
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{{ open62541_location }}/lib:{{ mbedtls_location }}/lib
command-line =
{{ coupler_location }}/server -d ${instance-parameter:configuration.coupler_block_device} -s ${instance-parameter:configuration.coupler_i2c_slave_list} -p ${instance-parameter:configuration.opc_ua_port} -u ${instance-parameter:configuration.username} -w ${instance-parameter:configuration.password} -b ${instance-parameter:configuration.heart_beat} -t ${instance-parameter:configuration.heart_beat_interval} -l ${instance-parameter:configuration.heart_beat_id_list} -n ${instance-parameter:configuration.network_address_url_data_type} -o ${instance-parameter:configuration.heart_beat_timeout_interval} -i ${instance-parameter:configuration.id} -m ${instance-parameter:configuration.mode}
wrapper-path = ${directory:service}/coupler-opc-ua
[instance-parameter]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
configuration.coupler_block_device = /dev/i2c-1
configuration.coupler_i2c_slave_list = 0x58
configuration.mode = 0
configuration.username =
configuration.password =
configuration.interface = 0.0.0.0
configuration.opc_ua_port = 4840
configuration.id = 0
configuration.heart_beat = 0
configuration.heart_beat_interval = 500
configuration.heart_beat_id_list =
configuration.network_address_url_data_type = opc.udp://224.0.0.22:4840/
configuration.heart_beat_timeout_interval = 2000
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
script = ${:etc}/run/
service = ${:etc}/service
log = ${:var}/log
[publish-connection-parameter]
recipe = slapos.cookbook:publish
opc_ua_port = ${instance-parameter:configuration.opc_ua_port}
interface = ${instance-parameter:configuration.interface}
[buildout]
parts =
mbedtls
open62541
compile-coupler
slapos-cookbook
instance-profile
extends =
../../component/git/buildout.cfg
../../component/mbedtls/buildout.cfg
../../component/open62541/buildout.cfg
../../stack/monitor/buildout.cfg
../../stack/slapos.cfg
# we need to build mbedtls as a shared library
[mbedtls]
recipe = slapos.recipe.cmmi
configure-command = ${cmake:location}/bin/cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On -DCMAKE_INSTALL_PREFIX=
# we need open62541's sources even after compiling and linking in [open62541]
# section. Reasons is that coupler's C application depends on it.
[open62541-source]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = ${open62541:url}
md5sum = ${open62541:md5sum}
[open62541]
configure-options =
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=@@LOCATION@@
-DUA_ENABLE_PUBSUB=ON
-DUA_ENABLE_PUBSUB_MONITORING=ON
-DUA_ENABLE_PUBSUB_ETH_UADP=ON
-DUA_NAMESPACE_ZERO=REDUCED
-DUA_ENABLE_ENCRYPTION=MBEDTLS
-DUA_ENABLE_ENCRYPTION_MBEDTLS=ON
-DMBEDTLS_INCLUDE_DIRS=${mbedtls:location}/include
-DMBEDTLS_LIBRARY=${mbedtls:location}/lib/libmbedtls.so
-DMBEDX509_LIBRARY=${mbedtls:location}/lib/libmbedx509.so
-DMBEDCRYPTO_LIBRARY=${mbedtls:location}/lib/libmbedcrypto.so
-DUA_ENABLE_PUBSUB_INFORMATIONMODEL=ON
-DUA_ENABLE_PUBSUB_MQTT=ON
[osie-repository]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://lab.nexedi.com/nexedi/osie.git
revision = 524eff9cf3461983fb391eb6912d1a21585573a9
[compile-coupler]
recipe = slapos.recipe.cmmi
path = ${osie-repository:location}/coupler/opc-ua-server/
home = ${compile-coupler:path}/bin/
environment =
OPEN62541_HOME = ${open62541:location}
OPEN62541_SOURCE_HOME = ${open62541-source:location}
C_COMPILER_EXTRA_FLAGS = -L ${mbedtls:location}/lib -lmbedtls -lmbedx509 -lmbedcrypto -l:libopen62541.so -L${open62541:location}/lib -I${open62541:location}/include -I${open62541-source:location}/src/pubsub/ -I${open62541-source:location}/deps
configure-command = true
[instance-profile]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
mode = 0644
rendered = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
raw template_monitor ${monitor2-template:output}
key open62541_location open62541:location
key mbedtls_location mbedtls:location
key coupler_location compile-coupler:home
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment