This repository provides a containerized version of the Cumulocity IoT opcua-device-gateway Java based client customized to work with thin-edge.io out of the box. To configure the opcua-device gateway inside the container you can use environment variables.
This example shows a docker compose to be used in the tedge-demo-container (podman hence tcp://host.containers.internal). The device will be attached as a child device to thinEdge device. To prevent from id clashes the external id of the gateway will be combination of THINEDGE_DEVICEID:GATEWAY_IDENTIFIER
services:
gateway:
# Image is maintained under: https://github.com/thin-edge/opcua-device-gateway-container
image: ghcr.io/thin-edge/opcua-device-gateway:latest
container_name: opc-device-gateway
restart: always
environment:
# Use configuration from https://cumulocity.com/docs/device-integration/opcua/#gateway-configuration-and-registration
- GATEWAY_IDENTIFIER=OPCUAGateway
- GATEWAY_NAME=OPCUAGateway
- GATEWAY_THINEDGE_MQTTSERVERURL=tcp://host.containers.internal:1883
- GATEWAY_THINEDGE_USEFORDATAFORWARDING=true
- GATEWAY_THINEDGE_ENABLED=true
- GATEWAY_MAPPINGS_MERGECYCLICREAD=true
- GATEWAY_MONITORING_INTERVAL=3600000
volumes:
- opcua_data:/app/data
# Provide access to thin-edge.io configuration
- /etc/tedge:/etc/tedge
- /etc/tedge/device-certs:/etc/tedge/device-certs
networks:
- backend
volumes:
opcua_data:
networks:
backend:
name: backendExample to run the gateway standalone
services:
gateway:
# Image is maintained under: https://github.com/thin-edge/opcua-device-gateway-container
image: ghcr.io/thin-edge/opcua-device-gateway:latest
container_name: opc-device-gateway-standalone
restart: always
environment:
# Use configuration from https://cumulocity.com/docs/device-integration/opcua/#gateway-configuration-and-registration
- C8Y_BASEURL=https://example.eu-latest.cumulocity.com
- GATEWAY_IDENTIFIER=OPCUAGateway-standalone
- GATEWAY_NAME=OPCUAGateway-standalone
- GATEWAY_MONITORING_INTERVAL=3600000
volumes:
- opcua_data:/app/data
networks:
- backend
volumes:
opcua_data:
networks:
backend:
name: backendThere is no application.yaml for the gateway configuration included in the container. All config env parameters are converted like
gateway:
identifier: OPCUAGatewayTo
GATEWAY_IDENTIFIER=OPCUAGatewayThis project uses just to run tasks.
just release