GithubHelp home page GithubHelp logo

azure / industrial-iot Goto Github PK

View Code? Open in Web Editor NEW
520.0 56.0 215.0 72.79 MB

Azure Industrial IoT Platform

License: MIT License

Batchfile 0.12% Shell 0.08% C# 98.17% PowerShell 1.63%
opc-ua iot industrial-iot dotnet azure iot-edge edge azure-kubernetes-services

industrial-iot's Introduction

Microsoft OPC Publisher and Azure Industrial IoT Platform

License: MIT Build Status

Discover, register and manage your OPC UA enabled Assets with Azure

Microsoft OPC Publisher and the optional Azure Industrial IoT Platform companion web service allow you to discover and operate OPC UA enabled industrial assets.

With OPC Publisher you can harness the power of OPC UA and Azure IoT. OPC Publisher is a fully compliant OPC UA PubSub telemetry publisher (supporting JSON, JSON+Gzip, and UADP binary encoding) and provides a large subset of the OPC UA services through its control plane. OPC Publisher is an Azure IoT Edge module that runs on on-premises. OPC Publisher API can be accessed via HTTP(s) (Preview), an MQTT Broker (Preview) or through Azure IoT Hub device methods.

The companion cloud service provided in this repository (Preview) with REST interface runs inside Azure App Service and provides a cloud side REST API to command the OPC Publisher at the edge. An easy-to-use deployment script guides you step-by-step through deploying the web service and its dependencies, as well as an optional simulation environment in Azure.

Microsoft provides pre-built Docker containers in the Microsoft Container Registry (MCR) for OPC Publisher and the other tools included in this repository.

Get started

Get support

Please report any security related issues by following our security process.

If you are an Azure customer, please create an Azure Support Request. More information can be found here. (Azure Support SLA applies).

Otherwise, please report bugs, feature requests, or suggestions as GitHub issues (No SLA available).

Supported releases and support policy

Our releases are tagged following semantic versioning (“semver”) conventions. Minor and patch releases do not break backwards compatibility. Releases not shown in the table (e.g., 2.4.x, 2.5.x, 2.6.x, or 2.7.x) are out of support already.

Release (tag) Last release (tag) End of support Successor (tag) Update instructions
Industrial IoT 2.8 2.8.6 7/15/2023 OPC Publisher 2.9 Migration Path
OPC Publisher 2.8 2.8.7 12/15/2023 OPC Publisher 2.9 N/A
OPC Publisher 2.9 2.9.10 11/10/2026 TBA Migration Path

We only support the latest patch version of a release which per semantic versioning convention is identified by the 3rd part of the version string. Preview releases, preview and experimental features are only supported through GitHub issues.

If you are using a container image with a major.minor version tag that is supported per above table, but a patch version lower than the latest patch version, you need to update your images to the latest version to ensure secure operation and take advantage of the latest fixes. If you unexpectedly encounter bugs and require help, please ensure you are running the latest patch release as we might already have addressed the issue you are seeing. If you are not, please update first and try to reproduce the issue on the latest patch version.

Security-critical updates are made to the last patch version of the major.minor release containing the vulnerability. Bug fixes that are not security related are made only to the main branch and to the last supported release. The version the fix will be in can be found in the version.json file of the respective branch.

Our official Microsoft support and any related SLA only covers officially released docker containers obtained from MCR (Microsoft Container Registry) and deployed to Azure in Azure App Services (Web API container) or IoT Edge (OPC Publisher module container) using the documentation and deployment scripts provided as part of the latest release. Experimental and Preview features are excluded. Also, all Azure services deployed, the installed IoT Edge runtime, as well as Operating System and other middleware and combinations thereof must be officially supported as per their published support policy and SLA.

In all other cases, support is provided on a best effort basis through GitHub issues. We aim to release patch releases on a regular cadence (approximately every 1-2 months), so if you are blocked, and you can suggest or contribute fixes, the chances of getting it into the next patch release are high.

Contribute

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

If you want/plan to contribute, we ask you to sign a CLA (Contribution License Agreement) and follow the project 's code submission guidelines. A friendly bot will remind you about it when you submit a pull-request.

License

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.

industrial-iot's People

Contributors

bamajeed avatar barnstee avatar chencheng368 avatar cindyxing avatar cristipogacean avatar dacolgit avatar dependabot[bot] avatar dimtix avatar haeavar avatar hansgschossmann avatar jehona-m avatar jmayrbaeurl avatar karok2m avatar katriendg avatar koepalex avatar luiscantero avatar maalliet avatar maidab avatar marcschier avatar markusstuhler avatar microsoftopensource avatar monikavar avatar mregen avatar msftgits avatar prmathur-microsoft avatar quality-leftovers avatar saramonteiro avatar sebader avatar williamberryiii avatar zkaiser-ff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

industrial-iot's Issues

Configuration of the published nodes by browse path

Is there planned a feature to configure the published nodes in the publishednodes.json by browse path? This would give me the ability to program against type definitions. Especially I have to deal with servers which information models are based on a companion specification. In my case for instance I have two servers which are based on the same companion specification. There are nodes with the same browse paths which have different node ids because the servers were implemented from different vendors. To keep the effort for configuration low my idea was to configure the publisher by browse paths. An other advantage would be that I don't need a running server for configuring the publisher because the node ids would be determined at runtime from the publisher itself, see OPC UA Part 4 Chapter 5.8.4.

Cannot show endpoint when using linux image

Hi,

I used the latest source code on master branch to build opc twin module today.

I used the dockerFile in Industrial-IoT/modules/opc-twin/docker/Linux/amd64/to build the linux image and running in IoT edge on Ubuntu OS.

But there are some error while scanning the network.
It show the error log as below in OPC twin log.

[08:17:12 ERR] (Error) Channel 76685: ProcessErrorMessage(BadNotFound 'Error received from remote host: ')

But it still shows the result uploaded.
linux_log

But after that, when I click the endpoint button to see the endpoint. there are no any endpoint in the endpoint table, like picture below.
linux_screen

I've tried the image which build at last week in develop branch, but the same error not happened, it works fine with that version.

Thank you.

opc publisher 2.4.1 leaves entries in node configuration file after unpublishing all nodes

Hello,

when unpublishing all nodes or a list of nodes that will finally result in no results being published, the opcpublishednodes.json still contains one entry.

This is the log snippet:
2019-07-26 17:26:35.830 +02:00 [DBG] HandleUnpublishNodesMethodAsync: called
2019-07-26 17:26:35.832 +02:00 [INF] HandleUnpublishNodesMethodAsync: Request to stop monitoring item with NodeId 'ns=5;s=PumpStatus1')
2019-07-26 17:26:35.834 +02:00 [INF] RequestMonitorItemRemoval: Node with id 'ns=5;s=PumpStatus1' tagged to stop monitoring.
2019-07-26 17:26:35.835 +02:00 [DBG] HandleUnpublishNodesMethodAsync: Id 'ns=5;s=PumpStatus1': tagged for removal
2019-07-26 17:26:35.837 +02:00 [INF] HandleUnpublishNodesMethodAsync: Request to stop monitoring item with NodeId 'ns=5;s=Temperature')
2019-07-26 17:26:35.839 +02:00 [INF] RequestMonitorItemRemoval: Node with id 'ns=5;s=Temperature' tagged to stop monitoring.
2019-07-26 17:26:35.840 +02:00 [DBG] HandleUnpublishNodesMethodAsync: Id 'ns=5;s=Temperature': tagged for removal
2019-07-26 17:26:35.840 +02:00 [INF] Remove nodes in subscription with id 19 on endpoint 'opc.tcp://xxx'
2019-07-26 17:26:35.841 +02:00 [INF] HandleUnpublishNodesMethodAsync: Request to stop monitoring item with NodeId 'ns=5;s=VentilationLevel1')
2019-07-26 17:26:35.842 +02:00 [INF] There are now 1 monitored items in this subscription.
2019-07-26 17:26:35.844 +02:00 [INF] There are now 1 items managed by publisher for this subscription. (version: 00000009)
2019-07-26 17:26:35.845 +02:00 [INF] RequestMonitorItemRemoval: Node with id 'ns=5;s=VentilationLevel1' tagged to stop monitoring.
2019-07-26 17:26:35.847 +02:00 [DBG] HandleUnpublishNodesMethodAsync: Id 'ns=5;s=VentilationLevel1': tagged for removal
2019-07-26 17:26:35.848 +02:00 [INF] HandleUnpublishNodesMethodAsync: completed with result OK
2019-07-26 17:26:35.858 +02:00 [INF] Remove nodes in subscription with id 19 on endpoint 'opc.tcp://xxx'
2019-07-26 17:26:35.861 +02:00 [INF] There are now 0 monitored items in this subscription.
2019-07-26 17:26:35.862 +02:00 [INF] There are now 0 items managed by publisher for this subscription. (version: 0000000A)
2019-07-26 17:26:35.863 +02:00 [INF] Remove unused subscriptions on endpoint 'opc.tcp://xxx'.
2019-07-26 17:26:35.872 +02:00 [INF] There are now 0 subscriptions in this session.
2019-07-26 17:26:35.873 +02:00 [DBG] OPC: EXCEPTION BadNoSubscription
2019-07-26 17:26:35.874 +02:00 [INF] Remove unused session on endpoint 'opc.tcp://xxx'.
2019-07-26 17:26:35.877 +02:00 [INF] Removing 0 subscriptions from session.
2019-07-26 17:26:35.878 +02:00 [INF] Closing session to endpoint URI 'opc.tcp://sba020163.sgr.com:53530/OPCUA/SimulationServer' closed successfully.
2019-07-26 17:26:35.899 +02:00 [INF] Session to endpoint URI 'opc.tcp://xxx' closed successfully.

But publishednodes.json still has one entry left for the corresponding endpointUrl. It is the last one that has been removed.

best regards
Hartmut

OPC Publisher won't send messages again after a lost connection

Hello,

I'm currently having an issue with OPC Publisher. If for any reason the connection is lost between OPC Publisher and a OPC Server, it will attempt to reconnect (and seems to do so successfully), but then OPC Publisher won't receive node updates anymore and won't send anything back to IoT Hub.

Here's the diagnostic:

