Open Edge Device Kit – Getting Started - Docker Version¶
Prerequisites to use the Open Edge Device Kit¶
The Open Edge Device Kit is a software component which can be run on a user device. The module is written in Java and can be executed on a Java friendly environment.
- 4 GB free disk space
- 1 GB RAM available
- 1 Core CPU, 600 MHz
- Linux-based operating system
- Root privileges
- Network settings must allow access to https://hub.docker.com
Installation Instructions¶
Setting up Docker and Docker Compose¶
-
Install Docker version 18 or higher and Docker Compose version 1.23 or higher from https://docs.docker.com/compose/install/. The following commands perform the installation on Debian-based operating systems:
Docker
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh sudo usermod -aG docker $USER
Docker-compose
apt install -y python python-pip pip install docker-compose
-
Change the execution rights for Docker Compose for all users with the following command:
sudo chmod +x /usr/local/bin/docker-compose
-
If you are behind a proxy, add the proxy information in the Docker file:
FROM openjdk:8u131-jre-alpine ENV HTTP_PROXY= http://{proxy_ip}:{proxy_port} RUN apk add --no-cache bash RUN mkdir -p /opt/siemens/ipc COPY ipc /opt/siemens/ipc CMD ./opt/siemens/ipc/bin/MindEdgeRuntimeSystem -c /opt/siemens/ipc/cfg/oedk_config.json
-
Restart the device.
Downloading the Open Edge Device Kit¶
Download the Open Edge Device Kit from the Siemens Industry Online Support (SIOS) Portal. Extract the tarball file with the option tar -xvf
.
The docker version consists of the following files:
- Config file for the Open Edge Device Kit:
{extract_path}/ipc/cfg/oedk_config.json
- Docker file:
{extract_path}/dockerfile
- Docker Compose file:
{extract_path}/docker-compose.yml
- Open Edge Device Kit executables
Changing the Settings (optional)¶
The Open Edge Device Kit uses a settings file when starting up, which is called oedk_config.json
and located in the ipc/cfg
directory.
Click here to display the standard settings file
{
"installation": {
"autoStart": 1,
"agentRoot": "/persistent_massdata/appData/"
},
"logging": {
"active_log_directory": "/persistent_massdata/log/",
"upload_log_directory": "/persistent_massdata/tmp/logsToUpload/",
"archived_log_directory": "/persistent_massdata/tmp/archive/",
"logLevel": "INFO",
"size_mb": 20,
"size_cap_mb": 200,
"log_history_days": 8,
"upload_cycle_sec": 120
},
"offlineCache": {
"directory": "offlineCache/",
"size": 500000000
},
"controllerInterface": {
"mqttPort": 1883,
"mqttHostname": "172.30.0.7"
},
"communication": {
"keyStorePath": "keyStore/"
},
"eventObserver": {
"initialDelay": 0,
"executionPeriod": 10
},
"notification": {
"notificationTimeout": 600
}
}
The following table lists the configuration parameters for the settings file. Parameters which are not listed in this table are recommended not to be changed.
Parameter | Default | Description |
---|---|---|
offlineCache > size (byte) | 500.000.000 | Maximum storage space for time series data while the device is offline. Recommended value: 100.000.000 – 2.000.000.000 |
controllerInterface > mqttPort | 1883 | Port of the MQTT broker |
controllerInterface > mqttHostname | Docker: "172.30.0.7” Script: "127.0.0.1" | IP address of the MQTT broker |
EventObserver > initialDelay (seconds) | 0 | Defines the intital delay before the Open Edge Device Kit starts polling for jobs from Insights Hub (e.g. configuration updates). Changing this value is not recommended. |
EventObserver > executionPeriod (seconds) | 10 | Defines the period for polling jobs (e.g. configuration updates) from Insights Hub. Values higher than 30 s can help reducing traffic, but cause delays in the execution of these jobs. Recommended values: 10 – 120 |
Notification > notificationTimeout (seconds) | 600 | Time out value for notifications, e.g. onboarding status. If operations take longer, they fail and a log message notification could not be processed is generated.The recommended value depends on the CPU: - Multi-core x86-x64 CPUs: 60 - Single core, low frequency or mobile CPUs: 600 – 1000 |
Logging > level | INFO | Log level for the Open Edge Device Kit. Enabling DEBUG will decrease the performance significantly.Recommended values: ERROR or INFO . |
Logging > sizeMB | 20 | Maximum file size for log files. Changing this value is not recommended. |
Logging > uploadCycleSec | 120 | Upload interval for sending log files to Insights Hub. Recommended value: 120 - 18000 |
Logging > size_cap_mb (MB) | 200 | Maximum storage space to be taken up by log files on the device. Recommended value: 200 |
Docker Compose file settings¶
By default MQTT Broker is opens port 1883 on the host machine. If you want to keep it under private network, ports
section under the broker
section should be removed. After removing the ports
section the MQTT Broker can only be reachable with the 172.30.0.7
IP.
version: '3.3'
#network for internal communicaton between containers
networks:
devicekit-subnet:
ipam:
config:
- subnet: 172.30.0.0/24
volumes:
massdata: {}
services:
broker:
container_name: Mqtt_Broker
image: "eclipse-mosquitto"
networks:
devicekit-subnet:
ipv4_address: 172.30.0.7
# Remove the following two lines if you don't want to expose broker to all network
ports:
- "1883:1883"
agent:
container_name: Device_Kit
stop_grace_period: 50s
build: .
networks:
devicekit-subnet:
ipv4_address: 172.30.0.8
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "./appconfigs:/appconfigs:rw"
- "massdata:/persistent_massdata:rw"
# oedk_config file shoud be configured with broker's ip address (e.g 172.30.0.7 in this configuration)
environment:
- agent_pass=/run/secrets/agent_pass
secrets:
- agent_pass
restart:
on-failure
depends_on:
- broker
secrets:
agent_pass:
file: ./rand.dat
Starting the Open Edge Device Kit¶
Run the following commands in the {extract_path}
directory:
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c20 > rand.dat
docker-compose build
docker-compose up (-d for running in the background)
This starts two docker containers, the Device_Kit
runs the Open Edge Device Kit and the Mqtt_Broker
runs Eclipse Mosquitto.
Eclipse Mosquitto Connection Information
The Eclipse Mosquitto broker is available at:
IP Address: 172.30.0.7
Port : 1883 (default port)
Except where otherwise noted, content on this site is licensed under the Development License Agreement.