Standalone OPC-Proxy, runs a configurable opc-proxy with GRPC, InfluxDB and Kafka registered endpoint.
Full Docs at opc-proxy.readthedocs.io
Requirements:
- Install .NET Core >= 3.1 (all three library: .NET core SDK, .NET core Runtime, ASP .NET core runtime.)
- A test OPC-server, we suggest the Python-OPCUA or the Node-OPCUA if you are familiar with NodeJS.
The .NET dependencies are not needed if you run it with Docker.
Start your OPC-test server first, the following works for Python minimal server example.
docker pull openscada/opc-proxy
mkdir local_config # host dir to share configs
wget -O local_config/proxy_config.json https://raw.githubusercontent.com/opc-proxy/opcProxy-Standalone/master/proxy_config.json
cd local_config
OPC_LOCAL_CONF=$(pwd)
docker create --name proxy_test --network="host" -v ${OPC_LOCAL_CONF}:/app/configs openscada/opc-proxy
docker start -i proxy_test
Start your OPC-test server first, the following works for Python minimal server example.
git clone git@github.com:opc-proxy/opcProxy-Standalone.git
cd opcProxy-Standalone/
dotnet build
dotnet run
Create a config file named proxy_config.json
:
/* proxy_config.json */
{
"opcServerURL":"opc.tcp://localhost:4840/freeopcua/server/",
"loggerConfig" :{
"loglevel" :"debug"
},
"nodesLoader" : {
"targetIdentifier" : "browseName",
"whiteList":["MyVariable"]
}
"grpcConnector" : false,
"influxConnector" : false,
"kafkaConnector": false
}
This will tell the OPC-Proxy that:
- Needs to connect to an OPC server at the specified URL, the config is for the Python minimal server example, if you are using another test server you need to update that line.
- The nodesLoader here will match against a whitelist all nodes of the server, it will look for a Node with
BrowseName
attribute equals toMyVariable
, which is default for our test server. - The log level is set to
DEBUG
, so that we will see the output of the variable changing. - All connectors are set to
false
, meaning that this proxy will only connect to the opc-server and nothing more.
dotnet publish -c Release -r linux-musl-x64 --self-contained true
docker build -t openscada/opc-proxy -f Dockerfile .
# create a directory, the config file must be named "proxy_config.json"
docker create --name foo -v absolute_path_to_config_dir:/app/configs --network="host" openscada/opc-proxy
docker start -i foo
docker push openscada/opc-proxy:latest