`5/5/2018

00:15:32.470 ==========================================================================
5/5/2018 00:16:32.479 ==========================================================================
5/5/2018 00:16:32.482 OpcPublisher status @ 5/5/2018 5:16:32 AM (started @ 5/4/2018 8:02:08 PM)
5/5/2018 00:16:32.484 ---------------------------------
5/5/2018 00:16:32.486 OPC sessions: 2
5/5/2018 00:16:32.487 connected OPC sessions: 2
5/5/2018 00:16:32.489 connected OPC subscriptions: 2
5/5/2018 00:16:32.490 OPC monitored items: 4466
5/5/2018 00:16:32.492 ---------------------------------
5/5/2018 00:16:32.494 monitored items queue bounded capacity: 8192
5/5/2018 00:16:32.495 monitored items queue current items: 0
5/5/2018 00:16:32.497 monitored item notifications enqueued: 83489
5/5/2018 00:16:32.499 monitored item notifications enqueue failure: 0
5/5/2018 00:16:32.500 monitored item notifications dequeued: 83489
5/5/2018 00:16:32.502 ---------------------------------
5/5/2018 00:16:32.503 messages sent to IoTHub: 4978
5/5/2018 00:16:32.504 last successful msg sent @: 5/5/2018 4:22:28 AM
5/5/2018 00:16:32.506 bytes sent to IoTHub: 19684740
5/5/2018 00:16:32.507 avg msg size: 3954
5/5/2018 00:16:32.509 msg send failures: 0
5/5/2018 00:16:32.511 messages too large to sent to IoTHub: 0
5/5/2018 00:16:32.512 times we missed send interval: 167
5/5/2018 00:16:32.514 ---------------------------------
5/5/2018 00:16:32.516 current working set in MB: 89
5/5/2018 00:16:32.518 --si setting: 5
5/5/2018 00:16:32.519 --ms setting: 262144
5/5/2018 00:16:32.521 --ih setting: Amqp_Tcp_Only
5/5/2018 00:16:32.523 ==========================================================================
5/5/2018 00:16:54.241 SECURE CHANNEL RENEWED [.NetStandard ServerChannel UA-TCP 1.03.351UA-TCP 1.03.351] [ID=5]
5/5/2018 00:17:25.580 Session endpoint: opc.tcp://x.x.x.x:4096/iaopcua/Basic128Rsa15 has Status: BadNoCommunication 'Server not responding to keep alive requests.'
5/5/2018 00:17:25.580 Session endpoint: opc.tcp://x.x.x.x:49320/ has Status: BadNoCommunication 'Server not responding to keep alive requests.'
5/5/2018 00:17:25.604 Session endpoint: opc.tcp://x.x.x.x:49320/ has Status: BadNoCommunication 'Server not responding to keep alive requests.'
5/5/2018 00:17:25.618 Session endpoint: opc.tcp://x.x.x.x:49320/ has Status: BadNoCommunication 'Server not responding to keep alive requests.'
5/5/2018 00:17:25.622 Session endpoint: opc.tcp://x.x.x.x:4096/iaopcua/Basic128Rsa15 has Status: BadNoCommunication 'Server not responding to keep alive requests.'
5/5/2018 00:17:25.703 EXCEPTION BadNoSubscription
5/5/2018 00:17:25.998 Outstanding requests: 0, Defunct requests: 0
5/5/2018 00:17:26.041 Outstanding requests: 0, Defunct requests: 0
5/5/2018 00:17:26.055 Outstanding requests: 0, Defunct requests: 0
5/5/2018 00:17:26.080 Outstanding requests: 0, Defunct requests: 0
5/5/2018 00:17:26.103 Outstanding requests: 0, Defunct requests: 0
5/5/2018 00:17:26.124 Good publish requests: 0, KeepAlive interval: 2000
5/5/2018 00:17:26.141 Good publish requests: 0, KeepAlive interval: 2000
5/5/2018 00:17:26.157 Good publish requests: 0, KeepAlive interval: 2000
5/5/2018 00:17:26.167 Good publish requests: 0, KeepAlive interval: 2000
5/5/2018 00:17:26.213 SessionId: ns=1;g=bc5cf924-1457-4cc2-b0b2-45f314acfde4
5/5/2018 00:17:26.181 Good publish requests: 0, KeepAlive interval: 2000
5/5/2018 00:17:26.224 SessionId: ns=1;i=3
5/5/2018 00:17:26.228 Missed KeepAlives: 1
5/5/2018 00:17:26.204 SessionId: ns=1;g=bc5cf924-1457-4cc2-b0b2-45f314acfde4
5/5/2018 00:17:26.190 SessionId: ns=1;i=3
5/5/2018 00:17:26.203 SessionId: ns=1;g=bc5cf924-1457-4cc2-b0b2-45f314acfde4
5/5/2018 00:17:26.220 Missed KeepAlives: 1
5/5/2018 00:17:26.241 Session endpoint: opc.tcp://10.4.13.63:4096/iaopcua/Basic128Rsa15 got a keep alive after 1 was missed.
5/5/2018 00:17:26.248 Missed KeepAlives: 2
5/5/2018 00:17:26.257 Missed KeepAlives: 2
5/5/2018 00:17:26.277 Session endpoint: opc.tcp://x.x.x.x:49320/ got a keep alive after 3 were missed.
5/5/2018 00:17:26.294 Session endpoint: opc.tcp://x.x.x.x:49320/ got a keep alive after 3 were missed.
5/5/2018 00:17:26.267 Missed KeepAlives: 3
5/5/2018 00:17:26.293 EXCEPTION BadNoSubscription
5/5/2018 00:17:32.513 ==========================================================================
5/5/2018 00:17:32.517 OpcPublisher status @ 5/5/2018 5:17:32 AM (started @ 5/4/2018 8:02:08 PM)
5/5/2018 00:17:32.518 ---------------------------------
5/5/2018 00:17:32.520 OPC sessions: 2
5/5/2018 00:17:32.521 connected OPC sessions: 2
5/5/2018 00:17:32.523 connected OPC subscriptions: 2
5/5/2018 00:17:32.525 OPC monitored items: 4466
5/5/2018 00:17:32.526 ---------------------------------
5/5/2018 00:17:32.528 monitored items queue bounded capacity: 8192
5/5/2018 00:17:32.530 monitored items queue current items: 0
5/5/2018 00:17:32.531 monitored item notifications enqueued: 83489
5/5/2018 00:17:32.533 monitored item notifications enqueue failure: 0
5/5/2018 00:17:32.534 monitored item notifications dequeued: 83489
5/5/2018 00:17:32.536 ---------------------------------
5/5/2018 00:17:32.537 messages sent to IoTHub: 4978
5/5/2018 00:17:32.540 last successful msg sent @: 5/5/2018 4:22:28 AM
5/5/2018 00:17:32.542 bytes sent to IoTHub: 19684740
5/5/2018 00:17:32.544 avg msg size: 3954
5/5/2018 00:17:32.545 msg send failures: 0
5/5/2018 00:17:32.547 messages too large to sent to IoTHub: 0
5/5/2018 00:17:32.549 times we missed send interval: 168
5/5/2018 00:17:32.550 ---------------------------------
5/5/2018 00:17:32.553 current working set in MB: 89
5/5/2018 00:17:32.555 --si setting: 5
5/5/2018 00:17:32.557 --ms setting: 262144
5/5/2018 00:17:32.559 --ih setting: Amqp_Tcp_Only
5/5/2018 00:17:32.560 ==========================================================================
5/5/2018 00:18:32.569 ==========================================================================
5/5/2018 00:18:32.576 OpcPublisher status @ 5/5/2018 5:18:32 AM (started @ 5/4/2018 8:02:08 PM)
5/5/2018 00:18:32.578 ---------------------------------
5/5/2018 00:18:32.580 OPC sessions: 2
5/5/2018 00:18:32.582 connected OPC sessions: 2
5/5/2018 00:18:32.584 connected OPC subscriptions: 2
5/5/2018 00:18:32.586 OPC monitored items: 4466
5/5/2018 00:18:32.588 ---------------------------------
5/5/2018 00:18:32.589 monitored items queue bounded capacity: 8192
5/5/2018 00:18:32.591 monitored items queue current items: 0
5/5/2018 00:18:32.593 monitored item notifications enqueued: 83489
5/5/2018 00:18:32.595 monitored item notifications enqueue failure: 0
5/5/2018 00:18:32.596 monitored item notifications dequeued: 83489
5/5/2018 00:18:32.598 ---------------------------------
5/5/2018 00:18:32.599 messages sent to IoTHub: 4978
5/5/2018 00:18:32.601 last successful msg sent @: 5/5/2018 4:22:28 AM
5/5/2018 00:18:32.603 bytes sent to IoTHub: 19684740
5/5/2018 00:18:32.604 avg msg size: 3954
5/5/2018 00:18:32.606 msg send failures: 0
5/5/2018 00:18:32.607 messages too large to sent to IoTHub: 0
5/5/2018 00:18:32.609 times we missed send interval: 168
5/5/2018 00:18:32.611 ---------------------------------
5/5/2018 00:18:32.613 current working set in MB: 90
5/5/2018 00:18:32.615 --si setting: 5
5/5/2018 00:18:32.617 --ms setting: 262144
5/5/2018 00:18:32.619 --ih setting: Amqp_Tcp_Only
5/5/2018 00:18:32.621 ==========================================================================`

I'm not entirely sure what's going on, it seems to get back the keepalive messages after a connection was dropped, 5 being the max amount of keepalive to send before the session is disconnected. Any idea what might be causing this issue?

Thanks!

Add information coming from other OPC nodes in the message sent to Edge

We would like to use one OPC publisher for multiple OPC servers. This means that we need a way to know from which OPC server (running on a physical machine) the message was coming from.

We would like to use a node that is published by the OPC server that contains a "serial number" unique to the machine. This means that, instead of just sending the value in the message like the publisher is doing now, we'd like to send another information, coming from another OPC node.

Is this possible in the current version of the publisher? Is it something that would be interesting to be added as a parameter?

Error during publisher discovery and module execution.

Hi,

I'm running IoT Edge on Windows 10 IoT Enterprise (Windows container) with OPC Twin (ver. 2.0.1) and OPC Publisher modules deployed. And I found two exception regarding to OPC Twin. Here's the detailed information of the exception. It seems like OPC twin module cannot connect to OPC Publisher:

[02:57:21 ERR] Error during publisher discovery. & [03:02:18 ERR] Error during module execution - restarting.

May I have your suggestion to solve this problem?

Attach (1) the details of the exception and (2) module configuration for your reference.

[Exception 1]

