0

我使用 package.json 设置了对几个 nodeId 的监视node-opcua。它工作了一段时间,但随后开始打印一些超时消息。

journalctl是我的服务的输出:

Apr 07 08:02:02 test-machine myservice[559]:  Timeout .... waiting for response for  ReadRequest { /*RequestHeader*/
Apr 07 08:02:02 test-machine myservice[559]:  authenticationToken           /* NodeId                           */: ns=0;i=50
Apr 07 08:02:02 test-machine myservice[559]:  timeStamp                     /* UtcTime                          */: 2017-04-07T15:01:02.501Z
Apr 07 08:02:02 test-machine myservice[559]:  requestHandle                 /* IntegerId                        */: 334               0x14e
Apr 07 08:02:02 test-machine myservice[559]:  returnDiagnostics             /* UInt32                           */: 0               0x0
Apr 07 08:02:02 test-machine myservice[559]:  auditEntryId                  /* UAString                         */:
Apr 07 08:02:02 test-machine myservice[559]:  timeoutHint                   /* UInt32                           */: 0               0x0
Apr 07 08:02:02 test-machine myservice[559]:  additionalHeader              /* ExtensionObject                  */: null
Apr 07 08:02:02 test-machine myservice[559]: };
Apr 07 08:02:02 test-machine myservice[559]:  warning :  Transaction has timed out
Apr 07 08:02:15 test-machine myservice[559]:  Timeout .... waiting for response for  ReadRequest { /*RequestHeader*/
Apr 07 08:02:15 test-machine myservice[559]:  authenticationToken           /* NodeId                           */: ns=0;i=50
Apr 07 08:02:15 test-machine myservice[559]:  timeStamp                     /* UtcTime                          */: 2017-04-07T15:01:15.835Z
Apr 07 08:02:15 test-machine myservice[559]:  requestHandle                 /* IntegerId                        */: 335               0x14f
Apr 07 08:02:15 test-machine myservice[559]:  returnDiagnostics             /* UInt32                           */: 0               0x0
Apr 07 08:02:15 test-machine myservice[559]:  auditEntryId                  /* UAString                         */:
Apr 07 08:02:15 test-machine myservice[559]:  timeoutHint                   /* UInt32                           */: 0               0x0
Apr 07 08:02:15 test-machine myservice[559]:  additionalHeader              /* ExtensionObject                  */: null
Apr 07 08:02:15 test-machine myservice[559]: };
Apr 07 08:02:15 test-machine myservice[559]:  warning :  Transaction has timed out
Apr 07 08:02:29 test-machine myservice[559]:  Timeout .... waiting for response for  ReadRequest { /*RequestHeader*/
Apr 07 08:02:29 test-machine myservice[559]:  authenticationToken           /* NodeId                           */: ns=0;i=50
Apr 07 08:02:29 test-machine myservice[559]:  timeStamp                     /* UtcTime                          */: 2017-04-07T15:01:29.169Z
Apr 07 08:02:29 test-machine myservice[559]:  requestHandle                 /* IntegerId                        */: 336               0x150
Apr 07 08:02:29 test-machine myservice[559]:  returnDiagnostics             /* UInt32                           */: 0               0x0
Apr 07 08:02:29 test-machine myservice[559]:  auditEntryId                  /* UAString                         */:
Apr 07 08:02:29 test-machine myservice[559]:  timeoutHint                   /* UInt32                           */: 0               0x0
Apr 07 08:02:29 test-machine myservice[559]:  additionalHeader              /* ExtensionObject                  */: null
Apr 07 08:02:29 test-machine myservice[559]: };
Apr 07 08:02:29 test-machine myservice[559]:  warning :  Transaction has timed out
Apr 07 08:03:01 test-machine myservice[559]:  Timeout .... waiting for response for  OpenSecureChannelRequest { /*RequestHeader*/
Apr 07 08:03:01 test-machine myservice[559]:  authenticationToken           /* NodeId                           */: ns=0;i=0
Apr 07 08:03:01 test-machine myservice[559]:  timeStamp                     /* UtcTime                          */: 2017-04-07T15:02:01.928Z
Apr 07 08:03:01 test-machine myservice[559]:  requestHandle                 /* IntegerId                        */: 337               0x151
Apr 07 08:03:01 test-machine myservice[559]:  returnDiagnostics             /* UInt32                           */: 0               0x0
Apr 07 08:03:01 test-machine myservice[559]:  auditEntryId                  /* UAString                         */: null
Apr 07 08:03:01 test-machine myservice[559]:  timeoutHint                   /* UInt32                           */: 0               0x0
Apr 07 08:03:01 test-machine myservice[559]:  additionalHeader              /* ExtensionObject                  */: null
Apr 07 08:03:01 test-machine myservice[559]: };
Apr 07 08:03:01 test-machine myservice[559]: Warning: securityToken hasn't been renewed

基本上我想保持监控永远进行,每 15 分钟发布一次。因此,如果有人也可以帮助我提供参数,那将是非常棒的。

4

1 回答 1

0

如果您有权访问服务器,则可以查看这篇文章

他们在帖子中指出,当您设置客户端时,requestedLifetimeCount * requestedPublishingInterval应至少设置为PublishRequest.RequestHeader.timeoutHint

var options = {
  requestedPublishingInterval: 1000, // check on server
  requestedMaxKeepAliveCount: 2,
  requestedLifetimeCount: 100, // check on server
  maxNotificationsPerPublish: 10,
  publishingEnabled: true,
  priority: 10,
}

var subscription = new opcua.ClientSubscription(opcSession, options);

于 2017-04-12T06:33:22.707 回答