Microsoft OPC Publisher
Перейти к файлу
Hans Gschossmann d52fc83e39 Add command line settings. 2017-08-22 14:33:06 +02:00
src Add command line settings. 2017-08-22 14:33:06 +02:00
.gitattributes Fix line endings (#23) 2017-03-13 10:15:07 +01:00
.gitignore reverted machine default store back to X509 and updated NuGet packages. 2017-08-03 13:58:12 +02:00
.travis.yml Updated Docker and Travis config files. 2017-06-30 23:16:10 -07:00
Dockerfile Add command line settings. 2017-08-22 14:33:06 +02:00
Dockerfile.Windows Update Windows docker file to new arch. 2017-07-04 12:29:09 +02:00
License.txt Create License.txt 2017-06-08 15:48:42 +02:00
README.md update readme. 2017-06-30 23:25:16 -07:00
appveyor.yml Fix CI files. 2017-04-20 13:15:27 +02:00

README.md

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments

OPC Publisher for Azure IoT Edge

This reference implementation demonstrates how Azure IoT Edge can be used to connect to existing OPC UA servers and publishes JSON encoded telemetry data from these servers in OPC UA "Pub/Sub" format (using a JSON payload) to Azure IoT Hub. All transport protocols supported by Azure IoT Edge can be used, i.e. HTTPS, AMQP and MQTT (the default).

This application, apart from including an OPC UA client for connecting to existing OPC UA servers you have on your network, also includes an OPC UA server on port 62222 that can be used to manage what gets published.

This application uses the OPC Foundations's OPC UA reference stack and therefore licensing restrictions apply. Visit http://opcfoundation.github.io/UA-.NETStandardLibrary/ for OPC UA documentation and licensing terms.

Branch Status
master Build status Build Status

Building the Application

This application requires the .NET Core SDK V1.1. You can build the application from Visual Studio 2017 by opening the solution file and hitting F7.

Configuring the Application

The OPC UA nodes whose values should be published to Azure IoT Hub can be configured by creating a "publishednodes.json" file. This file is auto-generated and persisted by the application automatically when using it's OPC UA server interface from a client. If you want to create the file manually instead, below is the format of the SAMPLE publishednodes.json file:

[
  {
    "EndpointUrl": "opc.tcp://myopcservername:51210/UA/SampleServer",
    "NodeId": { "Identifier": "ns=1;i=123" }
  }
  {
    "EndpointUrl": "opc.tcp:// myopcservername:51210/UA/SampleServer",
    "NodeId": { "Identifier": "ns=2;i=456" }
  }
]

The "Identifier" tag follows the string representation of an OPC UA node ID as described in the OPC UA specifications.

Running the Application

From Visual Studio 2017

You can run the app directly via Visual Studio 2017 by hitting F5. Don't forget your command line arguments, i.e. <yourApplicationName> (needs to be specified always) and the <IoTHubOwnerConnectionString> (needs to be specified on first run ONLY)!

From Docker

You can also run the application in a Docker container using the Dockerfile provided. From the root of the repo, in a console, type:

docker build -t gw .

On first run, for one-time IoT Hub registration:

docker run -it --rm gw <applicationName> <IoTHubOwnerConnectionString>

From then on:

docker run -it --rm gw <applicationName>

For detailed instructions on using Docker with the OPC Publisher, see here.