[02:57:16 DBG] Starting Module Host...
[02:57:16 INF] Running in iotedge production context.
[02:57:21 DBG] Trying to connect to publisher...
[02:57:21 INF] Finding publisher to use as publish service...
[02:57:21 DBG] Get all modules in current edge context.
[02:57:21 DBG] Calling GET on unix:///C:/ProgramData/iotedge/workload/sock/modules?api-version=2019-01-30 uri...
[02:57:21 ERR] Error during publisher discovery.
System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (10061): No connection could be made because the target machine actively refused it C
   at Microsoft.Azure.IIoT.Utils.Retry.DelayOrThrow(ILogger logger, Func`2 cont, Func`3 policy, Int32 maxRetry, Int32 k, Exception ex, CancellationToken ct)
   at Microsoft.Azure.IIoT.Utils.Retry.Do[T](ILogger logger, CancellationToken ct, Func`1 work, Func`2 cont, Func`3 policy, Int32 maxRetry)
   at Microsoft.Azure.IIoT.Module.Framework.Hosting.EdgeletClient.GetModulesAsync(String deviceId)
   at Microsoft.Azure.IIoT.OpcUa.Edge.Publisher.Servers.PublisherDiscovery.ConnectAsync()
   at Microsoft.Azure.IIoT.OpcUa.Edge.Publisher.Clients.PublisherServices.ReconnectAsync()

[Exception 2]

[03:01:07 INF] No publisher found - retrying in 275452 ms...
[03:02:18 ERR] Error during module execution - restarting!
System.AggregateException: One or more errors occurred. (Transient network error occurred, please retry.) ---> Microsoft.Azure.Devices.Client.Exceptions.IotHubCommunicationException: Transient network error occurred, please retry. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
   at Microsoft.Azure.Devices.Client.IotHubConnection.CreateSessionAsync(TimeSpan timeout, CancellationToken token)
   at Microsoft.Azure.Devices.Client.IotHubSingleTokenConnection.CreateSessionAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.FaultTolerantAmqpObject`1.OnCreateAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Singleton`1.CreateValue(TaskCompletionSource`1 tcs, TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Singleton`1.GetOrCreateAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.IotHubConnection.GetSessionAsync(TimeoutHelper timeoutHelper, CancellationToken token)
   at Microsoft.Azure.Devices.Client.IotHubConnection.CreateSendingLinkAsync(String path, IotHubConnectionString connectionString, String corrId, SendingLinkType linkType, TimeSpan timeout, ProductInfo productInfo, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.AmqpTransportHandler.CreateEventSendingLinkAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.FaultTolerantAmqpObject`1.OnCreateAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Singleton`1.CreateValue(TaskCompletionSource`1 tcs, TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Singleton`1.GetOrCreateAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.AmqpTransportHandler.OpenAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.OpenAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass22_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass35_0.<<OpenAsyncInternal>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.InternalClient.OpenAsync()
   at Microsoft.Azure.IIoT.Module.Framework.Client.IoTSdkFactory.ModuleClientAdapter.CreateAsync(String product, IotHubConnectionStringBuilder cs, String deviceId, String moduleId, ITransportSettings transportSetting, TimeSpan timeout, IRetryPolicy retry, Action onConnectionLost, ILogger logger)
   at Microsoft.Azure.IIoT.Utils.Try.Options[T](Func`1[] options)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.IIoT.Module.Framework.Hosting.ModuleHost.StartAsync(String type, String siteId, String serviceInfo, IProcessControl reset)
   at Microsoft.Azure.IIoT.Modules.OpcUa.Twin.ModuleProcess.RunAsync() in C:\src\src\ModuleProcess.cs:line 93
