You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2021. It is now read-only.
Open the OpcPublisher.sln project with Visual Studio 2017 and build the solution by hitting F7.
@@ -34,7 +34,7 @@ From the root of the repository, in a console, type:
34
34
35
35
The `-f` option for `docker build` is optional and the default is to use Dockerfile. Docker also support building directly from a git repository, which means you also can build a Linux container by:
The OPC UA nodes whose values should be published to Azure IoT Hub can be configured by creating a JSON formatted configuration file (defaultname: "publishednodes.json"). This file is updated and persisted by the application, when using it's OPC UA server methods "PublishNode" or "UnpublishNode".
@@ -71,9 +71,9 @@ The syntax of the configuration file is as follows:
71
71
]
72
72
},
73
73
74
-
// the format below is only supported for backward compatibility. you need to ensure that the
74
+
// the format below (NodeId format) is only supported for backward compatibility. you need to ensure that the
75
75
// OPC UA server on the configured EndpointUrl has the namespaceindex you expect with your configuration.
76
-
// please use the ExpandedNodeId syntax instead.
76
+
// please use the ExpandedNodeId format as in the examples above instead.
@@ -268,10 +268,10 @@ The following options are supported:
268
268
-h, --help show this message and exit
269
269
270
270
There are a couple of environment variables which can be used to control the application:
271
-
_HUB_CS: sets the IoTHub owner connectionstring
272
-
_GW_LOGP: sets the filename of the log file to use
273
-
_TPC_SP: sets the path to store certificates of trusted stations
274
-
_GW_PNFP: sets the filename of the publishing configuration file
271
+
*_HUB_CS: sets the IoTHub owner connectionstring
272
+
*_GW_LOGP: sets the filename of the log file to use
273
+
*_TPC_SP: sets the path to store certificates of trusted stations
274
+
*_GW_PNFP: sets the filename of the publishing configuration file
275
275
276
276
Command line arguments overrule environment variable settings.
277
277
@@ -303,18 +303,27 @@ The Publisher OPC UA server listens by default on port 62222. To expose this inb
303
303
docker run -p 62222:62222 microsoft/iot-edge-opc-publisher <applicationname> [<iothubconnectionstring>] [options]
304
304
305
305
### Enable intercontainer nameresolution
306
-
To enable name resolution from within the container to other containers, you need to create a user define docker bridge network and connect the container to this network using the `--network`option.
306
+
To enable name resolution from within the container to other containers, you need to create a user define docker bridge network and connect the container to this network using the `--network`option.
307
307
Additionally you need to assign the container a name using the `--name` option as in this example:
308
308
309
309
docker network create -d bridge iot_edge
310
310
docker run --network iot_edge --name publisher microsoft/iot-edge-opc-publisher <applicationname> [<iothubconnectionstring>] [options]
311
311
312
312
The container can now be reached by other containers via the name `publisher`over the network.
313
313
314
+
### Access other systems from within the container
315
+
Other containers, can be reached using the parameters described in the "Enable intercontainer nameresolution" paragraph.
316
+
If operating system on which docker is hosted is DNS enabled, then accessing all systems which are known by DNS will work..
317
+
A problems occurs in a network which does use NetBIOS name resolution. To enable access to other systems (including the one on which docker is hosted) you need to start your container using the `--add-host` option,
318
+
which effectevly is adding an entry to the containers host file.
319
+
320
+
docker run --add-host mydevbox:192.168.178.23 microsoft/iot-edge-opc-publisher <applicationname> [<iothubconnectionstring>] [options]
321
+
314
322
### Assigning a hostname
315
323
Publisher uses the hostname of the machine is running on for certificate and endpoint generation. docker chooses a random hostname if there is none set by the `-h` option. Here an example to set the internal hostname of the container to `publisher`:
316
324
317
325
docker run -h publisher microsoft/iot-edge-opc-publisher <applicationname> [<iothubconnectionstring>] [options]
326
+
318
327
### Using bind mounts (shared filesystem)
319
328
In certain use cases it may make sense to read configuration information from or write log files to locations on the host and not keep them in the container file system only. To achieve this you need to use the `-v` option of `docker run` in the bind mount mode.
320
329
@@ -327,6 +336,8 @@ Storing X509 certificates does not work with bind mounts, since the permissions
327
336
328
337
Open the OpcPublisher.sln project with Visual Studio 2017 and start debugging the app by hitting F5.
329
338
339
+
If you need to access the OPC UA server in the publisher, you should ensure that the firewall setting allow access to the port the server is listening on (default: 62222).
340
+
330
341
## In a docker container
331
342
332
343
Visual Studio 2017 supports debugging of application in docker container. This is done by using docker-compose. Since this does not allow to pass command line parameters it is not convenient.
0 commit comments