---> (Inner Exception #0) Microsoft.Azure.Devices.Client.Exceptions.IotHubCommunicationException: Transient network error occurred, please retry. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
   at Microsoft.Azure.Devices.Client.IotHubConnection.CreateSessionAsync(TimeSpan timeout, CancellationToken token)
   at Microsoft.Azure.Devices.Client.IotHubSingleTokenConnection.CreateSessionAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.FaultTolerantAmqpObject`1.OnCreateAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Singleton`1.CreateValue(TaskCompletionSource`1 tcs, TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Singleton`1.GetOrCreateAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.IotHubConnection.GetSessionAsync(TimeoutHelper timeoutHelper, CancellationToken token)
   at Microsoft.Azure.Devices.Client.IotHubConnection.CreateSendingLinkAsync(String path, IotHubConnectionString connectionString, String corrId, SendingLinkType linkType, TimeSpan timeout, ProductInfo productInfo, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.AmqpTransportHandler.CreateEventSendingLinkAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.FaultTolerantAmqpObject`1.OnCreateAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Singleton`1.CreateValue(TaskCompletionSource`1 tcs, TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Singleton`1.GetOrCreateAsync(TimeSpan timeout, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.AmqpTransportHandler.OpenAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.OpenAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass22_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass35_0.<<OpenAsyncInternal>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.InternalClient.OpenAsync()
   at Microsoft.Azure.IIoT.Module.Framework.Client.IoTSdkFactory.ModuleClientAdapter.CreateAsync(String product, IotHubConnectionStringBuilder cs, String deviceId, String moduleId, ITransportSettings transportSetting, TimeSpan timeout, IRetryPolicy retry, Action onConnectionLost, ILogger logger)
   at Microsoft.Azure.IIoT.Utils.Try.Options[T](Func`1[] options)<---

[module configuration]

  • OPC Twin
    • module name: opctwin
    • image url: mcr.microsoft.com/iotedge/opc-twin:2.0.1-windows-amd64
    • container create options:
      {
        "NetworkingConfig": {
          "EndpointsConfig": {
            "host": {}
          }
        },
        "HostConfig": {
          "NetworkMode": "host",
          "CapAdd": [
            "NET_ADMIN"
          ]
        }
      }
  • OPC Publisher
    • module name: opcpublisher
    • image url: mcr.microsoft.com/iotedge/opc-publisher:2.3
    • Container Create Options:
      {
        "Hostname": "publisher",
        "Cmd": [
          "publisher",
          "--pf=./pn.json",
          "--di=60",
          "--to",
          "--aa",
          "--si=0",
          "--ms=0"
        ],
        "ExposedPorts": {
          "62222/tcp": {}
        },
        "HostConfig": {
          "ExtraHosts": [
            "localhost:127.0.0.1"
          ],
          "Binds": [
            "c:/iiotedge:c:/appdata"
          ],
          "PortBindings": {
            "62222/tcp": [
              {
                "HostPort": "62222"
              }
            ]
          }
        }
      }
      

Gateway endpoint URL issue

Hi,

I can browse/discover OPC UA servers using UaExpert (an UPA UA Client) and the Gateway service (e.g. http://192.168.135.131:10080/ua/). If an endpoint is activated and connected, I can see 3 different endpoints (http, opc-ua none and sign&encrypt).
The first endpoint provides a localhost URL
http://localhost:9040/applications/.../endpoint/...
The second and third endpoint url contains an hostname:
opc.tcp://b338c9b7c250:51111/applications/.../endpoint/...

The Client won't be able to connect to these endpoints, because there is no service running on localhost and hostname to IP is not resolvable.
Manually changing localhost to IP is not accepted by the gateway (BadTcpEndpointUrlInvalid), adding 192.168.135.131 b338c9b7c250 to hosts works but bad workaround and doesn't work when using nginx proxy.

Connection between Azure Opc UA Twin and Azure Digital Twin

Hello Mr. Schier,

I'm currently working on a studentproject, where i want to generate an asset administration shell (AAS) on the azure-cloud by using the opc ua twin and map it to azure digital twin. Is there any connection interface available or are they just standalone services? If you have any idea to map these services, it would be very helpful. You also can contact me via e-mail.

Many thanks in advance.

Multiple Requests to IBrowseServices<EndpointRegistrationModel>.NodeBrowseAsync result in exception

Hi,

I'm using the supervisor client to access the opc device twin module from my module. I need to Browse multiple nodes, so i start several Tasks with NodeBrowseAsync at once. This sometimes works, sometimes it results in this Exception:

Microsoft.Azure.Devices.Client.Exceptions.IotHubException: {"message":"Timed out waiting for device to respond to method request 9aabd6bb-d1a9-47ac-833f-ac040cb53b5f","exceptionMessage":"","status":0,"payload":null}
   at Microsoft.Azure.Devices.Client.Transport.HttpClientHelper.ExecuteAsync(HttpMethod httpMethod, Uri requestUri, Func`3 modifyRequestMessageAsync, Func`2 isSuccessful, Func`3 processResponseMessageAsync, IDictionary`2 errorMappingOverrides, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.HttpClientHelper.PostAsync[T1,T2](Uri requestUri, T1 entity, IDictionary`2 errorMappingOverrides, IDictionary`2 customHeaders, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.ModuleClient.InvokeMethodAsync(Uri uri, MethodRequest methodRequest, CancellationToken cancellationToken)
   at Microsoft.Azure.IIoT.Module.Framework.Hosting.ModuleHost.CallMethodAsync(String deviceId, String moduleId, String method, String payload, Nullable`1 timeout)
   at Microsoft.Azure.IIoT.Module.Default.ChunkMethodClient.CallMethodAsync(String deviceId, String moduleId, String method, Byte[] payload, String contentType, Nullable`1 timeout)
   at Microsoft.Azure.IIoT.Module.MethodClientEx.CallMethodAsync(IMethodClient client, String deviceId, String moduleId, String method, String json, Nullable`1 timeout)
   at Microsoft.Azure.IIoT.OpcUa.Twin.Clients.SupervisorClient.CallServiceOnSupervisor[T,R](String service, EndpointRegistrationModel registration, T request)
   at Microsoft.Azure.IIoT.OpcUa.Twin.Clients.SupervisorClient.NodeValueReadAsync(EndpointRegistrationModel registration, ValueReadRequestModel request)
   at MyModule.Communication.Twincommunicator.GetValue(String nodeId)

Once this exception appears, it will appear for about a minute for any browse request or read request made. If some time passes until the next request, it works again.

Is there a limit, how many BrowseOperations can be queued or run in parallel or per second? If so, what is the limit?
The connection is made over the edge hub, so i don't think IoT-Hub-Throttling applies.
I don't think hardware is limiting here, due to 4 cores and 8GB RAM.

Edit:
The log of the edgeHub indicates, that the opc device twin doesn't answer (in time).

2019-04-18 07:13:46.053 +00:00 [INF] - Request starting HTTP/1.1 POST https://ubuntu/twins/linux-test-device/modules/opc-device-twin-module/methods?api-version=2018-06-30 application/json; charset=utf-8 542
2019-04-18 07:13:46.054 +00:00 [INF] - Client linux-test-device/my-module in device scope authenticated locally.
2019-04-18 07:13:46.054 +00:00 [INF] - Route matched with "{action = \"InvokeModuleMethodAsync\", controller = \"Twins\"}". Executing action "Microsoft.Azure.Devices.Edge.Hub.Http.Controllers.TwinsController.InvokeModuleMethodAsync (Microsoft.Azure.Devices.Edge.Hub.Http)"
2019-04-18 07:13:46.055 +00:00 [INF] - Executing action method "Microsoft.Azure.Devices.Edge.Hub.Http.Controllers.TwinsController.InvokeModuleMethodAsync (Microsoft.Azure.Devices.Edge.Hub.Http)" with arguments (["linux-test-device", "opc-device-twin-module", "Microsoft.Azure.Devices.Edge.Hub.Http.MethodRequest"]) - Validation state: Valid
2019-04-18 07:14:16.061 +00:00 [WRN] - Did not receive response for method invoke call from device/module linux-test-device/opc-device-twin-module for linux-test-device/opc-device-twin-module with correlation ID a6bc8397-e99f-43ff-b0c5-6c0940d7749c
2019-04-18 07:14:16.066 +00:00 [INF] - Executed action method "Microsoft.Azure.Devices.Edge.Hub.Http.Controllers.TwinsController.InvokeModuleMethodAsync (Microsoft.Azure.Devices.Edge.Hub.Http)", returned result "Microsoft.AspNetCore.Mvc.ObjectResult" in 30011.0176ms.
2019-04-18 07:14:16.066 +00:00 [INF] - Executing ObjectResult, writing value of type '"Microsoft.Azure.Devices.Edge.Hub.Http.MethodErrorResult"'.
2019-04-18 07:14:16.070 +00:00 [INF] - Executed action "Microsoft.Azure.Devices.Edge.Hub.Http.Controllers.TwinsController.InvokeModuleMethodAsync (Microsoft.Azure.Devices.Edge.Hub.Http)" in 30015.5847ms
2019-04-18 07:14:16.070 +00:00 [INF] - Request finished in 30016.5999ms 504 application/json; charset=utf-8

Thanks for your help

Matthias Mucha

azure-iiot-opc-twin-module stops responding to requests

Hi,

i'm using the opc-twin-module to browse an opc-server from another edge module using the supervisorclient of azure-iiot-opc-ua.
Sometimes the opc twin module stops responding to direct method calls, so an IoTHubException is thrown:

Microsoft.Azure.Devices.Client.Exceptions.IotHubException: {"message":"Timed out waiting for device to respond to method request 9aabd6bb-d1a9-47ac-833f-ac040cb53b5f","exceptionMessage":"","status":0,"payload":null}
   at Microsoft.Azure.Devices.Client.Transport.HttpClientHelper.ExecuteAsync(HttpMethod httpMethod, Uri requestUri, Func`3 modifyRequestMessageAsync, Func`2 isSuccessful, Func`3 processResponseMessageAsync, IDictionary`2 errorMappingOverrides, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.HttpClientHelper.PostAsync[T1,T2](Uri requestUri, T1 entity, IDictionary`2 errorMappingOverrides, IDictionary`2 customHeaders, CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.ModuleClient.InvokeMethodAsync(Uri uri, MethodRequest methodRequest, CancellationToken cancellationToken)
   at Microsoft.Azure.IIoT.Module.Framework.Hosting.ModuleHost.CallMethodAsync(String deviceId, String moduleId, String method, String payload, Nullable`1 timeout)
   at Microsoft.Azure.IIoT.Module.Default.ChunkMethodClient.CallMethodAsync(String deviceId, String moduleId, String method, Byte[] payload, String contentType, Nullable`1 timeout)
   at Microsoft.Azure.IIoT.Module.MethodClientEx.CallMethodAsync(IMethodClient client, String deviceId, String moduleId, String method, String json, Nullable`1 timeout)
   at Microsoft.Azure.IIoT.OpcUa.Twin.Clients.SupervisorClient.CallServiceOnSupervisor[T,R](String service, EndpointRegistrationModel registration, T request)
   at Microsoft.Azure.IIoT.OpcUa.Twin.Clients.SupervisorClient.NodeValueReadAsync(EndpointRegistrationModel registration, ValueReadRequestModel request)
   at MyModule.Communication.Twincommunicator.GetValue(String nodeId)

This is the same issue as this one, the root cause seems to be in the opc-twin-module.

opc publisher 2.3.0 fails to connect to edgeHub of edge device

On one of our edge devices we have the problem, that the publisher fails to connect to the edgeHub.
The log of the publisher container contains the following

[12:34:51 INF] LDS(-ME) registration intervall set to 0 ms (0 means no registration)

[12:34:51 INF] Trusted issuer store contains 0 certs

[12:34:51 INF] Trusted issuer store has 0 CRLs.

[12:34:51 INF] Trusted peer store contains 1 certs

[12:34:51 INF] 01: Subject 'CN=publisher' (thumbprint: EC9D5A9FD6AC90B720945C90CE8D6F299D7E838A)

[12:34:51 INF] Trusted peer store has 0 CRLs.

[12:34:51 INF] Rejected certificate store contains 0 certs

[12:34:51 INF] There is no site configured.

[12:34:51 INF] Starting server on endpoint opc.tcp://publisher:62222/UA/Publisher ...

[12:34:52 INF] Server started.

[12:34:52 INF] Using default telemetry configuration.

[12:34:52 INF] The name of the configuration file for published nodes is: ./pn.json

[12:34:52 INF] Attemtping to load node configuration from: ./pn.json

[12:34:52 INF] Loaded 0 config file entry/entries.

[12:34:52 INF] There are 0 nodes to publish.

[12:34:52 INF] Create IoTEdgeHub module client using 'Mqtt_Tcp_Only' for communication.

[12:34:53 INF] IoTCentral mode: False

[12:34:53 INF] Certificate 'CN=python-opcua.example.org' will be trusted, because of corresponding command line option.

[12:34:53 ERR] Failure initializing hub communication processing.

System.Security.Authentication.AuthenticationException: TLS authentication error. ---> System.AggregateException: One or more errors occurred. (The remote certificate is invalid according to the validation procedure.) ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

   at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)

   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)

   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)

   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)

   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)

   at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest)

--- End of stack trace from previous location where exception was thrown ---

   at System.Net.Security.SslState.ThrowIfExceptional()

   at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)

   at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)

   at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)

   at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__46_2(IAsyncResult iar)

   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)

   --- End of inner exception stack trace ---

   at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.OpenAsyncInternal(CancellationToken cancellationToken)

   at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.OpenAsync(CancellationToken cancellationToken)

   at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.OpenAsync(CancellationToken cancellationToken)

   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass22_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)

   --- End of inner exception stack trace ---

   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)

   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass35_0.<<OpenAsyncInternal>b__0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)

   at Microsoft.Azure.Devices.Client.InternalClient.OpenAsync()

   at OpcPublisher.HubCommunication.InitHubCommunicationAsync(TransportType transportType) in /app/opcpublisher/HubCommunication.cs:line 130

Alert if internal queue almost full

Log an alert if the internal queue (_monitoredItemsDataQueue) is close to full (BoundedCapacity) so a monitoring system, such as OMS, can notify an administrator.

OPC Publisher IotHubCommunicationException While Creating ModuleClient

I deployed OPC publisher as IotEdge module using this link

Module fails execution and publisher exists.
Logs are as given below

IoTEdge detected.
[19:49:28 INF] Current directory is: C:\appdata
[19:49:28 INF] Log file is: publisher-publisher.log
[19:49:28 INF] Log level is: info
[19:49:28 INF] OPC Publisher V2.4.0+2 starting up...
[19:49:28 INF] OPC UA monitored item notifications with one of the following 2 status codes will not generate telemetry events:
[19:49:28 INF] StatusCode: BadNoCommunication (dec: 2150694912, hex: 80310000)
[19:49:28 INF] StatusCode: BadWaitingForInitialData (dec: 2150760448, hex: 80320000)
[19:49:28 INF] opcstacktracemask set to: 0x0
[19:49:28 INF] OperationTimeout set to 120000
[19:49:28 INF] OPC UA server base address: opc.tcp://publisher:62222/UA/Publisher
[19:49:28 INF] Security policy http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256 with mode SignAndEncrypt added
[19:49:28 INF] Trusted Issuer store type is: Directory
[19:49:28 INF] Trusted Issuer Certificate store path is: pki/issuer
[19:49:28 INF] Trusted Peer Certificate store type is: Directory
[19:49:28 INF] Trusted Peer Certificate store path is: pki/trusted
[19:49:28 INF] Rejected certificate store type is: Directory
[19:49:28 INF] Rejected Certificate store path is: pki/rejected
[19:49:28 INF] Rejection of SHA1 signed certificates is disabled
[19:49:28 INF] Minimum certificate key size set to 1024
[19:49:28 INF] Application Certificate store type is: Directory
[19:49:28 INF] Application Certificate store path is: pki/own
[19:49:28 INF] Application Certificate subject name is: publisher
[19:49:28 WRN] WARNING: Automatically accepting certificates. This is a security risk.
[19:49:28 INF] Application certificate with thumbprint '5D5D27700F3CEDA4D8B27F6A38E76DBC2EE31C79' found in the application certificate store.
[19:49:28 INF] Application certificate is for ApplicationUri 'urn:publisher:publisher:microsoft:', ApplicationName 'publisher' and Subject is 'publisher'
[19:49:28 INF] LDS(-ME) registration intervall set to 0 ms (0 means no registration)
[19:49:28 INF] Trusted issuer store contains 0 certs
[19:49:28 INF] Trusted issuer store has 0 CRLs.
[19:49:28 INF] Trusted peer store contains 0 certs
[19:49:28 INF] Trusted peer store has 0 CRLs.
[19:49:28 INF] Rejected certificate store contains 0 certs
[19:49:28 INF] There is no site configured.
[19:49:28 INF] Starting server on endpoint opc.tcp://publisher:62222/UA/Publisher ...
[19:49:29 INF] Server started.
[19:49:29 INF] Using default telemetry configuration.
[19:49:29 INF] Create module client using 'Amqp_Tcp_Only' for communication.
[19:49:30 INF] IoTCentral mode: False
[19:49:31 ERR] Connection status changed to 'Disconnected', reason 'Retry_Expired'
[19:53:31 ERR] Failure initializing hub communication processing.
Microsoft.Azure.Devices.Client.Exceptions.IotHubCommunicationException: Transient network error occurred, please retry. ---> System.Net.Sockets.SocketException: No such host is known
at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpConnector.InitializeTransport(TimeSpan timeout)
at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpConnector.OpenConnectionAsync(TimeSpan timeout)
at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpConnectionHolder.EnsureConnection(TimeSpan timeout)
at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpConnectionHolder.AmqpSessionCreator(DeviceIdentity deviceIdentity, ILinkFactory linkFactory, AmqpSessionSettings amqpSessionSettings, TimeSpan timeout)
at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpUnit.OpenAsync(TimeSpan timeout)
at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpTransportHandler.OpenAsync(CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.OpenAsync(CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass22_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func1 asyncOperation) --- End of inner exception stack trace --- at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func1 asyncOperation)
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass32_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Client.InternalClient.OpenAsync()
at OpcPublisher.HubCommunicationBase.InitHubCommunicationAsync(IHubClient hubClient) in C:\app\opcpublisher\HubCommunicationBase.cs:line 202
[19:53:31 FTL] Cannot create module client. Exiting...
[19:53:31 FTL] at OpcPublisher.IotEdgeHubCommunication..ctor() in C:\app\opcpublisher\IotEdgeHubCommunication.cs:line 43
at OpcPublisher.IotEdgeHubCommunication.get_Instance() in C:\app\opcpublisher\IotEdgeHubCommunication.cs:line 23
at OpcPublisher.Program.MainAsync(String[] args) in C:\app\opcpublisher\Program.cs:line 729
System.Exception: Cannot create module client. Exiting...
at OpcPublisher.IotEdgeHubCommunication..ctor() in C:\app\opcpublisher\IotEdgeHubCommunication.cs:line 43
at OpcPublisher.IotEdgeHubCommunication.get_Instance() in C:\app\opcpublisher\IotEdgeHubCommunication.cs:line 23
at OpcPublisher.Program.MainAsync(String[] args) in C:\app\opcpublisher\Program.cs:line 729
[19:53:31 FTL] Publisher exiting...
PS C:\WINDOWS\system32>

endpoint activate causes twin module to restart

When using /v2/endpoints/{endpointId}/activate from Registry Service the twin module shows this message:

[13:34:14 ERR] Exception applying changes! Continue...
System.ArgumentNullException: Value cannot be null.
Parameter name: endpoint
   at Microsoft.Azure.IIoT.OpcUa.Protocol.Services.ClientServices.ExecuteServiceAsync[T](EndpointModel endpoint, CredentialModel elevation, Int32 priority, Func`2 service, Nullable`1 timeout, CancellationToken ct, Func`2 handler)
   at Microsoft.Azure.IIoT.OpcUa.Protocol.EndpointServicesEx.ExecuteServiceAsync[T](IEndpointServices client, EndpointModel endpoint, CredentialModel elevation, TimeSpan timeout, Func`2 service)
   at Microsoft.Azure.IIoT.Modules.OpcUa.Twin.v2.Supervisor.NodeSettingsController.WriteAsync(String nodeId, JToken value) in /src/src/v2/Controllers/NodeSettingsController.cs:line 96
   at Microsoft.Azure.IIoT.Modules.OpcUa.Twin.v2.Supervisor.NodeSettingsController.ApplyAsync() in /src/src/v2/Controllers/NodeSettingsController.cs:line 80
   at Microsoft.Azure.IIoT.Module.Framework.Hosting.SettingsRouter.Controller.SafeApplyAsync()
[13:34:14 DBG] Applying new settings took 00:00:00.0009411...

Registry Service is created today from master using the deploy.cmd from azure-iiot-components.
The Twin module is self built: docker build -f docker/linux/amd64/Dockerfile -t tbn.azurecr.io/twin6 azure-iiot-opc-twin-module-master from todays master branch and it's running on an IoTEdge device.

deployment.json:

"modules": {
	"publisher": {
		"type": "docker",
		"settings": {
			"image": "mcr.microsoft.com/iotedge/opc-publisher:latest",
			"createOptions": "{\"Hostname\":\"publisher\",\"Cmd\":[\"publisher\",\"--pf=./pn.json\",\"--di=60\",\"--to\",\"--aa\",\"--si=0\",\"--ms=0\"],\"ExposedPorts\":{\"62222/tcp\":{}},\"HostConfig\":{\"PortBindings\":{\"62222/tcp\":[{\"HostPort\":\"62222\"}]}}}"
		},
		"version": "1.0",
		"status": "running",
		"restartPolicy": "always"
	},
	"twin": {
		"type": "docker",
		"settings": {
			"image": "tbn.azurecr.io/twin6",
			"createOptions": "{\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}},\"HostConfig\":{\"NetworkMode\":\"host\"}}"
		},
		"version": "1.0",
		"status": "running",
		"restartPolicy": "always"
	}
}

GIT dependency in run.ps1

Describe the bug
the deploy script will start the 'vm\run.ps1' script, which calls the 'git' command (line 227).
If git is not in the search path of the machine, the deployment will fail.

To Reproduce
start the deployment without git in the search path.

Expected behavior
a) advice in the notes, that git is a prerequisite for the deployment
b) check for git command in the script

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Win10, Powershell
  • Browser [e.g. chrome, safari]
  • Version Win10

'BadEncodingLimitsExceeded ' received when creating subscriptions

We have OPC Publisher 2.3.3 running on iotedge 1.0.6.1 (3fa6cbef8b7fc3c55a49a622735eb1021b8a5963)

On startup up of the Publisher we are getting a 'BadEncodingLimitsExceeded ' error.

How should we go about debugging/resolving this issue?

[04:34:04 INF] Publisher is running. Press CTRL-C to quit.
[04:34:04 INF] Connect and monitor session and nodes on endpoint 'opc.tcp://10.70.64.95:49320'.
[04:34:06 INF] Create unsecured session for endpoint URI 'opc.tcp://10.70.64.95:49320' with timeout of 10000 ms.
[04:34:06 INF] Session successfully created with Id ns=1;g=73c5b05f-456f-49ec-a62b-a555657aaa6d.
[04:34:06 INF] The session to endpoint 'opc.tcp://10.70.64.95:49320/' has 3 entries in its namespace array:
[04:34:06 INF] Namespace index 0: http://opcfoundation.org/UA/
[04:34:06 INF] Namespace index 1: urn:NZS070HSTOPC01X.prod01.inroot.net:PTC.ThingWorxIC.1:UA%20Server
[04:34:06 INF] Namespace index 2: ThingWorx Industrial Connectivity
[04:34:06 INF] Created subscription with id 8 on endpoint 'opc.tcp://10.70.64.95:49320'
[04:34:06 INF] Create subscription on endpoint 'opc.tcp://10.70.64.95:49320' requested OPC publishing interval is 30000 ms. (revised: 30000 ms)
[04:34:06 INF] Start monitoring items on endpoint 'opc.tcp://10.70.64.95:49320'. Currently monitoring 0 items.
[04:34:06 INF] Now monitoring 10000 items in subscription with id '8'
[04:34:07 INF] Now monitoring 20000 items in subscription with id '8'
[04:34:08 INF] Now monitoring 30000 items in subscription with id '8'
[04:34:10 INF] Now monitoring 40000 items in subscription with id '8'
[04:34:14 INF] Now monitoring 50000 items in subscription with id '8'
[04:34:14 ERR] Unhandled OPC UA ServiceResultException 'BadEncodingLimitsExceeded 'Could not send request to server.'' when monitoring node 'ns=2;s=NZ070_Darfield_NZS070SRV01X.C270.NZ070_B05VA0506_AlmFault' on endpoint 'opc.tcp://10.70.64.95:49320'. Continue.
[04:34:14 INF] Now monitoring 60000 items in subscription with id '8'
[04:34:14 ERR] Unhandled OPC UA ServiceResultException 'BadEncodingLimitsExceeded 'Could not send request to server.'' when monitoring node 'ns=2;s=NZ070_Darfield_NZS070SRV01X.C801.NZ070_S1PW1P01_Msg1' on endpoint 'opc.tcp://10.70.64.95:49320'. Continue.
[04:34:15 ERR] Exception
Opc.Ua.ServiceResultException: Could not send request to server.
   at Opc.Ua.Bindings.ChannelAsyncOperation`1.End(Int32 timeout, Boolean throwOnError)
   at Opc.Ua.Bindings.UaSCUaBinaryClientChannel.EndSendRequest(IAsyncResult result)
   at Opc.Ua.Bindings.UaSCUaBinaryTransportChannel.EndSendRequest(IAsyncResult result)
   at Opc.Ua.Bindings.UaSCUaBinaryTransportChannel.SendRequest(IServiceRequest request)
   at Opc.Ua.SessionClient.CreateMonitoredItems(RequestHeader requestHeader, UInt32 subscriptionId, TimestampsToReturn timestampsToReturn, MonitoredItemCreateRequestCollection itemsToCreate, MonitoredItemCreateResultCollection& results, DiagnosticInfoCollection& diagnosticInfos)
   at Opc.Ua.Client.Subscription.CreateItems()
   at Opc.Ua.Client.Subscription.ApplyChanges()
   at OpcPublisher.OpcSession.MonitorNodesAsync(CancellationToken ct) in /app/opcpublisher/OpcSession.cs:line 561
[04:34:25 INF] Start monitoring items on endpoint 'opc.tcp://10.70.64.95:49320'. Currently monitoring 66541 items.
[04:34:25 ERR] Unhandled OPC UA ServiceResultException 'BadEncodingLimitsExceeded 'Could not send request to server.'' when monitoring node 'ns=2;s=NZ070_Darfield_NZS070SRV01X.C270.NZ070_B05VA0506_AlmFault' on endpoint 'opc.tcp://10.70.64.95:49320'. Continue.
[04:34:25 ERR] Exception
Opc.Ua.ServiceResultException: Could not send request to server.
   at Opc.Ua.Bindings.ChannelAsyncOperation`1.End(Int32 timeout, Boolean throwOnError)
   at Opc.Ua.Bindings.UaSCUaBinaryClientChannel.EndSendRequest(IAsyncResult result)
   at Opc.Ua.Bindings.UaSCUaBinaryTransportChannel.EndSendRequest(IAsyncResult result)
   at Opc.Ua.Bindings.UaSCUaBinaryTransportChannel.SendRequest(IServiceRequest request)
   at Opc.Ua.SessionClient.CreateMonitoredItems(RequestHeader requestHeader, UInt32 subscriptionId, TimestampsToReturn timestampsToReturn, MonitoredItemCreateRequestCollection itemsToCreate, MonitoredItemCreateResultCollection& results, DiagnosticInfoCollection& diagnosticInfos)
   at Opc.Ua.Client.Subscription.CreateItems()
   at Opc.Ua.Client.Subscription.ApplyChanges()
   at OpcPublisher.OpcSession.MonitorNodesAsync(CancellationToken ct) in /app/opcpublisher/OpcSession.cs:line 561

I have tried removing the tags that are reporting errors but it appears to just report the next tag as error'd after this.

This error is also mentioned on 2 other OPC github projects.
OPCFoundation/UA-.NET-Legacy#107
open62541/open62541#434

Neither is very clear to me why this might be happening, but sounds like it could be something going over the size limit for an OPCUA message?

OPC tag not showing when browsing node in some PLC

I built the OPC Twin module from develop branch, and use Connected factory to test the discover, read, write.

And it work fine on my Siemens S7-1500 PLC.
But when I changed to another Siemens S7-1500 PLC (but with different CPU module).

It cannot shows all tag when I expanded the node.
Like picture below, it only shows "icon"

test_test

But when I use other OPC client ( OPC Foundation Sample Client )to connect to PLC and browse the OPC node. it can successfully show all tags.

test_test222

But before showing all the tag, it prompt a window with "more reference exists" message when I clicked "memory" which not happened whenI connected to other OPC UA server.

issue2

There are sightly different on CPU module in PLC, like table below.

PLC CPU Result
Siemens-S7 CPU 1511-1 PN6ES7511-1AK01-0AB0 Success - Can Browse all OPC tag
Siemens-S7 CPU 1511-1 PN6ES7511-1AK02-0AB0 Failed -  Cannot Browse all OPC tag,   Only show “icon”

Not sure is the CPU matter or the incorrect setting in PLC?
Any idea?

Can't use OPC Twin module as IoT Edge module with opc iot services

Hi,

i tried using the azure iiot services with the opc twin module as edge module.
How do i need to configure this to work?

As far as i understood this, the demo works using the cli for the iiot-opc-twin-module.
This creates an Edge device (demo) which has a module (demo) in it. Then it starts the actual iiot-opc-twin-module with the iothub connection string for the module. Correct?

If i want to deploy the iiot-opc-twin-module to an existing iot edge device with the actual iotedge runtime, then the module gets the edgehub connection string. How can the iiot-services then communicate with the module? As far as i remember, Cloud to device messages for modules connected with an edge hub don't work (yet). Do i miss anything here?

Thank you for your help.
Best regards

Matthias

IModuleDiscovery.GetModulesAsync -> "Not running in iotedge context - no modules in scope." in Edgehubdev

Hi,

i'm trying to use the IModuleDiscovery Microsoft.Azure.IIot.Framework to discover the other modules in the Edge environment.

When calling GetModulesAsync, an empty List is always returned. Also the the statement "Not running in iotedge context - no modules in scope." is logged.

Does that mean, the method is only working from an IoTEdge-Module running in IotEdge-Environment or the method is only working from EdgeHub or EdgeAgent?

In the first case: Why doesn't this work in iotedgehubdev? Is this a bug?
In the latter case: What else can i use to discover the modules that are running beside my module?

Thank you for your help,
Best regards

Matthias Mucha

Communication with IoT hub stops after some hours.

Hello,
I'm using the OpcPublisher with my IoT hub as a standalone application and the Mqtt protocol.
My problem is that after a few hours of operation I'm receiving the following error:
Connection status changed to 'Disconnected', reason 'Retry_Expired'
After this, the communication with IoT hub is completely lost and the msg send failures counter in the OpcPublisher status output starts to increase.
Before there were also several messages (repeated almost hourly) like this:
Connection status changed to 'Disconnected_Retrying', reason 'Communication_Error'

What could be reason for this? There were no such problems occurring in former versions of the publisher (half a year ago).

Any help appreciated.
Thanks
Hartmut

OPC UA PubSub 1.04 Compliance

The Readme.md file states:

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.

It requires that the message created by:

IotHubMessaging.CreateJsonMessageAsync(OpcPublisher.OpcMonitoredItem.MessageData)

has to be compliant with the specification:

My concern is what is the reason to create the message following this specification. As far as I understand this encoding. i.e. the JSON based message mapping allows OPC UA Applications to interoperate with web and enterprise software that use this format. Is there any plan to:

  • make the Azure IoT Edge OPC UA PubSub JSON encoding aware
  • compliant with OPC UA PubSub Application and offer the Subscriber role.

Deployment script for Industrial-IoT microservices fail

Hi,

When I try to follow the guideline for deploying the microservices I run into several issues and I had to do some changes to the https://github.com/Azure/Industrial-IoT/blob/master/services/deploy/vm/template.json file to get it to a stage where it starts deploying components in Azure. But I can't get it to completely succeed, I hope you can help.

  1. There is an issue with a Keyvault resource pointing to a variable named keyVaultVersion which does not exist under variables (I changed this to keyVaultApiVersion) which will remove this error.
  2. It seems that the script tries to create two key vaults with the same name. Removing the key vault below solves the duplicate key vault issue and the resources will start to deploy to Azure.
    { "type": "Microsoft.KeyVault/vaults", "name": "[parameters('keyVaultName')]", "apiVersion": "[variables('keyVaultVersion')]", "location": "[resourceGroup().location]", "tags": { "displayName": "[parameters('keyVaultDisplayName')]" }, "properties": { "enabledForDeployment": true, "enabledForTemplateDeployment": false, "enabledForVolumeEncryption": false, "sku": { "name": "[parameters('keyVaultSkuName')]", "family": "A" }, "tenantId": "[parameters('aadTenantId')]", "accessPolicies": [] } },
  3. A BadRequest error is received when trying to create the key vault secret /PCS_IOTHUBREACT_AZUREBLOB_KEY

I tried to follow this guide both with the old repo https://github.com/Azure/azure-iiot-components, the new repo https://github.com/Azure/Industrial-IoT master branch and the "new_repo_structure" branch.

Thanks :)

Cannot Capture the ServerTimestamp by using the telemetry configuration

Hi ,

I want to capture the ServerTimestamp of the OPCUA server as part of my configuration . Have used the telemetry json as below but i am unable to get the ServerTimestamp in my iot Stream. can some one confirm if this is the desired configuration or something has to be changed.
{ "Defaults": { "Flat": true, "Value": { "Flat": true, "Value": { "Publish": true, "Name": "Value" }, "SourceTimestamp": { "Publish": true, "Name": "SourceTimestamp" }, "ServerTimestamp": { "Publish": true, "Name": "ServerTimestamp" }, "StatusCode": { "Publish": true, "Name": "StatusCode" // 'Pattern' is ignored for the 'StatusCode' value }, // 'Status' is the symbolic name of 'StatusCode' "Status": { "Publish": false, "Name": "Status" } } } }

Add all node configuration settings to IPublishServices

Hello,

The IPublishServices are really easy to use, but lack features.
Several Node settings that the Publisher supports are not provided from the IPublishServices, such as the HeartBeatInterval.
We need to heart beat interval but would also like to stick to the IPublishServices implementations that are available from the azure-iiot-opc-ua.

Best regards
Matthias

Some questions in doing the OPC twin project

Hi, I am running OPC twin on a Windows10, Docker 3.7.0, surface pro 4 in China. I work on the OPC twin project following procedures on https://docs.microsoft.com/bs-latn-ba/azure/iot-accelerators/howto-opc-twin-deploy-existing

  1. when deploying this project to my Azure portal using Powershell, it kept warning me with "Get-AzureRMxxx is not recognized as a name of cmdlet". This was solved after installing AzureRM module. However, on the web https://docs.microsoft.com/bs-latn-ba/azure/iot-accelerators/howto-opc-twin-deploy-existing, it only requires Az. The Microsoft docs also said that "The Az module is not guaranteed to be compatible with any existing AzureRM installs in PowerShell 5.1 for Windows. ". It is really weird.

  2. In the deploy project part, it requires the user to save the .env file. This requirement is really painful for me. For no obvious reason, the .env file saving command did not show up for half an hour after the Azure resource group was successfully deployed. For each .env file, it took me about 20 to 60 mins to wait for saving command jumped out. In the later deployment, I did not see the importance of these painfully saved .env files. It just showed which resource group I should connect to. Is it really vital to save the .env file?

  3. In the "run and debug locally" part, the deployment to iot edge was not successfully done. The "iotedgehubdev start -d deployment.json" command gets the warning "ERROR: local variable 'module_content' referenced before assignment". All previous steps are correctly followed. Please reply to me if you have any clue to fix the error.

RetryPolicy for output messages?

What is the default RetryPolicy for messages send by the OpcPublisher used as IotEdge module ?
Can the RetryPolicy be changed (e.g. using commandline parameters) ?

Publishing subitems of OPC UA Node

I want to communicate subitems of my OPC UA objects to Azure.
The configuration:
An OPC UA server on a Ewon Flexy contains a node ("s=PulseBit"). This node has several subitems like "isKPI" and "tagID".
When I am publishing this data to the cloud, I don't get the 'reference' of each node. With this 'reference' I know that "isKPI" is a member of "PulseBit". Sending/publishing the 'reference', is it something what depends on the OPC UA server or on the iot edge opc publisher?

Error during module execution inside IoT Edge

I tried to run the module inside IoT Edge without the EdgeHubConnectionString as argument, but I get the following exception:

[11:28:46 DBG] Starting Module Host...
[11:28:46 ERR] Error during module execution - restarting!
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Azure.IIoT.Module.Framework.Client.IoTSdkFactory.ModuleClientAdapter.<>c__DisplayClass5_0.<CreateAsync>b__0(ConnectionStatus s, ConnectionStatusChangeReason r)
   at Microsoft.Azure.Devices.Client.InternalClient.OnConnectionStatusChanged(ConnectionStatus status, ConnectionStatusChangeReason reason)
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass35_0.<<OpenAsyncInternal>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.InternalClient.OpenAsync()
   at Microsoft.Azure.IIoT.Module.Framework.Client.IoTSdkFactory.ModuleClientAdapter.CreateAsync(String product, IotHubConnectionStringBuilder cs, ITransportSettings transportSetting, TimeSpan timeout, IRetryPolicy retry, Action onConnectionLost, ILogger logger)
   at Microsoft.Azure.IIoT.Utils.Try.Options[T](Func`1[] options)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.IIoT.Module.Framework.Hosting.ModuleHost.StartAsync(String type, String siteId, String serviceInfo, IProcessControl reset)
   at Microsoft.Azure.IIoT.Modules.OpcUa.Twin.ModuleProcess.RunAsync() in /src/src/ModuleProcess.cs:line 93
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Azure.IIoT.Module.Framework.Client.IoTSdkFactory.ModuleClientAdapter.<>c__DisplayClass5_0.<CreateAsync>b__0(ConnectionStatus s, ConnectionStatusChangeReason r)
   at Microsoft.Azure.Devices.Client.InternalClient.OnConnectionStatusChanged(ConnectionStatus status, ConnectionStatusChangeReason reason)
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass35_0.<<OpenAsyncInternal>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.InternalClient.OpenAsync()
   at Microsoft.Azure.IIoT.Module.Framework.Client.IoTSdkFactory.ModuleClientAdapter.CreateAsync(String product, IotHubConnectionStringBuilder cs, ITransportSettings transportSetting, TimeSpan timeout, IRetryPolicy retry, Action onConnectionLost, ILogger logger)
   at Microsoft.Azure.IIoT.Utils.Try.Options[T](Func`1[] options)<---

It's running on Linux amd64 and the latest mschier_develop (master or tag 2.0.0 doesn't compile: 'LogEx' does not contain a definition for 'Level'). It's running when I set cmd EdgeHubConnectionString (which is the module connection string, not edgehub)

Include swagger json

Hello,

I would like to use the swagger code generation, but there are no json-files. According to .gitignore there are some files. Could you please upload them? In this way, generated folder is no more required in git (6MB of unused code).

Thanks.

ModuleClientAdapter is lacking Methods to handle incoming Messages

Hi,

I just noticed, that ModuleClientAdapter provides methods to send events/messages to other modules/IoTHub but lacks methods to receive messages. Do you plan to provide an interface to access this ModuleClient method? If so, where? Or did i miss a way to receive messages without creating a new ModuleClient?

Regards

Matthias

Message batching via JSON array

Hi,

we're currently evaluating whether or not it would be feasible to connect multiple OPC UA endpoints (and therefore multiple logical or even physical devices) via a single instance of the opc publisher. Doing so, we ran into the fact that the opc publisher batches messages "manually" using a JSON array of messages - on application layer if you will. In our scenario, this means we might end up with messages from different OPC UA endpoints within the same IoT Hub message. This in turn becomes challenging later on within the processing pipeline, e.g., when joining incoming messages with state from CosmosDB via Azure Functions - we would need to join with multiple documents within a single trigger.

My question is the following: Is this choice intentional? Is there a reason for this design we're not seeing? It seems that the IoT Hub c# SDK offers DeviceClient.SendEventBatchAsync for transport layer optimization, which would potentially avoid this issue.

Also, any idea for a workaround, e.g., disabling batching or splitting messages up within Azure?

Make QueueSize configurable

We use the OPCPublisher now in production at our customer to read ~16 values from a plc every 50 milliseconds.

We monitor the ingest and everything seems to works fine except for one thing: once every minute (on average) several node values are skipped. We know this because the values produced contain a counter.

We traced this back to the QueueSize:

https://github.com/Azure/iot-edge-opc-publisher/blob/master/opcpublisher/OpcMonitoredItem.cs#L577

If we increase this to 50, we retrieve all data as expected.

Please make this QueueSize configurable.

Problem in start the opc twin deployment

I followed the procedure of deploying OPC twin to IoT Edge. The docs is in
https://docs.microsoft.com/en-us/azure/iot-accelerators/howto-opc-twin-deploy-modules

When I proceeded to start the deployment with iotedgehubdev in "run and debug locally" part, The powershell alerted with " ERROR: local variable 'module_content' referenced before assignment ".

It seems like a coding problem. Someone made a global-local variable problem or an uninitialized variable access.

My previous procedures are all good. There shouldn't be any problem with the other steps.

I am not sure if I should ask you or the iotedgedev group. Please reply to me if you have any clue to fix it.

Don't convert NodeId if it has a namespace id

If you have a node that has the NodeId ns=2;i=10157 and NamespaceUris[2] == http://test.org/UA/Data/ then the NodeId changes to http://test.org/UA/Data/#i=10157.
If you do /v2/browse/{endpointId} with NodeId = http://test.org/UA/Data/#i=10157 you will get the expected response (some referenced nodes).

There is an OPC UA server that has a NamespaceUris[4] like abc/xyz without any http:// prefix and ns=4;i=123 results in abc/xyz#i=123. For some reason the /v2/browse/{endpointId} returns the root nodes and not the expected referenced nodes from ns=4;i=123.
I compared it with the software UaExpert and this program uses ns=4;i=123 instead of abc/xyz#i=123 which results in the expected response.

So I searched the twin modul source code and found a way to remove the conversion to abc/xyz#i=123 and now I can browse the node as expected.

My request is:
https://github.com/Azure/azure-iiot-opc-ua/blob/e88aaf8b16a74f2016fbf5f6ec64439ec0a6516a/src/Microsoft.Azure.IIoT.OpcUa.Edge/src/Control/AddressSpaceServices.cs#L782
change to
var id = nodeId.ToString();

Fail to add device connection string to secure store on Mac.

Fail to add device connection string to secure store on Mac.

It seems the apple keychain store dislikes one of the records in the generated cert?
"An invalid record was encountered."

Exception
Exception thrown: 'Interop.AppleCrypto.AppleCommonCryptoCryptographicException' in System.Security.Cryptography.X509Certificates.dll
Message: "An invalid record was encountered."

Call Stack:
" at Interop.AppleCrypto.X509StoreAddCertificate(SafeKeychainItemHandle certOrIdentity, SafeKeychainHandle keychain)\n at Internal.Cryptography.Pal.StorePal.AppleKeychainStore.Add(ICertificatePal cert)\n at System.Security.Cryptography.X509Certificates.X509Store.Add(X509Certificate2 certificate)\n at OpcPublisher.SecureIoTHubToken.d__1.MoveNext() in /iot-edge-opc-publisher/src/SecureIoTHubToken.cs:line 203"

Workaround:
By removing the calls to Write and Read Connection string from store and instead use the one passed in as command line argument the OpcPublisher works fine.
I also had to change the store location from CurrentUser\UA_MachineDefault to CurrentUser\My, which is expected on Mac?

What about the publication of Events? (feature request)

The OPC UA PubSub specification supports the publication of OPC UA Events. In the Part 14 specification, there is the PublishedEventsType.

Do you plan to support the publication of events in the OPC Publisher?

As a matter of fact, most industrial processes generate Alarms. This feature is really important for applications which need to analyze and store alarms with Azure services.

Best regards,

Opc Twin exception when cancelling the discovery

I run the twin in windows iotedge context. When the container stopped, I get the following exception:

[11:09:24 DBG] Processing new settings...
[11:09:24 INF] Setting log level to Verbose
[11:09:24 INF] Cancelled discovery.
[11:09:24 ERR] Exception applying changes! Continue...
System.AggregateException: One or more errors occurred. (The CancellationTokenSource has been disposed.) (The CancellationTokenSource has been disposed.) (The CancellationTokenSource has been disposed.) (The CancellationTokenSource has been disposed.) ---> System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at System.Threading.CancellationTokenSource.Cancel()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
--- End of inner exception stack trace ---
at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
at Microsoft.Azure.IIoT.OpcUa.Edge.Discovery.DiscoveryServices.StopAsync()
at Microsoft.Azure.IIoT.OpcUa.Edge.Discovery.DiscoveryServices.ScanAsync()
at Microsoft.Azure.IIoT.Module.Framework.Hosting.SettingsRouter.Controller.SafeApplyAsync()
---> (Inner Exception #0) System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at System.Threading.CancellationTokenSource.Cancel()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)<---

---> (Inner Exception #1) System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at System.Threading.CancellationTokenSource.Cancel()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)<---

---> (Inner Exception #2) System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at System.Threading.CancellationTokenSource.Cancel()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)<---

---> (Inner Exception #3) System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at System.Threading.CancellationTokenSource.Cancel()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)<---
[11:09:24 DBG] uat7e2fa8eb01dd7acb2fd8371c67faed30e2349dda twin already running.
[11:09:24 DBG] Applying new settings took 00:00:00.0742813...
[11:09:24 DBG] Reporting setting results...

JSON message format to IotHub

Hi - I have the module up and running pulling data from a BACnet device (via Kepware). The format of the output JSON is as follows:

{
"NodeId": "nsu=KEPServerEX;s=Channel1.Device2.AnalogInput_1.Water Temperature",
"ApplicationUri": "urn:DAVEDEV:Kepware.KEPServerEX.V6:UA%20Server",
"DisplayName": "Water Temperature",
"Value": 37.1,
"SourceTimestamp": "2018-04-30T14:09:59.4983294Z"
},{
"NodeId": "nsu=KEPServerEX;s=Channel1.Device2.AnalogInput_0.Indoor Temperature",
"ApplicationUri": "urn:DAVEDEV:Kepware.KEPServerEX.V6:UA%20Server",
"DisplayName": "Indoor Temperature",
"Value": 20.9,
"SourceTimestamp": "2018-04-30T14:10:00.4993239Z"
},
........

How do I configure it to send it as the following format (i.e. merging the DisplayName and Value attributes into a single parameter) so that I can via the streaming data in PowerBI?

{
"NodeId": "nsu=KEPServerEX;s=Channel1.Device2.AnalogInput_1.Water Temperature",
"ApplicationUri": "urn:DAVEDEV:Kepware.KEPServerEX.V6:UA%20Server",
"Water Temperature": "37.1",
"SourceTimestamp": "2018-04-30T14:09:59.4983294Z"
},{
"NodeId": "nsu=KEPServerEX;s=Channel1.Device2.AnalogInput_0.Indoor Temperature",
"ApplicationUri": "urn:DAVEDEV:Kepware.KEPServerEX.V6:UA%20Server",
"Indoor Temperature": "20.9",
"SourceTimestamp": "2018-04-30T14:10:00.4993239Z"
},
.......

ERROR: Could not create module publisher: invalid reference format

Hi all,

trying to deploy opcua publisher module to IOTEDGE and getting following error:

System.AggregateException: One or more errors occurred. (Error calling Create module publisher: Could not create module publisher
        caused by: Could not pull image docker pull mcr.microsoft.com/iotedge/opc-publisher:2.3
        caused by: invalid reference format) ---> Microsoft.Azure.Devices.Edge.Agent.Edgelet.EdgeletCommunicationException: Error calling Create module publisher: Could not create module publisher
        caused by: Could not pull image docker pull mcr.microsoft.com/iotedge/opc-publisher:2.3
        caused by: invalid reference format

Running Microsoft Windows 10 Enterprise LTSC with (WINDOWS) container support.

Using IoTPublisher as Docker on Windows10 VM

I am trying to setup IoTPublisher as Docker on Windows10 VM. I was able to do it successfully on Windows 10 physical box but on VM when I am trying I am getting error as "The virtual machine could not be started because a required feature is not installed.". Full log is below.
Any suggestions what feature I am missing? I have checked for Hyper-V and it is enabled. Docker utility starts fine too.

Unable to find image 'mcr.microsoft.com/iotedge/opc-publisher:latest' locally
latest: Pulling from iotedge/opc-publisher
1046f7eb9dcd: Pull complete
6f1f8791e0d9: Pull complete
a41e1af5bf81: Pull complete
66a9e697ff38: Pull complete
feda77540060: Pull complete
5024791aecb5: Pull complete
655fe33729a4: Pull complete
55bbf29f281d: Pull complete
605880546ea0: Pull complete
a332495752e9: Pull complete
Digest: sha256:3bcd0d721d5e24aab54cfa11b4996ba0c282e2701e7a1b9d8895d1ef55e0053c
Status: Downloaded newer image for mcr.microsoft.com/iotedge/opc-publisher:latest
docker: Error response from daemon: CreateComputeSystem e811898b3a4e78a9da2bbee9452ef3212e6362ca84ef72f3a45137fb7b9d8e6a: The virtual machine could not be started because a required feature is not installed.
(extra info: {"SystemType":"Container","Name":"e811898b3a4e78a9da2bbee9452ef3212e6362ca84ef72f3a45137fb7b9d8e6a","Owner":"docker","IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\ProgramData\Docker\windowsfilter\e811898b3a4e78a9da2bbee9452ef3212e6362ca84ef72f3a45137fb7b9d8e6a","Layers":[{"ID":"7b8f7f87-38d6-5d0d-821a-26c29c5e0203","Path":"C:\ProgramData\Docker\windowsfilter\94201b9eeac785e7f39c214099a154b1263f22acdd815203b716cef2cc82c584"},{"ID":"e7dfef31-d7d9-5431-bf3f-800f590bc818","Path":"C:\ProgramData\Docker\windowsfilter\96b93e1843d609269f6a6c0b45dcf5b72266b3866c3f11e082bb66eae052bb1e"},{"ID":"c198048b-0c50-5373-a2d6-d6d13c27c491","Path":"C:\ProgramData\Docker\windowsfilter\f93d56374809693f03928588b6aa6dd8c28b5e2e423a3366f38b63e016c667bc"},{"ID":"5eabac14-e108-5e40-bada-ddf4b053bec9","Path":"C:\ProgramData\Docker\windowsfilter\6166952b391f40aa5a2c11a5c5815020182a67d19c65f66f5e0c40c4dca02a2a"},{"ID":"ac44450b-7025-50cd-b861-2b9645ec17d0","Path":"C:\ProgramData\Docker\windowsfilter\8a17b57f55a9759e1576cd2af3988ea4f4a1ee4a0fd5c9ec1c24cd309b72aad7"},{"ID":"f92b7751-c203-585e-acac-a0c203c06eb5","Path":"C:\ProgramData\Docker\windowsfilter\a6f0faceda7dd78f89527b756b9e5528d81179184958ffdfdc1656c0407dc031"},{"ID":"523ff6e4-09a3-5605-b036-3c134ccfbff0","Path":"C:\ProgramData\Docker\windowsfilter\ee904689f7429ac9e6df37b63537ca0d4aef6a9398f9f0804508de58ce790706"},{"ID":"fa1b4841-c063-556d-92c1-6a60425f9c88","Path":"C:\ProgramData\Docker\windowsfilter\687716bffabc476b40ba4190857375e84b5b2ac1c959b629e25a2f866929916f"},{"ID":"d5f469f5-24ef-5760-afd5-3064566eec44","Path":"C:\ProgramData\Docker\windowsfilter\c6f58f9ce28e20e271c5febd9121d6702f6c544c61dd1aabaacc7a2b307d0265"},{"ID":"5a795570-3ca2-5f59-a879-057baf5f4617","Path":"C:\ProgramData\Docker\windowsfilter\1ae07ac4cc1747cd8a4a15275803ff026c15ce978e23d153fdd22a8e92767d39"}],"HostName":"e811898b3a4e","MappedDirectories":[{"HostPath":"c:\iotpublisher","ContainerPath":"c:\appdata","ReadOnly":false,"BandwidthMaximum":0,"IOPSMaximum":0,"CreateInUtilityVM":false}],"HvPartition":true,"EndpointList":["3E27E67B-4D84-4F21-8C74-F7A0D1BB7D43"],"HvRuntime":{"ImagePath":"C:\ProgramData\Docker\windowsfilter\1ae07ac4cc1747cd8a4a15275803ff026c15ce978e23d153fdd22a8e92767d39\UtilityVM"},"AllowUnqualifiedDNSQuery":true}).

Message Compression

Is there any planned support for messages to be compressed that are sent to IoT Hub Messages?

This would be especially beneficial in larger systems where a lot of data is being collected and sent over a WAN connection. Since ASA supports ingesting GZIP compressed messages from IoT Hub having an option to compress messages in OPC Publisher with GZIP would be beneficial.

Communication error when browsing endpoint (Running in IoT Edge)

Hi, I followed the instruction here to deploy the opc-twin module in IoT edge.

And I can successfully discover my OPC UA server, and find endpoint, but when I started to browse node, the OPC-twin module shows error as below.

[09:32:16 DBG] uat4600fc959c1d15666910d6166ef5c0f76203de0d twin starting...
[09:32:16 DBG] Starting Module Host...
[09:32:16 INF] Running in iotedge production context.
[09:32:17 INF] Module moxagateway_opctwin connection status changed to Connected due to Connection_Ok.
[09:32:17 INF] Module moxagateway_opctwin connection status changed to Disconnected_Retrying due to Communication_Error.
[09:32:17 INF] Module moxagateway_opctwin connection status changed to Disconnected_Retrying due to Communication_Error.
[09:32:17 INF] Module moxagateway_opctwin connection status changed to Connected due to Connection_Ok.
[09:32:17 ERR] Error #1 in twin host - restarting...
System.TimeoutException: The operation timed out. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Microsoft.Azure.Devices.Client.Transport.AmqpTransportHandler.RoundTripTwinMessage(AmqpMessage amqpMessage, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Client.Transport.AmqpTransportHandler.SendTwinGetAsync(CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass27_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.SendTwinGetAsync(CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Client.InternalClient.GetTwinAsync()
--- End of inner exception stack trace ---
at Microsoft.Azure.IIoT.Module.Framework.Hosting.ModuleHost.StartAsync(String type, String siteId, String serviceInfo, IProcessControl reset)
at Microsoft.Azure.IIoT.OpcUa.Edge.Supervisor.SupervisorServices.TwinHost.RunAsync()

擷取

But It will not happen while I run the twin-module via docker-compose.
Do you have any idea to slove the problem? thank you.

Cannot connect to OPCUA Server with hostname in server endpoint

Hi,

I confronted a problem while I was using publisher ver. 2.3.3 as an IoT Edge module on Azure VM (Windows 10 Pro 1809). When I specified the server endpoint with hostname in pn.json file, the publisher module couldn't establish connection with OPCUA server (I have done additional test that I replaced hostname with IP address, and it worked!). Could you please advise me how I can fix the connection problem with hostname in server endpoint?

And there was an ExtraHosts container create option to specify the hostname-IP pairs in the previous version. May I know how publisher module looks up the IP without ExtraHosts configuration?
And I provide my system information and module settings below.

While using hostname in server endpoint (opc.tcp://brianopc:62541/Quickstarts/ReferenceServer), the prompted error messages are as following.

[07:41:12 INF] Publisher is running. Press CTRL-C to quit.
[07:41:12 INF] Connect and monitor session and nodes on endpoint 'opc.tcp://brianopc:62541/Quickstarts/ReferenceServer'.
[07:41:36 ERR] Session creation to endpoint 'opc.tcp://brianopc:62541/Quickstarts/ReferenceServer' failed 1 time(s). Please verify if server is up and Publisher configuration is correct.
Opc.Ua.ServiceResultException: Error establishing a connection: BadNotConnected
   at Opc.Ua.Bindings.ChannelAsyncOperation`1.End(Int32 timeout, Boolean throwOnError)
   at Opc.Ua.Bindings.UaSCUaBinaryClientChannel.EndSendRequest(IAsyncResult result)
   at Opc.Ua.Bindings.UaSCUaBinaryTransportChannel.EndSendRequest(IAsyncResult result)
   at Opc.Ua.Bindings.UaSCUaBinaryTransportChannel.SendRequest(IServiceRequest request)
   at Opc.Ua.DiscoveryClient.GetEndpoints(RequestHeader requestHeader, String endpointUrl, StringCollection localeIds, StringCollection profileUris, EndpointDescriptionCollection& endpoints)
   at Opc.Ua.DiscoveryClient.GetEndpoints(StringCollection profileUris)
   at Opc.Ua.Client.CoreClientUtils.SelectEndpoint(String discoveryUrl, Boolean useSecurity, Int32 operationTimeout)
   at OpcPublisher.OpcSession.ConnectSessionAsync(CancellationToken ct) in C:\app\opcpublisher\OpcSession.cs:line 288

However, I changed the hostname (brianopc) in the server endpoint to my VM's IP address (10.0.3.4), the publisher module worked fine! And the messages are stated as below.

[07:48:25 INF] Publisher is running. Press CTRL-C to quit.
[07:48:25 INF] Connect and monitor session and nodes on endpoint 'opc.tcp://10.0.3.4:62541/Quickstarts/ReferenceServer'.
[07:48:27 INF] Create unsecured session for endpoint URI 'opc.tcp://10.0.3.4:62541/Quickstarts/ReferenceServer' with timeout of 10000 ms.
[07:48:27 INF] Session successfully created with Id ns=3;i=2093901607.
[07:48:27 INF] The session to endpoint 'opc.tcp://10.0.3.4:62541/Quickstarts/ReferenceServer' has 4 entries in its namespace array:
[07:48:27 INF] Namespace index 0: http://opcfoundation.org/UA/
[07:48:27 INF] Namespace index 1: urn:brianopc:UA:Quickstarts:ReferenceServer
[07:48:27 INF] Namespace index 2: http://opcfoundation.org/Quickstarts/ReferenceApplications
[07:48:27 INF] Namespace index 3: http://opcfoundation.org/UA/Diagnostics
[07:48:27 INF] Created subscription with id 3 on endpoint 'opc.tcp://10.0.3.4:62541/Quickstarts/ReferenceServer'
[07:48:27 INF] Create subscription on endpoint 'opc.tcp://10.0.3.4:62541/Quickstarts/ReferenceServer' requested OPC publishing interval is 5000 ms. (revised: 5000 ms)
[07:48:27 INF] Start monitoring items on endpoint 'opc.tcp://10.0.3.4:62541/Quickstarts/ReferenceServer'. Currently monitoring 0 items.
[07:48:28 INF] Done processing unmonitored items on endpoint 'opc.tcp://10.0.3.4:62541/Quickstarts/ReferenceServer' took 916 msec. Now monitoring 1 items in subscription with id '3'.

Here I provide my environment info.
VM on Azure

  • VM Size: D2s v3
  • OS: Windows 10 Pro ver.1809
  • Container: Windows container

IoT Edge & Module

  • Container URI: mcr.microsoft.com/iotedge/opc-publisher:2.3.3-windows-amd64
  • Container Create Option:
{
  "Hostname": "publisher",
  "Cmd": [
    "--pf=./pn.json",
    "--aa"
  ],
  "HostConfig": {
    "Binds": [
      "c:/iiotedge:c:/appdata"
    ]
  }
}
  • pn.json file content:
[
  {
    "EndpointUrl": "opc.tcp://brianopc:62541/Quickstarts/ReferenceServer",
    "UseSecurity": false,
    "OpcNodes": [
      {
        "Id": "ns=2;s=Scalar_Simulation_Int64",
        "OpcSamplingInterval": 2000,
        "OpcPublishingInterval": 5000,
        "DisplayName": "Current time"
      }
    ]
  }
]

Best regards,
Brian Liu

Using ToUniversalTime conversion in HeartBeat message should be ommited

https://github.com/Azure/iot-edge-opc-publisher/blob/a82d885971608f928492060c2e54ffb0de315ba4/opcpublisher/OpcMonitoredItem.cs line 618 contains TimeStamp creation for heartbeat message and there ToUniversalTime conversion used:

HeartbeatMessage.SourceTimestamp = sourceTimestamp.ToUniversalTime().ToString("o", CultureInfo.InvariantCulture);

This is not in pair with "value change" messages/notifications where ToUniversalTime conversion is not used. Please correct me if I am wrong and there is reason for this, but in my opinion this just causes inconsistency in SourceTimeStamp output values. HeartBeat timestamp would be created correctly holding timezone information even without ToUniversalTime conversion.

Add support for running the publisher as a windows service

In our environment it is necessary to run the publisher as a standalone application without a user being logged in.
Therefore it would be necessary to launch it as a windows service.
It would be great if this could be added.
best regards
Hartmut

value is empty

Hi,

The value of my server is always empty. Anyone who has had this problem?

Setup:
OPC DA Server --> OPC COM Wrapper --> OPC publisher module (on IoT Edge)

What I receive in the opc publisher module (value null);
2018-10-31 11:58:44.298 +00:00 [VRB] OPC: PUBLISH #5 RECEIVED
2018-10-31 11:58:44.299 +00:00 [VRB] OPC: Publish Completed. RequestHandle=5, PendingRequestCount=1
2018-10-31 11:58:44.300 +00:00 [VRB] OPC: NOTIFICATION RECEIVED: SubId=20, SeqNo=1
2018-10-31 11:58:44.301 +00:00 [VRB] OPC: Publish Called. RequestHandle=7, PendingRequestCount=2
2018-10-31 11:58:44.302 +00:00 [VRB] OPC: PUBLISH #7 SENT
2018-10-31 11:58:44.304 +00:00 [VRB] OPC: NotificationReceived: ClientHandle=219, Value=
2018-10-31 11:58:44.308 +00:00 [DBG] ApplicationUri: urn:ti-fabb442c:UA:ComServerWrapper
2018-10-31 11:58:44.308 +00:00 [DBG] EndpointUrl: opc.tcp://IP:48400/UA/ComServerWrapper
2018-10-31 11:58:44.309 +00:00 [DBG] DisplayName: ns=2;s=0:OPC-Tick
2018-10-31 11:58:44.309 +00:00 [DBG] Value:

If I check with an OPC UA Client I always get a value:
image

Thanks

Dries

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.